StandardFDExtensionManager implements FDExtensionManager { @Override public ProcessorDefinition getProcessorDefinition(final String type, final Bundle bundle) { final ProcessorDefinition manifestProcessor = locateManifestProcessor(type, bundle); return copyManifestProcessor(manifestProcessor); } 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 testGetManifestProcessorWhenExists() { final org.apache.nifi.registry.flow.Bundle bundle = getRequestBundle(httpBundle); final ProcessorDefinition processor = extensionManager.getProcessorDefinition(invokeHttpProcessor.getType(), bundle); assertNotNull(processor); assertEquals(invokeHttpProcessor.getType(), processor.getType()); assertEquals(invokeHttpProcessor.getGroup(), processor.getGroup()); assertEquals(invokeHttpProcessor.getArtifact(), processor.getArtifact()); assertEquals(invokeHttpProcessor.getVersion(), processor.getVersion()); assertEquals(invokeHttpProcessor.getPropertyDescriptors().size(), processor.getPropertyDescriptors().size()); assertNotNull(invokeHttpProcessor.getSupportedRelationships()); assertEquals(2, invokeHttpProcessor.getSupportedRelationships().size()); assertEquals(true, invokeHttpProcessor.getSupportsDynamicRelationships()); }
@Test(expected = IllegalArgumentException.class) public void testGetManifestProcessorWhenTypeDoesNotExist() { final org.apache.nifi.registry.flow.Bundle bundle = getRequestBundle(httpBundle); extensionManager.getProcessorDefinition("does-not-exist", bundle); }
@Test(expected = IllegalArgumentException.class) public void testGetManifestProcessorWhenBundleDoesNotExist() { final org.apache.nifi.registry.flow.Bundle bundle = getRequestBundle(httpBundle); bundle.setGroup("does-not-exist"); extensionManager.getProcessorDefinition(invokeHttpProcessor.getType(), bundle); }