AT&T 1712 and 1802 release code
[so.git] / bpmn / MSOCommonBPMN / src / test / java / org / openecomp / mso / bpmn / common / SPIPropertiesTest.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP - SO
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.mso.bpmn.common;
22
23 import static org.junit.Assert.assertEquals;
24 import static org.junit.Assert.assertNotEquals;
25
26 import java.io.FileNotFoundException;
27 import java.io.IOException;
28
29 import org.junit.BeforeClass;
30 import org.junit.Test;
31 import org.openecomp.mso.client.RestPropertiesLoader;
32 import org.openecomp.mso.client.aai.AAIProperties;
33 import org.openecomp.mso.client.dmaap.DmaapProperties;
34 import org.openecomp.mso.client.dmaap.DmaapPropertiesLoader;
35 import org.openecomp.mso.client.sdno.dmaap.SDNOHealthCheckDmaapConsumer;
36
37 public class SPIPropertiesTest {
38
39         @BeforeClass
40         public static void beforeClass() {
41                 System.setProperty("mso.config.path", "src/test/resources");
42         }
43         
44         @Test
45         public void notEqual() {
46                 DmaapProperties one = DmaapPropertiesLoader.getInstance().getNewImpl();
47                 DmaapProperties two = DmaapPropertiesLoader.getInstance().getNewImpl();
48                 assertNotEquals(one, two);
49         }
50         @Test
51         public void equal() {
52                 DmaapProperties one = DmaapPropertiesLoader.getInstance().getImpl();
53                 DmaapProperties two = DmaapPropertiesLoader.getInstance().getImpl();
54                 assertEquals(one, two);
55         }
56         @Test
57         public void restNotEqual() {
58                 AAIProperties one = RestPropertiesLoader.getInstance().getNewImpl(AAIProperties.class);
59                 AAIProperties two = RestPropertiesLoader.getInstance().getNewImpl(AAIProperties.class);
60                 assertNotEquals(one, two);
61         }
62         @Test
63         public void restEqual() {
64                 AAIProperties one = RestPropertiesLoader.getInstance().getImpl(AAIProperties.class);
65                 AAIProperties two = RestPropertiesLoader.getInstance().getImpl(AAIProperties.class);
66                 assertEquals(one, two);
67         }
68         
69 }