NIFI-389: Fixed bug that caused services that depend on other services to not be locatable in mock framework

This commit is contained in:
Mark Payne 2015-03-01 15:30:42 -05:00
parent 83b33c8050
commit 96a42cd72b
2 changed files with 6 additions and 1 deletions

View File

@ -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);

View File

@ -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
} }