File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
micrometer-test/src/test/java/io/micrometer/core/instrument/binder/jms Expand file tree Collapse file tree 1 file changed +6
-3
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 ;
34
35
35
36
import static org .assertj .core .api .Assertions .assertThat ;
36
37
import static org .assertj .core .api .Assertions .assertThatThrownBy ;
38
+ import static org .awaitility .Awaitility .await ;
37
39
38
40
/**
39
41
* Tests for {@link JmsInstrumentation}.
@@ -131,9 +133,10 @@ void shouldInstrumentMessageListener() throws Exception {
131
133
MessageProducer producer = session .createProducer (topic );
132
134
producer .send (session .createTextMessage ("test send" ));
133
135
assertThat (latch .await (2 , TimeUnit .SECONDS )).isTrue ();
134
- assertThat (registry ).hasObservationWithNameEqualTo ("jms.message.process" )
135
- .that ()
136
- .hasContextualNameEqualTo ("test.send process" );
136
+ await ().atMost (Duration .ofSeconds (1 ))
137
+ .untilAsserted (() -> assertThat (registry ).hasObservationWithNameEqualTo ("jms.message.process" )
138
+ .that ()
139
+ .hasContextualNameEqualTo ("test.send process" ));
137
140
}
138
141
}
139
142
You can’t perform that action at this time.
0 commit comments