diff options
author | Joss Armstrong <joss.armstrong@ericsson.com> | 2019-02-11 12:59:49 +0000 |
---|---|---|
committer | Takamune Cho <takamune.cho@att.com> | 2019-02-11 14:21:10 +0000 |
commit | 323faa703b9eddae0c3f8a0267f4e732981a3c23 (patch) | |
tree | e54919c494352cd73087977477be70994c64d87e /appc-config/appc-encryption-tool/provider/src/main/java/org | |
parent | c99acfce1a84cb6d7f827f8585af9c01d0383b67 (diff) |
Test coverage for ParseAdminArtifact
Increased coverage from 65% to 85%
Issue-ID: APPC-1409
Change-Id: If39c07b3edbcaad6d618e54b27483323848410fe
Signed-off-by: Joss Armstrong <joss.armstrong@ericsson.com>
Diffstat (limited to 'appc-config/appc-encryption-tool/provider/src/main/java/org')
-rw-r--r-- | appc-config/appc-encryption-tool/provider/src/main/java/org/onap/appc/encryptiontool/fqdn/ParseAdminArtifcat.java | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/appc-config/appc-encryption-tool/provider/src/main/java/org/onap/appc/encryptiontool/fqdn/ParseAdminArtifcat.java b/appc-config/appc-encryption-tool/provider/src/main/java/org/onap/appc/encryptiontool/fqdn/ParseAdminArtifcat.java index e68a6f444..5118970eb 100644 --- a/appc-config/appc-encryption-tool/provider/src/main/java/org/onap/appc/encryptiontool/fqdn/ParseAdminArtifcat.java +++ b/appc-config/appc-encryption-tool/provider/src/main/java/org/onap/appc/encryptiontool/fqdn/ParseAdminArtifcat.java @@ -3,6 +3,8 @@ * ONAP : APPC * ================================================================================ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Modifications Copyright (C) 2019 Ericsson * ============================================================================= * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,7 +27,6 @@ import java.io.IOException; import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.function.Consumer; import org.apache.commons.lang.StringUtils; import org.onap.ccsdk.sli.core.sli.SvcLogicContext; @@ -47,22 +48,22 @@ public class ParseAdminArtifcat implements SvcLogicJavaPlugin { private static String fqdn = null; private SvcLogicResource serviceLogic; + public ParseAdminArtifcat() { + serviceLogic = new SqlResource(); + } + public static ParseAdminArtifcat initialise() { parseArtifact = new ParseAdminArtifcat(); return parseArtifact; } - public ParseAdminArtifcat() { - serviceLogic = new SqlResource(); - } - protected ParseAdminArtifcat(SqlResource svcLogic) { serviceLogic = svcLogic; } protected static Map<String, String> parseAdminArtifact(ArtifactMapper js) { List<FqdnList> fqdnList = js.getFqdnList(); - Map<String, String> mp = new HashMap<String, String>(); + Map<String, String> mp = new HashMap<>(); for (FqdnList listFqdn : fqdnList) { for (CloudOwnerList clList : listFqdn.getCloudOwnerList()) { @@ -143,10 +144,10 @@ public class ParseAdminArtifcat implements SvcLogicJavaPlugin { QueryStatus status = null; String fn = "ParseAdminArtifcat:getAdminArtifact"; String jsonContent = null; - String artifcatName = "ansible_admin_FQDN_Artifact_0.0.1V.json"; + String artifactName = "ansible_admin_FQDN_Artifact_0.0.1V.json"; try { String query = "SELECT ARTIFACT_CONTENT as adminjson" + " FROM ASDC_ARTIFACTS " + "WHERE ARTIFACT_NAME = '" - + artifcatName + "' " + "ORDER BY INTERNAL_VERSION DESC LIMIT 1 "; + + artifactName + "' " + "ORDER BY INTERNAL_VERSION DESC LIMIT 1 "; log.info("Getting artifact details :" + query); status = serviceLogic.query("SQL", false, null, query, null, null, ctx); jsonContent = ctx.getAttribute("adminjson"); |