2 * ============LICENSE_START=======================================================
\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
11 * http://www.apache.org/licenses/LICENSE-2.0
\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
21 package org.openecomp.mso.client.aai;
\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
29 import org.junit.BeforeClass;
\r
30 import org.junit.Ignore;
\r
31 import org.junit.Test;
\r
32 import org.openecomp.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
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
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
54 assertEquals("", list.get(0).getHostname(), "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