@Test
public void incomingMessageShouldBeAddedToStorage() throws Exception {

	sut.incomingQueues = Arrays.asList("java:comp/env/q1", "java:comp/env/q2");
	sut.run("");
	testModule.verifyQueueConnectionStarted();
	// new message in queue q1
	q1.addMessage(new MockTextMessage("bla"));
	// the message was added to storage
	ArgumentCaptor<SimpleMessage> argument = ArgumentCaptor.forClass(SimpleMessage.class);
	verify(storage, timeout(5000)).addMessage(argument.capture());
	assertEquals("java:comp/env/q1", argument.getValue().getQueue());
	assertEquals("bla", argument.getValue().getText());
	// new message in queue q2
	q2.addMessage(new MockTextMessage("blup"));
	verify(storage, timeout(5000).times(2)).addMessage(argument.capture());
	assertEquals("java:comp/env/q2", argument.getValue().getQueue());
	assertEquals("blup", argument.getValue().getText());
}