Replaced all tabs with spaces in java and pom.xml
[so.git] / bpmn / MSOCommonBPMN / src / test / java / org / onap / so / 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.onap.so.bpmn.common;
22
23 import static org.junit.Assert.assertEquals;
24 import static org.junit.Assert.assertNotEquals;
25 import java.io.FileNotFoundException;
26 import java.io.IOException;
27 import org.junit.BeforeClass;
28 import org.junit.Test;
29 import org.onap.so.client.RestPropertiesLoader;
30 import org.onap.so.client.aai.AAIProperties;
31 import org.onap.so.client.dmaap.DmaapProperties;
32 import org.onap.so.client.dmaap.DmaapPropertiesLoader;
33 import org.onap.so.client.sdno.dmaap.SDNOHealthCheckDmaapConsumer;
34
35 public class SPIPropertiesTest {
36
37     @BeforeClass
38     public static void beforeClass() {
39         System.setProperty("mso.config.path", "src/test/resources");
40     }
41
42     @Test
43     public void notEqual() {
44         DmaapProperties one = DmaapPropertiesLoader.getInstance().getNewImpl();
45         DmaapProperties two = DmaapPropertiesLoader.getInstance().getNewImpl();
46         assertNotEquals(one, two);
47     }
48
49     @Test
50     public void equal() {
51         DmaapProperties one = DmaapPropertiesLoader.getInstance().getImpl();
52         DmaapProperties two = DmaapPropertiesLoader.getInstance().getImpl();
53         assertEquals(one, two);
54     }
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
63     @Test
64     public void restEqual() {
65         AAIProperties one = RestPropertiesLoader.getInstance().getImpl(AAIProperties.class);
66         AAIProperties two = RestPropertiesLoader.getInstance().getImpl(AAIProperties.class);
67         assertEquals(one, two);
68     }
69
70 }