### Question:
EventBlockUpdaterListener implements ContractEventListener { @Override public void onEvent(ContractEventDetails eventDetails) { blockManagement.updateLatestBlock(eventDetails.getEventSpecificationSignature(), eventDetails.getBlockNumber(), eventDetails.getAddress()); } @Autowired  EventBlockUpdaterListener(EventBlockManagementService blockManagement); @Override void onEvent(ContractEventDetails eventDetails);  }### Answer:
@Test public void testOnEvent() { final ContractEventDetails eventDetails = mock(ContractEventDetails.class); when(eventDetails.getEventSpecificationSignature()).thenReturn("spec"); when(eventDetails.getBlockNumber()).thenReturn(BigInteger.TEN); when(eventDetails.getAddress()).thenReturn(ADDRESS); underTest.onEvent(eventDetails); verify(mockBlockManagementService, times(1)).updateLatestBlock("spec", BigInteger.TEN, ADDRESS); }