### Question:
PipelineEventService implements EntityEventService { @Override public void updateEventsWithChildrenAndIssues(final Long id) { eventManager.addUpdateEvent(EventObjectType.PIPELINE.name().toLowerCase(), id); eventManager.addUpdateEventsForIssues(id, AclClass.PIPELINE); List<PipelineRun> pipelineRuns = ListUtils.emptyIfNull(pipelineRunManager.loadAllRunsByPipeline(id)); pipelineRuns.forEach(run -> eventManager.addUpdateEvent(EventObjectType.RUN.name().toLowerCase(), run.getId())); }  @Override AclClass getSupportedClass(); @Override void updateEventsWithChildrenAndIssues(final Long id);  }### Answer:
@Test @Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = Exception.class) public void shouldAddPipelineEvent() { when(issueManager.loadIssuesForEntity(any())) .thenReturn(Arrays.asList(Issue.builder().id(1L).build(), Issue.builder().id(2L).build())); when(pipelineRunManager.loadAllRunsByPipeline(anyLong())) .thenReturn(Arrays.asList(new PipelineRun(1L, ""), new PipelineRun(2L, ""))); doNothing().when(eventDao).insertUpdateEvent(anyString(), anyLong()); pipelineEventService.updateEventsWithChildrenAndIssues(1L); verify(eventDao).insertUpdateEvent("pipeline", 1L); verify(eventDao).insertUpdateEvent("run", 1L); verify(eventDao).insertUpdateEvent("run", 2L); verify(eventDao).insertUpdateEvent("issue", 1L); verify(eventDao).insertUpdateEvent("issue", 2L); verifyNoMoreInteractions(eventDao); }