feat:Enhance sliceanalysis MS to use DCAE SDK dmaap-client lib
[dcaegen2/services.git] / components / slice-analysis-ms / src / test / java / org / onap / slice / analysis / ms / utils / DcaeDmaapUtilTest.java
1 /*******************************************************************************
2  *  ============LICENSE_START=======================================================
3  *  slice-analysis-ms
4  *  ================================================================================
5  *   Copyright (C) 2022 CTC, Inc.
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
10  *
11  *          http://www.apache.org/licenses/LICENSE-2.0
12  *
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=========================================================
19  *
20  *******************************************************************************/
21
22 package org.onap.slice.analysis.ms.utils;
23
24 import org.junit.Test;
25 import org.junit.runner.RunWith;
26 import org.onap.dcaegen2.services.sdk.rest.services.dmaap.client.api.MessageRouterPublisher;
27 import org.onap.dcaegen2.services.sdk.rest.services.dmaap.client.api.MessageRouterSubscriber;
28 import org.onap.dcaegen2.services.sdk.rest.services.dmaap.client.model.MessageRouterPublishRequest;
29 import org.onap.dcaegen2.services.sdk.rest.services.dmaap.client.model.MessageRouterSubscribeRequest;
30 import org.springframework.boot.test.context.SpringBootTest;
31 import org.springframework.test.context.junit4.SpringRunner;
32
33 import static org.junit.Assert.assertNotNull;
34 import static org.onap.slice.analysis.ms.utils.DcaeDmaapUtil.buildPublisher;
35 import static org.onap.slice.analysis.ms.utils.DcaeDmaapUtil.buildPublisherRequest;
36 import static org.onap.slice.analysis.ms.utils.DcaeDmaapUtil.buildSubscriber;
37 import static org.onap.slice.analysis.ms.utils.DcaeDmaapUtil.buildSubscriberRequest;
38
39 @RunWith(SpringRunner.class)
40 @SpringBootTest(classes = DcaeDmaapUtilTest.class)
41 public class DcaeDmaapUtilTest {
42
43     @Test
44     public void buildSubscriberTest(){
45         MessageRouterSubscriber subscriber = buildSubscriber();
46         assertNotNull(subscriber);
47     }
48
49     @Test
50     public void buildSubscriberRequestTest(){
51         MessageRouterSubscribeRequest request = buildSubscriberRequest("name", "url");
52         assertNotNull(request);
53     }
54
55     @Test
56     public void buildPublisherTest(){
57         MessageRouterPublisher publisher = buildPublisher();
58         assertNotNull(publisher);
59     }
60
61     @Test
62     public void buildPublisherRequestTest(){
63         MessageRouterPublishRequest request = buildPublisherRequest("name", "url");
64         assertNotNull(request);
65     }
66
67 }