From 9e2820c5820b3904e03cb7a4cb4292e864b1ca2b Mon Sep 17 00:00:00 2001 From: "Magnusen, Drew (dm741q)" Date: Thu, 18 Jan 2018 15:20:59 -0600 Subject: Resolve bug in DroolsPDPIntegrityMonitor This fix ensures that the testServices, testRestClasses, tesManaged, and testSwagger properties are all populated in the stateManagementProperties object within DroolsPDPIntegrityMonitor class. Issue-ID: POLICY-564 Change-Id: Ie517b19f61ab084416ce1e6f8418d69dc9e4f85d Signed-off-by: Magnusen, Drew (dm741q) --- .../statemanagement/DroolsPDPIntegrityMonitor.java | 28 +++++++++++++++------- 1 file changed, 20 insertions(+), 8 deletions(-) (limited to 'feature-state-management/src/main') diff --git a/feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/DroolsPDPIntegrityMonitor.java b/feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/DroolsPDPIntegrityMonitor.java index 688631bb..0a4eb513 100644 --- a/feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/DroolsPDPIntegrityMonitor.java +++ b/feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/DroolsPDPIntegrityMonitor.java @@ -96,14 +96,10 @@ public class DroolsPDPIntegrityMonitor extends IntegrityMonitor // (the 'IntegrityMonitor' constructor does some additional verification) String testHost = stateManagementProperties.getProperty(StateManagementProperties.TEST_HOST); String testPort = stateManagementProperties.getProperty(StateManagementProperties.TEST_PORT); - String testServices = stateManagementProperties.getProperty(StateManagementProperties.TEST_SERVICES, - StateManagementProperties.TEST_SERVICES_DEFAULT); - String testRestClasses = stateManagementProperties.getProperty(StateManagementProperties.TEST_REST_CLASSES, - StateManagementProperties.TEST_REST_CLASSES_DEFAULT); - String testManaged = stateManagementProperties.getProperty(StateManagementProperties.TEST_MANAGED, - StateManagementProperties.TEST_MANAGED_DEFAULT); - String testSwagger = stateManagementProperties.getProperty(StateManagementProperties.TEST_SWAGGER, - StateManagementProperties.TEST_SWAGGER_DEFAULT); + String testServices = stateManagementProperties.getProperty(StateManagementProperties.TEST_SERVICES); + String testRestClasses = stateManagementProperties.getProperty(StateManagementProperties.TEST_REST_CLASSES); + String testManaged = stateManagementProperties.getProperty(StateManagementProperties.TEST_MANAGED); + String testSwagger = stateManagementProperties.getProperty(StateManagementProperties.TEST_SWAGGER); String resourceName = stateManagementProperties.getProperty(StateManagementProperties.RESOURCE_NAME); String fpMonitorInterval = stateManagementProperties.getProperty(StateManagementProperties.FP_MONITOR_INTERVAL); String failedCounterThreshold = stateManagementProperties.getProperty(StateManagementProperties.FAILED_COUNTER_THRESHOLD); @@ -123,6 +119,22 @@ public class DroolsPDPIntegrityMonitor extends IntegrityMonitor if (testPort == null){ missingProperty(StateManagementProperties.TEST_PORT); } + if (testServices == null) { + testServices = StateManagementProperties.TEST_SERVICES_DEFAULT; + stateManagementProperties.put(StateManagementProperties.TEST_SERVICES, testServices); + } + if (testRestClasses == null) { + testRestClasses = StateManagementProperties.TEST_REST_CLASSES_DEFAULT; + stateManagementProperties.put(StateManagementProperties.TEST_REST_CLASSES, testRestClasses); + } + if (testManaged == null) { + testManaged = StateManagementProperties.TEST_MANAGED_DEFAULT; + stateManagementProperties.put(StateManagementProperties.TEST_MANAGED, testManaged); + } + if (testSwagger == null) { + testSwagger = StateManagementProperties.TEST_SWAGGER_DEFAULT; + stateManagementProperties.put(StateManagementProperties.TEST_SWAGGER, testSwagger); + } if (!testServices.equals(StateManagementProperties.TEST_SERVICES_DEFAULT)){ logger.error(INVALID_PROPERTY_VALUE, StateManagementProperties.TEST_SERVICES, -- cgit 1.2.3-korg