diff options
author | Dilip kumar Pampana <dilip.kumar.pampana@ibm.com> | 2018-10-02 09:48:54 -0400 |
---|---|---|
committer | Takamune Cho <takamune.cho@att.com> | 2018-11-28 01:43:41 +0000 |
commit | 3e499b7b1d969159016acc0c77e4f3d06efab94a (patch) | |
tree | f934e03c20507b30ac5779f27229bb06dcc1259d /appc-inbound/appc-design-services/provider/src/main | |
parent | 30a82f0fb7e2e702cb528dd98a41a146aba8217d (diff) |
Junits for design services
code coverage for design services in appc-inbound
Issue-ID: APPC-1211
Change-Id: Ie67937b74a83aee5de469687e4ab63685cb5d6aa
Signed-off-by: Dilip kumar Pampana <dilip.kumar.pampana@ibm.com>
Diffstat (limited to 'appc-inbound/appc-design-services/provider/src/main')
-rw-r--r-- | appc-inbound/appc-design-services/provider/src/main/java/org/onap/appc/design/dbervices/DesignDBService.java | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/appc-inbound/appc-design-services/provider/src/main/java/org/onap/appc/design/dbervices/DesignDBService.java b/appc-inbound/appc-design-services/provider/src/main/java/org/onap/appc/design/dbervices/DesignDBService.java index f8971255e..36465d98f 100644 --- a/appc-inbound/appc-design-services/provider/src/main/java/org/onap/appc/design/dbervices/DesignDBService.java +++ b/appc-inbound/appc-design-services/provider/src/main/java/org/onap/appc/design/dbervices/DesignDBService.java @@ -27,6 +27,8 @@ import com.att.eelf.configuration.EELFManager; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; + +import java.io.IOException; import java.sql.ResultSet; import java.sql.SQLException; import java.util.ArrayList; @@ -55,6 +57,7 @@ public class DesignDBService { private SvcLogicResource serviceLogic; private DbService dbservice; + private static ArtifactHandlerFactory artifactHandlerFactory = new ArtifactHandlerFactory(); public static DesignDBService initialise() { if (dgGeneralDBService == null) { @@ -204,7 +207,7 @@ public class DesignDBService { JsonNode payloadObject = objectMapper.readTree(payload); log.info("Got upload Aritfact with Payload : " + payloadObject.asText()); try { - ArtifactHandlerClient ac = new ArtifactHandlerClient(); + ArtifactHandlerClient ac = artifactHandlerFactory.ahi(); String requestString = ac.createArtifactData(payload, requestID); ac.execute(requestString, "POST"); int sdcArtifactId = getSDCArtifactIDbyRequestID(requestID); @@ -619,6 +622,14 @@ public class DesignDBService { throw e; } } + + + public static class ArtifactHandlerFactory { + + public ArtifactHandlerClient ahi() throws Exception{ + return new ArtifactHandlerClient(); + } + } } |