@Test public void testExecute() throws Exception { EventSendCommand send = new EventSendCommand(); send.eventAdmin = mock(EventAdmin.class); Capture<Event> eventCapture = newCapture(); send.eventAdmin.sendEvent(capture(eventCapture)); expectLastCall(); replay(send.eventAdmin); send.topic = "myTopic"; send.properties = Collections.singletonList("a=b"); send.execute(); verify(send.eventAdmin); Event event = eventCapture.getValue(); assertThat(event.getTopic(), equalTo("myTopic")); assertThat(event.getProperty("a"), equalTo("b")); }
@Override public Object execute() throws Exception { eventAdmin.sendEvent(new Event(topic, parse(properties))); return null; }
EventSendCommand implements Action { @Override public Object execute() throws Exception { eventAdmin.sendEvent(new Event(topic, parse(properties))); return null; } }
EventSendCommand implements Action { @Override public Object execute() throws Exception { eventAdmin.sendEvent(new Event(topic, parse(properties))); return null; }  }
EventSendCommand implements Action { @Override public Object execute() throws Exception { eventAdmin.sendEvent(new Event(topic, parse(properties))); return null; }  @Override Object execute(); }
EventSendCommand implements Action { @Override public Object execute() throws Exception { eventAdmin.sendEvent(new Event(topic, parse(properties))); return null; }  @Override Object execute();  }