2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Copyright (C) 2017 Amdocs
8 * =============================================================================
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
21 * ECOMP is a trademark and service mark of AT&T Intellectual Property.
22 * ============LICENSE_END=========================================================
25 package org.openecomp.appc.encryptiontool;
27 import java.util.ArrayList;
28 import java.util.HashMap;
30 import org.junit.Test;
31 import org.openecomp.appc.encryptiontool.wrapper.DbServiceUtil;
32 import org.openecomp.appc.encryptiontool.wrapper.EncryptionToolDGWrapper;
33 import org.openecomp.appc.encryptiontool.wrapper.WrapperEncryptionTool;
34 import org.openecomp.sdnc.sli.SvcLogicContext;
36 public class TestEncryptionTool {
39 public void testEncryptionTool() throws Exception{
40 String [] input = new String[] {"testVnf_Type","testUser","testPassword11", "testAction1", "8080", "http://localhost:8080/restconf/healthcheck"};
41 WrapperEncryptionTool.main(input);
44 // @Test(expected=Exception.class)
45 public void testgetPropertyDG() throws Exception{
46 EncryptionToolDGWrapper et = new EncryptionToolDGWrapper();
47 SvcLogicContext ctx = new SvcLogicContext();
48 Map<String, String> inParams = new HashMap<String, String>();
49 inParams.put("prefix", "test");
50 inParams.put("propertyName", "testVnf_Type.testAction1.url");
51 et.getProperty(inParams, ctx);
53 @Test(expected=Exception.class)
54 public void testgetData() throws Exception
56 DbServiceUtil d = new DbServiceUtil();
57 ArrayList argList = null;
58 String schema ="sdnctl";
59 String tableName ="dual";
60 String getselectData ="123";
61 String getDataClasue="123='123'";
62 d.getData(tableName, argList, schema, getselectData, getDataClasue);
64 @Test(expected=Exception.class)
65 public void testupdateDB() throws Exception
67 DbServiceUtil d = new DbServiceUtil();
68 String setCluase = null;
69 String schema ="sdnctl";
70 String tableName ="dual";
71 ArrayList inputArgs = null;
72 String whereClause="123='123'";
73 d.updateDB(tableName, inputArgs, schema, whereClause, setCluase);