@Test public void testExecute() throws Exception { IMocksControl c = createControl(); EventDisplayCommand display = new EventDisplayCommand(); display.session = c.createMock(Session.class); expect(display.session.getConsole()).andReturn(System.out); display.collector = new EventCollector(); display.collector.handleEvent(new Event("myTopic", new HashMap<>())); c.replay(); display.execute(); c.verify(); }
@Override public Object execute() throws Exception { EventPrinter printer = new EventPrinter(session.getConsole(), verbose); collector.getEvents().filter(matchTopic(topicFilter)).forEach(printer); return null; }
EventDisplayCommand implements Action { @Override public Object execute() throws Exception { EventPrinter printer = new EventPrinter(session.getConsole(), verbose); collector.getEvents().filter(matchTopic(topicFilter)).forEach(printer); return null; } }
EventDisplayCommand implements Action { @Override public Object execute() throws Exception { EventPrinter printer = new EventPrinter(session.getConsole(), verbose); collector.getEvents().filter(matchTopic(topicFilter)).forEach(printer); return null; }  }
EventDisplayCommand implements Action { @Override public Object execute() throws Exception { EventPrinter printer = new EventPrinter(session.getConsole(), verbose); collector.getEvents().filter(matchTopic(topicFilter)).forEach(printer); return null; }  @Override Object execute(); }
EventDisplayCommand implements Action { @Override public Object execute() throws Exception { EventPrinter printer = new EventPrinter(session.getConsole(), verbose); collector.getEvents().filter(matchTopic(topicFilter)).forEach(printer); return null; }  @Override Object execute();  }