Initial commit for appc-encryption-tool bundle
[appc.git] / appc-config / appc-encryption-tool / provider / src / test / java / org / openecomp / appc / encryptiontool / TestEncryptionTool.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP : APP-C
4  * ================================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property.  All rights reserved.
6  * ================================================================================
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  * ============LICENSE_END=========================================================
19  */
20
21 package org.openecomp.appc.encryptiontool;
22
23 import java.util.HashMap;
24 import java.util.LinkedList;
25 import java.util.List;
26 import java.util.Map;
27 import java.util.Properties;
28
29 import org.junit.Test;
30 import org.openecomp.appc.encryptiontool.wrapper.EncryptionToolDGWrapper;
31 import org.openecomp.appc.encryptiontool.wrapper.WrapperEncryptionTool;
32 import org.openecomp.sdnc.sli.SvcLogicContext;
33 import org.osgi.framework.BundleActivator;
34 import org.osgi.framework.BundleContext;
35 import org.osgi.framework.ServiceRegistration;
36
37 import com.att.eelf.configuration.EELFLogger;
38 import com.att.eelf.configuration.EELFManager;
39
40 public class TestEncryptionTool {
41
42     //@Test
43     public void testEncryptionTool() throws Exception{
44
45         String [] input = new String[] {"testVnf_Type","testUser","testPassword11", "testAction1", "8080", "http://localhost:8080/restconf/healthcheck"};
46         WrapperEncryptionTool.main(input);
47
48     }
49     //@Test
50     public void testgetPropertyDG() throws Exception{
51         EncryptionToolDGWrapper encryptionToolDBWrapper = new EncryptionToolDGWrapper();
52         SvcLogicContext ctx = new SvcLogicContext();
53         Map<String, String> inParams = new HashMap<String, String>();
54
55         inParams.put("prefix", "test");
56         inParams.put("propertyName", "testVnf_Type.testAction1.url");
57
58         encryptionToolDBWrapper.getProperty(inParams, ctx);
59
60         System.out.println("propertyValue :" + ctx.getAttribute("test.propertyName"));
61
62         System.out.println("All  propertyValue :" + ctx.getAttributeKeySet());
63     }
64
65 }