File tree 1 file changed +7
-4
lines changed
micrometer-test/src/test/java/io/micrometer/core/instrument/binder/jms 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change 15
15
*/
16
16
package io .micrometer .core .instrument .binder .jms ;
17
17
18
+ import java .time .Duration ;
18
19
import java .util .concurrent .CountDownLatch ;
19
20
import java .util .concurrent .TimeUnit ;
20
21
import java .util .stream .Stream ;
35
36
36
37
import static org .assertj .core .api .Assertions .assertThat ;
37
38
import static org .assertj .core .api .Assertions .assertThatThrownBy ;
39
+ import static org .awaitility .Awaitility .await ;
38
40
39
41
/**
40
42
* Tests for {@link JmsInstrumentation}.
@@ -134,10 +136,11 @@ void shouldInstrumentMessageListener() throws Exception {
134
136
MessageProducer producer = session .createProducer (topic );
135
137
producer .send (session .createTextMessage ("test send" ));
136
138
assertThat (latch .await (2 , TimeUnit .SECONDS )).isTrue ();
137
- TestObservationRegistryAssert .assertThat (registry )
138
- .hasObservationWithNameEqualTo ("jms.message.process" )
139
- .that ()
140
- .hasContextualNameEqualTo ("test.send process" );
139
+ await ().atMost (Duration .ofSeconds (1 ))
140
+ .untilAsserted (() -> TestObservationRegistryAssert .assertThat (registry )
141
+ .hasObservationWithNameEqualTo ("jms.message.process" )
142
+ .that ()
143
+ .hasContextualNameEqualTo ("test.send process" ));
141
144
}
142
145
}
143
146
You can’t perform that action at this time.
0 commit comments