mirror of https://github.com/apache/nifi.git
NIFI-389: Fixed bug that caused services that depend on other services to not be locatable in mock framework
This commit is contained in:
parent
83b33c8050
commit
96a42cd72b
|
@ -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);
|
||||
|
|
|
@ -67,11 +67,13 @@ public class MockProcessContext extends MockControllerServiceLookup implements S
|
|||
annotationData = context.getControllerServiceAnnotationData(component);
|
||||
final Map<PropertyDescriptor, String> 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());
|
||||
|
|
Loading…
Reference in New Issue