diff options
author | Michal Kabaj <michal.kabaj@nokia.com> | 2018-02-27 11:27:48 +0100 |
---|---|---|
committer | Patrick Brady <pb071s@att.com> | 2018-03-01 18:35:53 +0000 |
commit | 4e26089e179c395ad1ceed510f3170765d4eea27 (patch) | |
tree | 244e91f2409637729873b051438cd74416ba6855 /appc-adapters/appc-chef-adapter/appc-chef-adapter-bundle/src/main/java/org | |
parent | 1aeaed6f086ebd2c6621867146112e4f2f675429 (diff) |
ChefAdapterImpl JUnits
-Added new ChefAdapterImplTest class for new ChefAdapterImpl JUnits
-Added test for nodeObjectBuilder method - JSON Format is now verified using JSONObject
-Unified ChefAdapterImpl construction - removed unused constructors
Change-Id: I63f96bac0129b5f13d34efd3a173784e0b1d8a5d
Issue-ID: APPC-437
Signed-off-by: Michal Kabaj <michal.kabaj@nokia.com>
Diffstat (limited to 'appc-adapters/appc-chef-adapter/appc-chef-adapter-bundle/src/main/java/org')
-rw-r--r-- | appc-adapters/appc-chef-adapter/appc-chef-adapter-bundle/src/main/java/org/onap/appc/adapter/chef/impl/ChefAdapterImpl.java | 39 |
1 files changed, 3 insertions, 36 deletions
diff --git a/appc-adapters/appc-chef-adapter/appc-chef-adapter-bundle/src/main/java/org/onap/appc/adapter/chef/impl/ChefAdapterImpl.java b/appc-adapters/appc-chef-adapter/appc-chef-adapter-bundle/src/main/java/org/onap/appc/adapter/chef/impl/ChefAdapterImpl.java index eb5ee7bde..69b57f7ce 100644 --- a/appc-adapters/appc-chef-adapter/appc-chef-adapter-bundle/src/main/java/org/onap/appc/adapter/chef/impl/ChefAdapterImpl.java +++ b/appc-adapters/appc-chef-adapter/appc-chef-adapter-bundle/src/main/java/org/onap/appc/adapter/chef/impl/ChefAdapterImpl.java @@ -115,28 +115,7 @@ public class ChefAdapterImpl implements ChefAdapter { * This default constructor is used as a work around because the activator wasnt getting called */ public ChefAdapterImpl() { - initialize(); - } - - public ChefAdapterImpl(Properties props) { - initialize(); - } - - /** - * This constructor is used primarily in the test cases to bypass initialization of the adapter for isolated, - * disconnected testing - * - * @param initialize True if the adapter is to be initialized, can false if not - */ - - public ChefAdapterImpl(boolean initialize) { - if (initialize) { - initialize(); - } - } - - public ChefAdapterImpl(String key) { - initialize(); + logger.info("Initialize Chef Adapter"); } @SuppressWarnings("nls") @@ -394,12 +373,9 @@ public class ChefAdapterImpl implements ChefAdapter { String nodeObject = "{\"json_class\":\"Chef::Node\",\"default\":{" + defaults + "},\"chef_type\":\"node\",\"run_list\":[" + runList + "],\"override\":{" + overrides + "},\"normal\": {" + normal + "},\"automatic\":{},\"name\":\"" + name + "\",\"chef_environment\":\"" - + chefEnvironment + "\"}"; + + chefEnvironment + "\",}"; logger.info(nodeObject); - RequestContext rc = new RequestContext(ctx); - rc.isAlive(); - SvcLogicContext svcLogic = rc.getSvcLogicContext(); - svcLogic.setAttribute("chef.nodeObject", nodeObject); + ctx.setAttribute("chef.nodeObject", nodeObject); } /** @@ -757,15 +733,6 @@ public class ChefAdapterImpl implements ChefAdapter { logger.info(messageStr + ": " + svcLogic.getAttribute(messageStr)); } - - /** - * initialize the provider adapter by building the context cache - */ - private void initialize() { - - logger.info("Initialize Chef Adapter"); - } - @SuppressWarnings("static-method") private void doFailure(SvcLogicContext svcLogic, int code, String message) throws SvcLogicException { |