diff options
author | 2020-01-31 17:52:01 +0000 | |
---|---|---|
committer | 2020-01-31 18:40:06 +0000 | |
commit | 48c0cd8b7726436d876cbc86c91e92b80583531b (patch) | |
tree | b4fa71dc5d90ac49907a59d3aba9f6a3afbf628c /sli/provider-base/src/main/java/org/onap/ccsdk/sli/core/sli/provider/base/NotifyNodeExecutor.java | |
parent | ce33837a7d1904fa18c3a368d37d837d9c9b7397 (diff) |
minor sli provider base changes
add more unit testing, use constants for success/failure and improve some logging calls
Issue-ID: CCSDK-2064
Signed-off-by: Smokowski, Kevin (ks6305) <kevin.smokowski@att.com>
Change-Id: I2c7039c706de1172bd506a20e96eb987cc86f211
Diffstat (limited to 'sli/provider-base/src/main/java/org/onap/ccsdk/sli/core/sli/provider/base/NotifyNodeExecutor.java')
-rw-r--r-- | sli/provider-base/src/main/java/org/onap/ccsdk/sli/core/sli/provider/base/NotifyNodeExecutor.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sli/provider-base/src/main/java/org/onap/ccsdk/sli/core/sli/provider/base/NotifyNodeExecutor.java b/sli/provider-base/src/main/java/org/onap/ccsdk/sli/core/sli/provider/base/NotifyNodeExecutor.java index de59a4b7..fb560db5 100644 --- a/sli/provider-base/src/main/java/org/onap/ccsdk/sli/core/sli/provider/base/NotifyNodeExecutor.java +++ b/sli/provider-base/src/main/java/org/onap/ccsdk/sli/core/sli/provider/base/NotifyNodeExecutor.java @@ -21,6 +21,7 @@ package org.onap.ccsdk.sli.core.sli.provider.base; +import org.onap.ccsdk.sli.core.sli.SvcLogicConstants; import org.onap.ccsdk.sli.core.sli.SvcLogicContext; import org.onap.ccsdk.sli.core.sli.SvcLogicException; import org.onap.ccsdk.sli.core.sli.SvcLogicNode; @@ -41,7 +42,7 @@ public class NotifyNodeExecutor extends AbstractSvcLogicNodeExecutor { String action = SvcLogicExpressionResolver.evaluateAsKey(node.getAttribute("action"), node, ctx); String key = SvcLogicExpressionResolver.evaluateAsKey(node.getAttribute("key"), node, ctx); - String outValue = "failure"; + String outValue = SvcLogicConstants.FAILURE; if (LOG.isDebugEnabled()) { LOG.debug("release node encountered - looking for resource class " + plugin); @@ -52,18 +53,18 @@ public class NotifyNodeExecutor extends AbstractSvcLogicNodeExecutor { try { switch (resourcePlugin.notify(resourceType, action, key, ctx)) { case SUCCESS: - outValue = "success"; + outValue = SvcLogicConstants.SUCCESS; break; case NOT_FOUND: outValue = "not-found"; break; case FAILURE: default: - outValue = "failure"; + outValue = SvcLogicConstants.FAILURE; } } catch (SvcLogicException e) { LOG.error("Caught exception from resource plugin", e); - outValue = "failure"; + outValue = SvcLogicConstants.FAILURE; } } else { LOG.warn("Could not find SvcLogicResource object for plugin " + plugin); |