From 991d833fd7558beaf7f2f2df63deb72dabda3e8a Mon Sep 17 00:00:00 2001 From: Joss Armstrong Date: Fri, 8 Feb 2019 16:29:32 +0000 Subject: Test coverage in encryptiontool package Increased coverage to 100% Issue-ID: APPC-1409 Change-Id: Iff09cf04cbdb1cb4f7ad640102f8885a571f5ae0 Signed-off-by: Joss Armstrong --- .../org/onap/appc/encryptiontool/wrapper/Constants.java | 16 +++++++++------- .../org/onap/appc/encryptiontool/wrapper/LoadFromDB.java | 14 ++++++++------ 2 files changed, 17 insertions(+), 13 deletions(-) (limited to 'appc-config/appc-encryption-tool/provider/src/main') diff --git a/appc-config/appc-encryption-tool/provider/src/main/java/org/onap/appc/encryptiontool/wrapper/Constants.java b/appc-config/appc-encryption-tool/provider/src/main/java/org/onap/appc/encryptiontool/wrapper/Constants.java index e7c4b712c..3792325ff 100644 --- a/appc-config/appc-encryption-tool/provider/src/main/java/org/onap/appc/encryptiontool/wrapper/Constants.java +++ b/appc-config/appc-encryption-tool/provider/src/main/java/org/onap/appc/encryptiontool/wrapper/Constants.java @@ -5,6 +5,8 @@ * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Copyright (C) 2017 Amdocs + * ================================================================================ + * 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. @@ -26,16 +28,16 @@ public class Constants { public static final String DBLIB_SERVICE = "org.onap.ccsdk.sli.core.dblib.DBResourceManager"; - public static final String DEVICE_AUTHENTICATION="DEVICE_AUTHENTICATION"; - public static final String SCHEMA_SDNCTL="SDNCTL"; + public static final String DEVICE_AUTHENTICATION = "DEVICE_AUTHENTICATION"; + public static final String SCHEMA_SDNCTL = "SDNCTL"; private static final String SDNC_CONFIG_DIR_VAR = "SDNC_CONFIG_DIR"; - public static final String APPC_CONFIG_DIR="/opt/onap/appc/data/properties"; + public static final String APPC_CONFIG_DIR = "/opt/onap/appc/data/properties"; - public static final String VNF_TYPE="vnf_Type"; - public static final String ACTION="action"; - public static final String PROTOCOL="protocol"; - public static final String URL="url"; + public static final String VNF_TYPE = "vnf_Type"; + public static final String ACTION = "action"; + public static final String PROTOCOL = "protocol"; + public static final String URL = "url"; } diff --git a/appc-config/appc-encryption-tool/provider/src/main/java/org/onap/appc/encryptiontool/wrapper/LoadFromDB.java b/appc-config/appc-encryption-tool/provider/src/main/java/org/onap/appc/encryptiontool/wrapper/LoadFromDB.java index 9a9d49582..94af76275 100644 --- a/appc-config/appc-encryption-tool/provider/src/main/java/org/onap/appc/encryptiontool/wrapper/LoadFromDB.java +++ b/appc-config/appc-encryption-tool/provider/src/main/java/org/onap/appc/encryptiontool/wrapper/LoadFromDB.java @@ -5,6 +5,8 @@ * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Copyright (C) 2017 Amdocs + * ================================================================================ + * 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. @@ -48,15 +50,15 @@ public class LoadFromDB { try { dbResourceManager = DbServiceUtil.initDbLibService(); - CachedRowSet data = DbServiceUtil.getData(tableName, argList, Constants.SCHEMA_SDNCTL, getselectData,clause ); + CachedRowSet data = DbServiceUtil.getData(tableName, argList, Constants.SCHEMA_SDNCTL, getselectData, clause ); - Map mp = new HashMap(); + Map mp = new HashMap<>(); while (data.next()) { - mp.put(data.getString(1)+"."+data.getString(2)+"."+data.getString(3)+"."+"user",data.getString(4)); - mp.put(data.getString(1)+"."+data.getString(2)+"."+data.getString(3)+"."+"password",data.getString(5)); - mp.put(data.getString(1)+"."+data.getString(2)+"."+data.getString(3)+"."+"port",data.getString(6)); - mp.put(data.getString(1)+"."+data.getString(2)+"."+data.getString(3)+"."+"url",""); + mp.put(data.getString(1) + "." + data.getString(2) + "."+data.getString(3) + "."+"user", data.getString(4)); + mp.put(data.getString(1) + "." + data.getString(2) + "."+data.getString(3) + "."+"password", data.getString(5)); + mp.put(data.getString(1) + "." + data.getString(2) + "."+data.getString(3) + "."+"port", data.getString(6)); + mp.put(data.getString(1) + "." + data.getString(2) + "."+data.getString(3) + "."+"url", ""); rowCount++; } -- cgit 1.2.3-korg