Test ansible adaptor props
[ccsdk/sli/adaptors.git] / ansible-adapter / ansible-adapter-bundle / src / test / java / org / onap / ccsdk / adapter / ansible / impl / TestAnsibleAdapterPropertiesProviderImpl.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * onap
4  * ================================================================================
5  * Copyright (C) 2018 Samsung
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.onap.ccsdk.adapter.ansible.impl;
22
23 import org.junit.Before;
24 import org.junit.Test;
25 import org.onap.ccsdk.sli.adaptors.ansible.impl.AnsibleAdapterPropertiesProviderImpl;
26
27 import java.util.Properties;
28
29 import static org.junit.Assert.assertEquals;
30
31 public class TestAnsibleAdapterPropertiesProviderImpl {
32     AnsibleAdapterPropertiesProviderImpl adaptor;
33     @Before
34     public void setup() throws IllegalArgumentException {
35         adaptor = new AnsibleAdapterPropertiesProviderImpl();
36     }
37
38
39     @Test
40     public void testGetProperties() throws IllegalStateException, IllegalArgumentException {
41         Properties prop = adaptor.getProperties();
42
43         System.out.println("All Property params : " + prop);
44         assertEquals("TRUST_ALL", prop.getProperty("org.onap.appc.adapter.ansible.clientType"));
45         assertEquals("org.onap.appc.appc_ansible_adapter", prop.getProperty("org.onap.appc.provider.adaptor.name"));
46         assertEquals("changeit", prop.getProperty("org.onap.appc.adapter.ansible.trustStore.trustPasswd"));
47         assertEquals("${user.home},/opt/opendaylight/current/properties", prop.getProperty("org.onap.appc.bootstrap.path"));
48         assertEquals("APPC", prop.getProperty("appc.application.name"));
49         assertEquals("appc.properties", prop.getProperty("org.onap.appc.bootstrap.file"));
50         assertEquals("org.onap/appc/i18n/MessageResources", prop.getProperty("org.onap.appc.resources"));
51         assertEquals("/opt/opendaylight/tls-client/mykeystore.js", prop.getProperty("org.onap.appc.adapter.ansible.trustStore"));
52     }
53 }