Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
22192c2b
Commit
22192c2b
authored
Feb 12, 2019
by
Andy Wilkinson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish "Make auto-config of RestTemplate metrics back off with no builder bean"
Closes gh-15842
parent
8f3c4dbc
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
13 deletions
+14
-13
HttpClientMetricsAutoConfiguration.java
...etrics/web/client/HttpClientMetricsAutoConfiguration.java
+2
-1
RestTemplateMetricsConfiguration.java
.../metrics/web/client/RestTemplateMetricsConfiguration.java
+1
-1
RestTemplateMetricsConfigurationTests.java
...ics/web/client/RestTemplateMetricsConfigurationTests.java
+11
-11
No files found.
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/web/client/HttpClientMetricsAutoConfiguration.java
View file @
22192c2b
/*
* Copyright 2012-201
8
the original author or authors.
* Copyright 2012-201
9
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -39,6 +39,7 @@ import org.springframework.core.annotation.Order;
* @author Jon Schneider
* @author Phillip Webb
* @author Stephane Nicoll
* @author Raheela Aslam
* @since 2.1.0
*/
@Configuration
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/web/client/RestTemplateMetricsConfiguration.java
View file @
22192c2b
...
...
@@ -35,7 +35,7 @@ import org.springframework.web.client.RestTemplate;
*
* @author Jon Schneider
* @author Phillip Webb
* @author
raheela.a
slam
* @author
Raheela A
slam
*/
@Configuration
@ConditionalOnClass
(
RestTemplate
.
class
)
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/web/client/RestTemplateMetricsConfigurationTests.java
View file @
22192c2b
...
...
@@ -42,7 +42,7 @@ import static org.springframework.test.web.client.response.MockRestResponseCreat
*
* @author Stephane Nicoll
* @author Jon Schneider
* @author
raheela.a
slam
* @author
Raheela A
slam
*/
public
class
RestTemplateMetricsConfigurationTests
{
...
...
@@ -100,6 +100,16 @@ public class RestTemplateMetricsConfigurationTests {
});
}
@Test
public
void
backsOffWhenRestTemplateBuilderIsMissing
()
{
new
ApplicationContextRunner
().
with
(
MetricsRun
.
simple
())
.
withConfiguration
(
AutoConfigurations
.
of
(
HttpClientMetricsAutoConfiguration
.
class
))
.
run
((
context
)
->
assertThat
(
context
)
.
doesNotHaveBean
(
DefaultRestTemplateExchangeTagsProvider
.
class
)
.
doesNotHaveBean
(
MetricsRestTemplateCustomizer
.
class
));
}
private
MeterRegistry
getInitializedMeterRegistry
(
AssertableApplicationContext
context
)
{
MeterRegistry
registry
=
context
.
getBean
(
MeterRegistry
.
class
);
...
...
@@ -133,14 +143,4 @@ public class RestTemplateMetricsConfigurationTests {
return
restTemplate
;
}
@Test
public
void
backsOffWhenRestTemplateBuilderIsMissing
()
{
new
ApplicationContextRunner
().
with
(
MetricsRun
.
simple
())
.
withConfiguration
(
AutoConfigurations
.
of
(
HttpClientMetricsAutoConfiguration
.
class
))
.
run
((
context
)
->
assertThat
(
context
)
.
doesNotHaveBean
(
DefaultRestTemplateExchangeTagsProvider
.
class
)
.
doesNotHaveBean
(
MetricsRestTemplateCustomizer
.
class
));
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment