### Question:
TransactionalComponentService extends AbstractTransactionalEntityService<Component, ComponentDao> implements ComponentService { @Override public void deleteComponent(Component component) throws NoConnectionToJcommuneException, JcommuneRespondedWithErrorException,JcommuneUrlNotConfiguredException, EntityIsRemovedException { Component existInDbComponent = getByType(component.getComponentType()); if (existInDbComponent == null || component.getId() != existInDbComponent.getId()) { throw new EntityIsRemovedException(); } if (component instanceof Jcommune) { Jcommune jcommune = (Jcommune) component; jCommuneNotifier.notifyAboutComponentDelete(jcommune.getUrl()); } dao.delete(component); } TransactionalComponentService(ComponentDao dao); @Override List<Component> getAll(); @Override void deleteComponent(Component component); @Deprecated @Override void saveComponent(Component component); @Override void reindexComponent(Jcommune jcommune); @Override Set<ComponentType> getAvailableTypes(); @Override ComponentBase baseComponentFor(ComponentType componentType); @Override Component getByType(ComponentType type); JCommuneNotifier getjCommuneNotifier(); void setjCommuneNotifier(JCommuneNotifier jCommuneNotifier); @Override void addComponent(Component component); @Override void updateComponent(Component component);  }### Answer:
@Test public void testDeleteComponent() throws NoConnectionToJcommuneException, JcommuneUrlNotConfiguredException, JcommuneRespondedWithErrorException, EntityIsRemovedException { doNothing().when(jCommuneNotifier).notifyAboutComponentDelete(anyString()); when(componentService.getByType(jcommune.getComponentType())).thenReturn(jcommune); doNothing().when(componentDao).delete(jcommune); componentService.deleteComponent(jcommune); }