NO-JIRA Using Wait.assertEquals on test

This commit is contained in:
Clebert Suconic 2018-02-26 16:12:22 -05:00
parent ecf4110b1b
commit 691300d10e
1 changed files with 1 additions and 8 deletions

View File

@ -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);