PrintStreamMessageLogger implements MessageListener { @Override public void onProcessingStarted(Object actor, Object message) { currentActor.set(actor); logMessage(INCOMING_MESSAGE, message); } PrintStreamMessageLogger(PrintStream out); @Override void onMessageSent(Object message); @Override void onProcessingStarted(Object actor, Object message); @Override void onProcessingFinished(); @Override Executor getListenedExecutor(Executor realExecutor);  }
@Test public void processing_messages_logs_both_the_actor_and_the_message() { logger.onProcessingStarted("actor1", "message1"); assertThat(output.toString(), containsLineWithWords("actor1 <-", "message1")); }