|
18 | 18 |
|
19 | 19 | import static org.assertj.core.api.Assertions.assertThat; |
20 | 20 | import static org.assertj.core.api.Assertions.fail; |
| 21 | +import static org.awaitility.Awaitility.await; |
21 | 22 | import static org.mockito.Mockito.mock; |
22 | 23 |
|
23 | 24 | import java.io.IOException; |
|
30 | 31 | import java.util.ArrayList; |
31 | 32 | import java.util.HashSet; |
32 | 33 | import java.util.List; |
33 | | -import java.util.Map; |
34 | 34 | import java.util.Set; |
35 | 35 | import java.util.TreeSet; |
36 | 36 | import java.util.concurrent.CountDownLatch; |
|
73 | 73 | import org.springframework.integration.ip.tcp.serializer.ByteArrayStxEtxSerializer; |
74 | 74 | import org.springframework.integration.ip.util.TestingUtilities; |
75 | 75 | import org.springframework.integration.support.MessageBuilder; |
76 | | -import org.springframework.integration.test.util.TestUtils; |
77 | 76 | import org.springframework.messaging.Message; |
78 | 77 | import org.springframework.messaging.MessageChannel; |
79 | 78 | import org.springframework.messaging.MessagingException; |
@@ -1230,7 +1229,7 @@ public void testInterceptedConnection() throws Exception { |
1230 | 1229 | socket.close(); |
1231 | 1230 | assertThat(latch.await(10, TimeUnit.SECONDS)).isTrue(); |
1232 | 1231 | assertThat(connection.get()).isInstanceOf(HelloWorldInterceptor.class); |
1233 | | - assertThat(TestUtils.getPropertyValue(handler, "connections", Map.class)).isEmpty(); |
| 1232 | + await().untilAsserted(() -> handler.getConnections().isEmpty()); |
1234 | 1233 | scf.stop(); |
1235 | 1234 | } |
1236 | 1235 |
|
@@ -1259,7 +1258,7 @@ public void testInterceptedCleanup() throws Exception { |
1259 | 1258 | Socket socket = SocketFactory.getDefault().createSocket("localhost", port); |
1260 | 1259 | socket.close(); |
1261 | 1260 | assertThat(latch.await(10, TimeUnit.SECONDS)).isTrue(); |
1262 | | - assertThat(handler.getConnections().isEmpty()).isTrue(); |
| 1261 | + await().untilAsserted(() -> handler.getConnections().isEmpty()); |
1263 | 1262 | scf.stop(); |
1264 | 1263 | } |
1265 | 1264 |
|
|
0 commit comments