@Test(timeout = CONSUME_TEST_TIMEOUT_MILLIS)
public void readTest() throws Exception {

    if (!consumer.isOpen()) {
        consumer.open();
    }
    ArrayList<String> ids = new ArrayList<>(200);
    for (int i = 0; i < 200; i++) {
        ids.add(Integer.toString(i));
    }
    for (int i = 0; i < 200; i++) {
        CheramiDelivery delivery = consumer.read();
        String id = delivery.getMessage().getAckId();
        ids.remove(id);
    }
    assert (ids.isEmpty());
    //Test that read blocks if there are no messages
    thrown.expect(TestTimedOutException.class);
    consumer.read();
}