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());
}
protected void addControllerServices(final MockControllerServiceLookup other) {
this.controllerServiceMap.putAll(other.controllerServiceMap);
}
protected ControllerServiceConfiguration getConfiguration(final String identifier) {
return controllerServiceMap.get(identifier);

View File

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