Fixed a TU to wait an asych publish event
This commit is contained in:
@@ -163,7 +163,8 @@ public class ServerIntegrationTest {
|
|||||||
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testCleanSession_maintainClientSubscriptions_withServerRestart() throws IOException {
|
public void testCleanSession_maintainClientSubscriptions_withServerRestart() throws IOException, InterruptedException {
|
||||||
|
final CountDownLatch barrier = new CountDownLatch(1);
|
||||||
Client client = new Client("localhost", Server.PORT, "CLID_123");
|
Client client = new Client("localhost", Server.PORT, "CLID_123");
|
||||||
client.connect(false); //without session cleanup
|
client.connect(false); //without session cleanup
|
||||||
|
|
||||||
@@ -185,6 +186,7 @@ public class ServerIntegrationTest {
|
|||||||
|
|
||||||
public void published(String topic, byte[] message) {
|
public void published(String topic, byte[] message) {
|
||||||
received = true;
|
received = true;
|
||||||
|
barrier.countDown();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
client.connect(false);
|
client.connect(false);
|
||||||
@@ -192,6 +194,7 @@ public class ServerIntegrationTest {
|
|||||||
client.close();
|
client.close();
|
||||||
|
|
||||||
//Verify
|
//Verify
|
||||||
|
barrier.await(1, TimeUnit.SECONDS);
|
||||||
assertTrue(received);
|
assertTrue(received);
|
||||||
|
|
||||||
//TearDown
|
//TearDown
|
||||||
|
|||||||
Reference in New Issue
Block a user