NO-JIRA Using Wait.assertEquals on test
This commit is contained in:
parent
ecf4110b1b
commit
691300d10e
|
@ -26,7 +26,6 @@ import org.junit.Rule;
|
|||
import org.junit.Test;
|
||||
import org.junit.rules.RuleChain;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
|
||||
public class ActiveMQConsumerResourceTest {
|
||||
|
@ -58,13 +57,7 @@ public class ActiveMQConsumerResourceTest {
|
|||
@After
|
||||
public void tearDown() throws Exception {
|
||||
assertNotNull(String.format(ASSERT_SENT_FORMAT, TEST_ADDRESS), sent);
|
||||
Wait.waitFor(new Wait.Condition() {
|
||||
@Override
|
||||
public boolean isSatisfied() throws Exception {
|
||||
return server.getMessageCount(TEST_QUEUE) == 1;
|
||||
}
|
||||
}, 5000, 100);
|
||||
assertEquals(String.format(ASSERT_COUNT_FORMAT, TEST_QUEUE), 1, server.getMessageCount(TEST_QUEUE));
|
||||
Wait.assertEquals(1, () -> server.getMessageCount(TEST_QUEUE));
|
||||
|
||||
ClientMessage received = consumer.receiveMessage();
|
||||
assertNotNull(String.format(ASSERT_RECEIVED_FORMAT, TEST_ADDRESS), received);
|
||||
|
|
Loading…
Reference in New Issue