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.FaultNotificationClient;
30 public class TestFaultNotificationClient extends FaultNotificationClient {
32 public static String baseUrl = "http://localhost:8181";
33 FaultNotificationClient testClient;
36 public TestFaultNotificationClient() {
42 public void testFaultNotificationClient() {
43 testClient = new TestFaultNotificationClient();
44 testClient.setAuthorization("admin", "admin");
45 Map<String, String> payloadMap = FaultNotificationClient.createFaultNotificationPayloadMap(
46 "TEST_50001", "1", "2019-11-20T09:25:19.948Z",
47 "SEDNKSAHQ01M01nSky01", "lossOfSignal", "Critical");
48 String msg = testClient.prepareMessageFromPayloadMap(payloadMap);
49 assertTrue(testClient.sendNotification(msg));
50 assertTrue(testClient.sendNotification(msg));
55 public BaseHTTPResponse sendRequest(String uri, String method, String body, Map<String, String> headers)
57 System.out.println("In overridden sendRequest in TestFaultNotificationClient");
58 return new BaseHTTPResponse(200, body);