StandardFDExtensionManager implements FDExtensionManager { @Override public ControllerServiceDefinition getControllerServiceDefinition(final String type, final Bundle bundle) { final ControllerServiceDefinition manifestControllerService = locateManifestControllerService(type, bundle); return copyManifestControllerService(manifestControllerService); } StandardFDExtensionManager(final AgentManifest agentManifest); @Override Set<FDComponentType> getProcessorTypes(); @Override ProcessorDefinition getProcessorDefinition(final String type, final Bundle bundle); @Override FDProcessor createProcessor(final String type, final Bundle bundle); @Override Optional<PropertyDescriptor> getProcessorPropertyDescriptor(final String type, final Bundle bundle, final String propertyName); @Override PropertyDescriptor createDynamicProcessorPropertyDescriptor(final String type, final Bundle bundle, final String propertyName); @Override Set<FDComponentType> getControllerServiceTypes(); @Override ControllerServiceDefinition getControllerServiceDefinition(final String type, final Bundle bundle); @Override FDControllerService createControllerService(final String type, final Bundle bundle); @Override Optional<PropertyDescriptor> getControllerServicePropertyDescriptor(final String type, final Bundle bundle, final String propertyName); @Override PropertyDescriptor createDynamicControllerServicePropertyDescriptor(final String type, final Bundle bundle, final String propertyName);  }
@Test public void testGetManifestControllerServiceWhenExists() { final org.apache.nifi.registry.flow.Bundle bundle = getRequestBundle(systemBundle); final ControllerServiceDefinition controllerService = extensionManager.getControllerServiceDefinition(sslContextService.getType(), bundle); assertNotNull(controllerService); assertEquals(sslContextService.getType(), controllerService.getType()); assertEquals(sslContextService.getGroup(), controllerService.getGroup()); assertEquals(sslContextService.getArtifact(), controllerService.getArtifact()); assertEquals(sslContextService.getVersion(), controllerService.getVersion()); assertEquals(sslContextService.getPropertyDescriptors().size(), controllerService.getPropertyDescriptors().size()); }
@Test(expected = IllegalArgumentException.class) public void testGetManifestControllerServiceWhenTypeDoesNotExist() { final org.apache.nifi.registry.flow.Bundle bundle = getRequestBundle(systemBundle); extensionManager.getControllerServiceDefinition("does-not-exist", bundle); }
@Test(expected = IllegalArgumentException.class) public void testGetManifestControllerServiceWhenBundleDoesNotExist() { final org.apache.nifi.registry.flow.Bundle bundle = getRequestBundle(systemBundle); bundle.setGroup("does-not-exist"); extensionManager.getControllerServiceDefinition(sslContextService.getType(), bundle); }