First part of onap rename
[appc.git] / appc-config / appc-encryption-tool / provider / src / test / java / org / onap / appc / encryptiontool / TestEncryptionTool.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP : APPC
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
12  * 
13  *      http://www.apache.org/licenses/LICENSE-2.0
14  * 
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.
20  * 
21  * ECOMP is a trademark and service mark of AT&T Intellectual Property.
22  * ============LICENSE_END=========================================================
23  */
24
25 package org.onap.appc.encryptiontool;
26
27 import java.util.ArrayList;
28 import java.util.HashMap;
29 import java.util.Map;
30 import org.junit.Test;
31 import org.onap.appc.encryptiontool.wrapper.DbServiceUtil;
32 import org.onap.appc.encryptiontool.wrapper.EncryptionToolDGWrapper;
33 import org.onap.appc.encryptiontool.wrapper.WrapperEncryptionTool;
34 import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
35
36 public class TestEncryptionTool {
37
38         @Test
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);
42
43         }
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);
52         }
53         @Test(expected=Exception.class)
54         public void testgetData() throws Exception
55         {
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);
63         }
64         @Test(expected=Exception.class)
65         public void testupdateDB() throws Exception
66         {
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);
74         }
75 }