2 * ============LICENSE_START=======================================================
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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=========================================================
21 package org.onap.policy.template.demo;
23 import static org.junit.Assert.*;
25 import java.util.HashMap;
27 import org.junit.AfterClass;
28 import org.junit.BeforeClass;
29 import org.junit.Test;
30 import org.onap.policy.drools.http.server.HttpServletServer;
31 import org.onap.policy.mso.SOResponse;
32 import org.onap.policy.mso.util.Serialization;
33 import org.onap.policy.rest.RESTManager;
34 import org.onap.policy.rest.RESTManager.Pair;
36 public class MsoSimulatorTest {
39 public static void setUpSimulator() {
42 } catch (InterruptedException e) {
48 public static void tearDownSimulator() {
49 HttpServletServer.factory.destroy();
53 public void testResponse(){
54 Pair<Integer, String> httpDetails = RESTManager.post("http://localhost:6667/serviceInstances/v2/12345/vnfs/12345/vfModulesHTTPS/1.1", "username", "password", new HashMap<String, String>(), "application/json", "Some Request Here");
55 assertNotNull(httpDetails);
56 SOResponse response = Serialization.gsonPretty.fromJson(httpDetails.b, SOResponse.class);
57 assertNotNull(response);