### Question:
StandardControllerServiceProvider implements ControllerServiceProvider { @Override public CompletableFuture<Void> disableControllerService(final ControllerServiceNode serviceNode) { serviceNode.verifyCanDisable(); return processScheduler.disableControllerService(serviceNode); } StandardControllerServiceProvider(final FlowController flowController, final StandardProcessScheduler scheduler, final BulletinRepository bulletinRepo,
        final StateManagerProvider stateManagerProvider, final VariableRegistry variableRegistry, final NiFiProperties nifiProperties, final ValidationTrigger validationTrigger); @SuppressWarnings("rawtypes") void checkExtensionLoaded(Class<?> typeClass, final String type); @Override ControllerServiceNode createControllerService(final String type, final String id, final BundleCoordinate bundleCoordinate, final Set<URL> additionalUrls, final boolean firstTimeAdded); @Override Set<ComponentNode> disableReferencingServices(final ControllerServiceNode serviceNode); @Override Set<ComponentNode> scheduleReferencingComponents(final ControllerServiceNode serviceNode); @Override Set<ComponentNode> unscheduleReferencingComponents(final ControllerServiceNode serviceNode); @Override CompletableFuture<Void> enableControllerService(final ControllerServiceNode serviceNode); @Override void enableControllerServices(final Collection<ControllerServiceNode> serviceNodes); @Override Future<Void> enableControllerServicesAsync(final Collection<ControllerServiceNode> serviceNodes); @Override CompletableFuture<Void> disableControllerService(final ControllerServiceNode serviceNode); @Override Future<Void> disableControllerServicesAsync(final Collection<ControllerServiceNode> serviceNodes); @Override ControllerService getControllerService(final String serviceIdentifier); @Override ControllerService getControllerServiceForComponent(final String serviceIdentifier, final String componentId); @Override boolean isControllerServiceEnabled(final ControllerService service); @Override boolean isControllerServiceEnabled(final String serviceIdentifier); @Override boolean isControllerServiceEnabling(final String serviceIdentifier); @Override ControllerServiceNode getControllerServiceNode(final String serviceIdentifier); @Override Set<String> getControllerServiceIdentifiers(final Class<? extends ControllerService> serviceType, final String groupId); @Override String getControllerServiceName(final String serviceIdentifier); @Override void removeControllerService(final ControllerServiceNode serviceNode); @Override Set<ControllerServiceNode> getAllControllerServices(); @Override Set<ComponentNode> enableReferencingServices(final ControllerServiceNode serviceNode); @Override void verifyCanEnableReferencingServices(final ControllerServiceNode serviceNode); @Override void verifyCanScheduleReferencingComponents(final ControllerServiceNode serviceNode); @Override void verifyCanDisableReferencingServices(final ControllerServiceNode serviceNode); @Override void verifyCanStopReferencingComponents(final ControllerServiceNode serviceNode); @Override Set<String> getControllerServiceIdentifiers(final Class<? extends ControllerService> serviceType);  }### Answer:
@Test public void testDisableControllerService() { final ProcessGroup procGroup = new MockProcessGroup(controller); final FlowController controller = Mockito.mock(FlowController.class); Mockito.when(controller.getGroup(Mockito.anyString())).thenReturn(procGroup); final StandardProcessScheduler scheduler = createScheduler(); final StandardControllerServiceProvider provider = new StandardControllerServiceProvider(controller, scheduler, null, stateManagerProvider, variableRegistry, niFiProperties, new SynchronousValidationTrigger()); final ControllerServiceNode serviceNode = provider.createControllerService(ServiceB.class.getName(), "B", systemBundle.getBundleDetails().getCoordinate(), null,false); serviceNode.performValidation(); serviceNode.getValidationStatus(5, TimeUnit.SECONDS); provider.enableControllerService(serviceNode); provider.disableControllerService(serviceNode); }