StandardFDControllerServiceService extends BaseExtensionComponentService<VersionedControllerService, ControllerServiceDefinition, FDControllerService> implements FDControllerServiceService { @Override public void delete(final String flowId, final String controllerServiceId) { final VersionedControllerService removed = deleteExtensionComponent(flowId, controllerServiceId, VersionedProcessGroup::getControllerServices); revalidateReferencingComponents(removed, flowId); } @Autowired  StandardFDControllerServiceService(final FDFlowManager flowManager, final FDExtensionManagers extensionManagers, final ValidationService validationService); @Override FDComponentTypes getControllerServiceTypes(final String flowId); @Override FDControllerService create(final String flowId, final String processGroupId, final VersionedControllerService requestComponentConfig); @Override FDControllerService get(final String flowId, final String controllerServiceId); @Override Set<FDControllerService> getForProcessGroup(final String flowId, final String processGroupId); @Override FDPropertyDescriptor getPropertyDescriptor(final String flowId, final String controllerServiceId, final String propertyName); @Override FDControllerService update(final String flowId, final VersionedControllerService requestComponentConfig); @Override void delete(final String flowId, final String controllerServiceId); @Override ControllerServiceDefinition getComponentDefinition(final String agentClass, final VersionedControllerService componentConfig);  }
@Test public void testDeleteControllerServiceSuccess() { when(flowManager.getFlow(flow.getFlowMetadata().getIdentifier())).thenReturn(Optional.of(flow)); when(extensionManagers.getExtensionManager(flow.getFlowMetadata().getAgentClass())).thenReturn(Optional.of(extensionManager)); assertEquals(1, group2.getControllerServices().size()); controllerServiceService.delete( flow.getFlowMetadata().getIdentifier(), existingService.getIdentifier()); assertEquals(0, group2.getControllerServices().size()); }