@Test public void testRun() throws Exception { EventLogEvent event = Mockito.mock(EventLogEvent.class); EventLogListener eventLogListener = Mockito.mock(EventLogListener.class); EventLogEventEnvelope envelope = new EventLogEventEnvelope(event, eventLogListener); Mockito.doNothing().when(eventLogListener).postEvent(event); envelope.run(); Mockito.verify(eventLogListener, Mockito.times(1)).postEvent(event); }
@Override public void run() { LOGGER.debug("posting event: {}", event); recipient.postEvent(event); LOGGER.debug("posted event: {}", event); }
EventLogEventEnvelope implements Runnable { @Override public void run() { LOGGER.debug("posting event: {}", event); recipient.postEvent(event); LOGGER.debug("posted event: {}", event); } }
EventLogEventEnvelope implements Runnable { @Override public void run() { LOGGER.debug("posting event: {}", event); recipient.postEvent(event); LOGGER.debug("posted event: {}", event); } EventLogEventEnvelope(final EventLogEvent event, final EventLogListener recipient); }
EventLogEventEnvelope implements Runnable { @Override public void run() { LOGGER.debug("posting event: {}", event); recipient.postEvent(event); LOGGER.debug("posted event: {}", event); } EventLogEventEnvelope(final EventLogEvent event, final EventLogListener recipient); @Override void run(); }
EventLogEventEnvelope implements Runnable { @Override public void run() { LOGGER.debug("posting event: {}", event); recipient.postEvent(event); LOGGER.debug("posted event: {}", event); } EventLogEventEnvelope(final EventLogEvent event, final EventLogListener recipient); @Override void run();  }