2  * ============LICENSE_START========================================================================
 
   3  * ONAP : ccsdk feature sdnr wt
 
   4  * =================================================================================================
 
   5  * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved.
 
   6  * Copyright (C) 2021 Samsung Electronics Intellectual Property. All rights reserved.
 
   7  * =================================================================================================
 
   8  * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
 
   9  * in compliance with the License. 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 distributed under the License
 
  14  * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 
  15  * or implied. See the License for the specific language governing permissions and limitations under
 
  17  * ============LICENSE_END==========================================================================
 
  20 package org.onap.ccsdk.features.sdnr.wt.mountpointregistrar.test;
 
  22 import static org.junit.Assert.assertTrue;
 
  23 import java.io.IOException;
 
  25 import javax.annotation.Nonnull;
 
  26 import org.junit.Test;
 
  27 import org.onap.ccsdk.features.sdnr.wt.common.http.BaseHTTPResponse;
 
  28 import org.onap.ccsdk.features.sdnr.wt.mountpointregistrar.impl.PNFMountPointClient;
 
  30 public class TestPNFMountPointClient extends PNFMountPointClient {
 
  32     public static String baseUrl = "http://localhost:8181";
 
  33     PNFMountPointClient testClient;
 
  36     public TestPNFMountPointClient() {
 
  42     public void testPNFMountPointClient() {
 
  43         testClient = new TestPNFMountPointClient();
 
  44         testClient.setAuthorization("admin", "admin");
 
  45         Map<String, String> payloadMap = PNFMountPointClient.createPNFNotificationPayloadMap(
 
  46                 "TEST 50001", "127.0.0.1", "17830", "TLS",
 
  47                 "admin", "admin", "key_id");
 
  48         String msg = testClient.prepareMessageFromPayloadMap(payloadMap);
 
  50         assertTrue(testClient.sendNotification(msg));
 
  51         assertTrue(testClient.sendNotification(msg));
 
  57     public BaseHTTPResponse sendRequest(String uri, String method, String body, Map<String, String> headers)
 
  59         System.out.println("In overridden sendRequest in TestPNFMountPointClient, uri = "+uri);
 
  60         return new BaseHTTPResponse(200, body);