Skip to content

Commit abfdfc3

Browse files
committed
Merge branch '2.3.x'
Closes gh-23908
2 parents 9ab3abb + c0bb6ff commit abfdfc3

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

spring-boot-project/spring-boot-actuator-autoconfigure/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ dependencies {
122122
testImplementation("org.apache.logging.log4j:log4j-to-slf4j")
123123
testImplementation("org.aspectj:aspectjrt")
124124
testImplementation("org.assertj:assertj-core")
125+
testImplementation("org.awaitility:awaitility")
125126
testImplementation("org.eclipse.jetty:jetty-webapp")
126127
testImplementation("org.glassfish.jersey.ext:jersey-spring5")
127128
testImplementation("org.glassfish.jersey.media:jersey-media-json-jackson")

spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/test/MetricsIntegrationTests.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2019 the original author or authors.
2+
* Copyright 2012-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -16,6 +16,7 @@
1616

1717
package org.springframework.boot.actuate.autoconfigure.metrics.test;
1818

19+
import java.time.Duration;
1920
import java.util.Collections;
2021
import java.util.Map;
2122
import java.util.Set;
@@ -71,6 +72,7 @@
7172
import org.springframework.web.client.RestTemplate;
7273

7374
import static org.assertj.core.api.Assertions.assertThat;
75+
import static org.awaitility.Awaitility.waitAtMost;
7476
import static org.springframework.test.web.client.ExpectedCount.once;
7577
import static org.springframework.test.web.client.match.MockRestRequestMatchers.method;
7678
import static org.springframework.test.web.client.match.MockRestRequestMatchers.requestTo;
@@ -110,7 +112,9 @@ void restTemplateIsInstrumented() {
110112
@Test
111113
void requestMappingIsInstrumented() {
112114
this.loopback.getForObject("/api/people", Set.class);
113-
assertThat(this.registry.get("http.server.requests").timer().count()).isEqualTo(1);
115+
waitAtMost(Duration.ofSeconds(5)).untilAsserted(
116+
() -> assertThat(this.registry.get("http.server.requests").timer().count()).isEqualTo(1));
117+
114118
}
115119

116120
@Test

0 commit comments

Comments
 (0)