th.start();
connection.pSubscribe(listener, expectedPattern);
// Not all providers block on subscribe (Lettuce does not), give some
// time for messages to be received
Message message = messages.poll(5, TimeUnit.SECONDS);
assertNotNull(message);
assertEquals(expectedMessage, new String(message.getBody()));
message = messages.poll(5, TimeUnit.SECONDS);
assertNotNull(message);
assertEquals(expectedMessage, new String(message.getBody()));
}