@Test public void incomingMessageShouldBeAddedToStorage() throws Exception { sut.incomingQueues = Arrays.asList("java:comp/env/q1", "java:comp/env/q2"); sut.run(""); testModule.verifyQueueConnectionStarted(); q1.addMessage(new MockTextMessage("bla")); 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()); 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()); }
@Override public void run(String... arg0) throws Exception { for (final String queue : incomingQueues) { registerIncomingQueue(queue); } for (final String queue : outgoingQueues) { registerOutgoingQueue(queue); } }
QueueManager implements CommandLineRunner { @Override public void run(String... arg0) throws Exception { for (final String queue : incomingQueues) { registerIncomingQueue(queue); } for (final String queue : outgoingQueues) { registerOutgoingQueue(queue); } } }
QueueManager implements CommandLineRunner { @Override public void run(String... arg0) throws Exception { for (final String queue : incomingQueues) { registerIncomingQueue(queue); } for (final String queue : outgoingQueues) { registerOutgoingQueue(queue); } }  }
QueueManager implements CommandLineRunner { @Override public void run(String... arg0) throws Exception { for (final String queue : incomingQueues) { registerIncomingQueue(queue); } for (final String queue : outgoingQueues) { registerOutgoingQueue(queue); } }  @Override void run(String... arg0); List<String> getOutgoingQueues(); @PreDestroy void shutdown(); Map<String, Boolean> getListenerStatus(); void stopListener(String queue); void startListener(String queue); }
QueueManager implements CommandLineRunner { @Override public void run(String... arg0) throws Exception { for (final String queue : incomingQueues) { registerIncomingQueue(queue); } for (final String queue : outgoingQueues) { registerOutgoingQueue(queue); } }  @Override void run(String... arg0); List<String> getOutgoingQueues(); @PreDestroy void shutdown(); Map<String, Boolean> getListenerStatus(); void stopListener(String queue); void startListener(String queue);  }