EventCorrelatingSpoutOutputCollector extends SpoutOutputCollector { @Override public long getPendingCount() { return delegate.getPendingCount(); } EventCorrelatingSpoutOutputCollector(TopologyContext topologyContext, SpoutOutputCollector delegate); @Override List<Integer> emit(String streamId, List<Object> tuple); @Override List<Integer> emit(List<Object> tuple); @Override List<Integer> emit(String streamId, List<Object> tuple, Object messageId); @Override List<Integer> emit(List<Object> tuple, Object messageId); @Override void emitDirect(int taskId, String streamId, List<Object> tuple); @Override void emitDirect(int taskId, List<Object> tuple); @Override void emitDirect(int taskId, String streamId, List<Object> tuple, Object messageId); @Override void emitDirect(int taskId, List<Object> tuple, Object messageId); @Override void reportError(Throwable throwable); @Override long getPendingCount();  }
@Test public void getPendingCount() throws Exception { setupExpectationsForTopologyContextNoEmit(); setupExpectationsForEventCorrelationInjector(); sut = new EventCorrelatingSpoutOutputCollector(mockedTopologyContext, mockedOutputCollector); Deencapsulation.setField(sut, "eventCorrelationInjector", mockEventCorrelationInjector); sut.getPendingCount(); new Verifications() {{ mockedOutputCollector.getPendingCount(); times = 1; }}; }