### Question:
DockerRegistryEventService implements EntityEventService { @Override public void updateEventsWithChildrenAndIssues(final Long id) { eventManager.addUpdateEventsForIssues(id, AclClass.DOCKER_REGISTRY); eventManager.addUpdateEvent(EventObjectType.DOCKER_REGISTRY.name().toLowerCase(), id); ListUtils.emptyIfNull(toolGroupManager.loadByRegistryId(id)) .forEach(toolGroup -> toolGroupEventService.updateEventsWithChildrenAndIssues(toolGroup.getId())); }  @Override AclClass getSupportedClass(); @Override void updateEventsWithChildrenAndIssues(final Long id);  }### Answer:
@Test public void shouldAddDockerRegistryEvent() { doNothing().when(entityManager).setManagers(anyListOf(SecuredEntityManager.class)); ToolGroup toolGroup1 = new ToolGroup(); toolGroup1.setId(1L); ToolGroup toolGroup2 = new ToolGroup(); toolGroup2.setId(2L); when(issueManager.loadIssuesForEntity(any())) .thenReturn(Arrays.asList(Issue.builder().id(1L).build(), Issue.builder().id(2L).build())); when(toolGroupManager.loadByRegistryId(anyLong())).thenReturn(Arrays.asList(toolGroup1, toolGroup2)); when(toolManager.loadToolsByGroup(anyLong())).thenReturn(null); doNothing().when(eventDao).insertUpdateEvent(anyString(), anyLong()); dockerRegistryEventService.updateEventsWithChildrenAndIssues(1L); verify(eventDao).insertUpdateEvent("docker_registry", 1L); verify(eventDao).insertUpdateEvent("tool_group", 1L); verify(eventDao).insertUpdateEvent("tool_group", 2L); verify(eventDao, times(3)).insertUpdateEvent("issue", 1L); verify(eventDao, times(3)).insertUpdateEvent("issue", 2L); verifyNoMoreInteractions(eventDao); }