|
|
|
@ -57,7 +57,7 @@ import static org.springframework.test.web.client.response.MockRestResponseCreat
|
|
|
|
|
@SuppressWarnings({ "deprecation", "removal" })
|
|
|
|
|
class RestTemplateObservationConfigurationTests {
|
|
|
|
|
|
|
|
|
|
private final ApplicationContextRunner contextRunner = new ApplicationContextRunner().with(MetricsRun.simple())
|
|
|
|
|
private final ApplicationContextRunner contextRunner = new ApplicationContextRunner()
|
|
|
|
|
.withBean(ObservationRegistry.class, TestObservationRegistry::create)
|
|
|
|
|
.withConfiguration(AutoConfigurations.of(ObservationAutoConfiguration.class,
|
|
|
|
|
RestTemplateAutoConfiguration.class, HttpClientObservationsAutoConfiguration.class));
|
|
|
|
@ -118,7 +118,8 @@ class RestTemplateObservationConfigurationTests {
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
void afterMaxUrisReachedFurtherUrisAreDenied(CapturedOutput output) {
|
|
|
|
|
this.contextRunner.withPropertyValues("management.metrics.web.client.max-uri-tags=2").run((context) -> {
|
|
|
|
|
this.contextRunner.with(MetricsRun.simple()).withPropertyValues("management.metrics.web.client.max-uri-tags=2")
|
|
|
|
|
.run((context) -> {
|
|
|
|
|
|
|
|
|
|
RestTemplate restTemplate = context.getBean(RestTemplateBuilder.class).build();
|
|
|
|
|
MockRestServiceServer server = MockRestServiceServer.createServer(restTemplate);
|
|
|
|
|