2 * ============LICENSE_START=======================================================
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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=========================================================
21 package org.openecomp.appc.encryptiontool;
23 import java.util.HashMap;
24 import java.util.LinkedList;
25 import java.util.List;
27 import java.util.Properties;
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;
37 import com.att.eelf.configuration.EELFLogger;
38 import com.att.eelf.configuration.EELFManager;
40 public class TestEncryptionTool {
43 public void testEncryptionTool() throws Exception{
45 String [] input = new String[] {"testVnf_Type","testUser","testPassword11", "testAction1", "8080", "http://localhost:8080/restconf/healthcheck"};
46 WrapperEncryptionTool.main(input);
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>();
55 inParams.put("prefix", "test");
56 inParams.put("propertyName", "testVnf_Type.testAction1.url");
58 encryptionToolDBWrapper.getProperty(inParams, ctx);
60 System.out.println("propertyValue :" + ctx.getAttribute("test.propertyName"));
62 System.out.println("All propertyValue :" + ctx.getAttributeKeySet());