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());
|
controllerServiceMap.remove(service.getIdentifier());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void addControllerServices(final MockControllerServiceLookup other) {
|
||||||
|
this.controllerServiceMap.putAll(other.controllerServiceMap);
|
||||||
|
}
|
||||||
|
|
||||||
protected ControllerServiceConfiguration getConfiguration(final String identifier) {
|
protected ControllerServiceConfiguration getConfiguration(final String identifier) {
|
||||||
return controllerServiceMap.get(identifier);
|
return controllerServiceMap.get(identifier);
|
||||||
|
|
|
@ -67,6 +67,8 @@ public class MockProcessContext extends MockControllerServiceLookup implements S
|
||||||
annotationData = context.getControllerServiceAnnotationData(component);
|
annotationData = context.getControllerServiceAnnotationData(component);
|
||||||
final Map<PropertyDescriptor, String> props = context.getControllerServiceProperties(component);
|
final Map<PropertyDescriptor, String> props = context.getControllerServiceProperties(component);
|
||||||
properties.putAll(props);
|
properties.putAll(props);
|
||||||
|
|
||||||
|
super.addControllerServices(context);
|
||||||
} catch (IllegalArgumentException e) {
|
} catch (IllegalArgumentException e) {
|
||||||
// do nothing...the service is being loaded
|
// do nothing...the service is being loaded
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue