diff --git a/nifi/nifi-mock/src/main/java/org/apache/nifi/util/MockControllerServiceLookup.java b/nifi/nifi-mock/src/main/java/org/apache/nifi/util/MockControllerServiceLookup.java index f5a716c99f..8298a39617 100644 --- a/nifi/nifi-mock/src/main/java/org/apache/nifi/util/MockControllerServiceLookup.java +++ b/nifi/nifi-mock/src/main/java/org/apache/nifi/util/MockControllerServiceLookup.java @@ -47,6 +47,9 @@ public abstract class MockControllerServiceLookup implements ControllerServiceLo controllerServiceMap.remove(service.getIdentifier()); } + protected void addControllerServices(final MockControllerServiceLookup other) { + this.controllerServiceMap.putAll(other.controllerServiceMap); + } protected ControllerServiceConfiguration getConfiguration(final String identifier) { return controllerServiceMap.get(identifier); diff --git a/nifi/nifi-mock/src/main/java/org/apache/nifi/util/MockProcessContext.java b/nifi/nifi-mock/src/main/java/org/apache/nifi/util/MockProcessContext.java index f83301c107..65369288e7 100644 --- a/nifi/nifi-mock/src/main/java/org/apache/nifi/util/MockProcessContext.java +++ b/nifi/nifi-mock/src/main/java/org/apache/nifi/util/MockProcessContext.java @@ -67,11 +67,13 @@ public class MockProcessContext extends MockControllerServiceLookup implements S annotationData = context.getControllerServiceAnnotationData(component); final Map props = context.getControllerServiceProperties(component); properties.putAll(props); + + super.addControllerServices(context); } catch (IllegalArgumentException e) { // do nothing...the service is being loaded } } - + @Override public PropertyValue getProperty(final PropertyDescriptor descriptor) { return getProperty(descriptor.getName());