bee0a828ea7bdaf42fc8014051db471a55dc7ebc
[so.git] / bpmn / MSOCommonBPMN / src / test / java / org / openecomp / mso / client / aai / AAIPServerTest.java
1 /*-\r
2  * ============LICENSE_START=======================================================\r
3  * ONAP - SO\r
4  * ================================================================================\r
5  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.\r
6  * ================================================================================\r
7  * Licensed under the Apache License, Version 2.0 (the "License");\r
8  * you may not use this file except in compliance with the License.\r
9  * You may obtain a copy of the License at\r
10  *\r
11  *      http://www.apache.org/licenses/LICENSE-2.0\r
12  *\r
13  * Unless required by applicable law or agreed to in writing, software\r
14  * distributed under the License is distributed on an "AS IS" BASIS,\r
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
16  * See the License for the specific language governing permissions and\r
17  * limitations under the License.\r
18  * ============LICENSE_END=========================================================\r
19  */\r
20 \r
21 package org.openecomp.mso.client.aai;\r
22 \r
23 import java.io.File;\r
24 import java.io.IOException;\r
25 import java.security.NoSuchAlgorithmException;\r
26 import java.util.List;\r
27 import java.util.UUID;\r
28 \r
29 import org.junit.BeforeClass;\r
30 import org.junit.Ignore;\r
31 import org.junit.Test;\r
32 import org.onap.aai.domain.yang.Pserver;\r
33 import static org.junit.Assert.assertEquals;\r
34 import com.fasterxml.jackson.core.JsonParseException;\r
35 import com.fasterxml.jackson.databind.JsonMappingException;\r
36 public class AAIPServerTest {\r
37 \r
38         @BeforeClass\r
39         public static void setUp() {\r
40                 System.setProperty("mso.config.path", "src/test/resources");\r
41                 System.setProperty("javax.net.ssl.keyStore", "C:/etc/ecomp/mso/config/msoClientKeyStore.jks");\r
42                 System.setProperty("javax.net.ssl.keyStorePassword", "mso4you");\r
43                 System.setProperty("javax.net.ssl.trustStore", "C:/etc/ecomp/mso/config/msoTrustStore.jks");\r
44                 System.setProperty("javax.net.ssl.trustStorePassword", "mso_Domain2.0_4you");\r
45         }\r
46         \r
47         @Test\r
48         @Ignore // IGNORED FOR 1710 MERGE TO ONAP\r
49         public void pserverTest() throws JsonParseException, JsonMappingException, IOException, NoSuchAlgorithmException {\r
50                 AAIRestClientImpl client = new AAIRestClientImpl();\r
51                 File file = new File("src/test/resources/__files/AAI/pserver.json");\r
52                 List<Pserver> list = client.getListOfPservers(file);\r
53                 \r
54                 assertEquals("", list.get(0).getHostname(), "test");\r
55         }\r
56         \r
57         @Test\r
58         @Ignore // IGNORED FOR 1710 MERGE TO ONAP\r
59         public void pserverActualTest() throws JsonParseException, JsonMappingException, IOException, NoSuchAlgorithmException {\r
60                 AAIRestClientImpl client = new AAIRestClientImpl();\r
61                 List<Pserver> list = client.getPhysicalServerByVnfId("d946afed-8ebe-4c5d-9665-54fcc043b8e7", UUID.randomUUID().toString());\r
62                 assertEquals("", list.size(), 0);\r
63         }\r
64 \r
65 }\r