1 /*******************************************************************************
2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2020 Wipro Limited.
6 * Copyright (C) 2022 Huawei Canada Limited.
7 * ==============================================================================
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 * ============LICENSE_END=========================================================
21 *******************************************************************************/
22 package org.onap.slice.analysis.ms.dmaap;
24 import com.fasterxml.jackson.databind.ObjectMapper;
25 import org.junit.Test;
26 import org.junit.runner.RunWith;
27 import org.mockito.InjectMocks;
28 import org.mockito.Mockito;
29 import org.mockito.Spy;
30 import org.springframework.boot.test.context.SpringBootTest;
31 import org.springframework.test.context.junit4.SpringRunner;
33 import java.io.IOException;
34 import java.nio.file.Files;
35 import java.nio.file.Paths;
37 @RunWith(SpringRunner.class)
38 @SpringBootTest(classes = VesNotificationCallbackTest.class)
39 public class VesNotificationCallbackTest {
40 ObjectMapper obj = new ObjectMapper();
44 VesNotificationCallback vesNotificationCallback;
47 public void initTest() {
48 vesNotificationCallback.init();
49 Mockito.verify(vesNotificationCallback, Mockito.atLeastOnce()).init();
53 public void activateCallBackTest() {
56 input = new String(Files.readAllBytes(Paths.get("src/test/resources/vesCCVPNNotiModel.json")));
57 } catch (IOException e) {
60 vesNotificationCallback.activateCallBack(input);
61 Mockito.verify(vesNotificationCallback, Mockito.atLeastOnce()).activateCallBack(Mockito.anyString());