1e035cbb88b5b883a4c8398423270e6672189254
[oam/tr069-adapter.git] / netconf-server / src / test / java / org / commscope / tr069adapter / netconf / restapi / NotificationServerRestApiTest.java
1 /*\r
2  * ============LICENSE_START========================================================================\r
3  * ONAP : tr-069-adapter\r
4  * =================================================================================================\r
5  * Copyright (C) 2020 CommScope Inc Intellectual Property.\r
6  * =================================================================================================\r
7  * This tr-069-adapter software file is distributed by CommScope Inc under the Apache License,\r
8  * Version 2.0 (the "License"); you may not use this file except in compliance with the License. You\r
9  * may obtain a copy of the License at\r
10  *\r
11  * http://www.apache.org/licenses/LICENSE-2.0\r
12  *\r
13  * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,\r
14  * either express or implied. See the License for the specific language governing permissions and\r
15  * limitations under the License.\r
16  * ===============LICENSE_END=======================================================================\r
17  */\r
18 \r
19 package org.commscope.tr069adapter.netconf.restapi;\r
20 \r
21 import java.util.ArrayList;\r
22 import java.util.List;\r
23 \r
24 import org.commscope.tr069adapter.acs.common.ParameterDTO;\r
25 import org.commscope.tr069adapter.mapper.model.NetConfNotificationDTO;\r
26 import org.commscope.tr069adapter.netconf.boot.NetConfServiceBooter;\r
27 import org.junit.FixMethodOrder;\r
28 import org.junit.jupiter.api.Test;\r
29 import org.junit.jupiter.api.extension.ExtendWith;\r
30 import org.junit.runners.MethodSorters;\r
31 import org.springframework.beans.factory.annotation.Autowired;\r
32 import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;\r
33 import org.springframework.boot.test.context.SpringBootTest;\r
34 import org.springframework.test.context.junit.jupiter.SpringExtension;\r
35 \r
36 @FixMethodOrder(MethodSorters.NAME_ASCENDING)\r
37 @ExtendWith(SpringExtension.class)\r
38 @SpringBootTest(classes = {NetConfServiceBooter.class},\r
39     args = "--schemas-dir test-schemas --debug true --starting-port 17830")\r
40 @AutoConfigureMockMvc\r
41 public class NotificationServerRestApiTest {\r
42 \r
43   @Autowired\r
44   NotificationReceiverService service;\r
45 \r
46   @Test\r
47   public void createNetconfServer() {\r
48 \r
49 \r
50     NetConfNotificationDTO netConNotifDTO =\r
51         new NetConfNotificationDTO("00005B9432910", null, false);\r
52 \r
53     List<ParameterDTO> parameters = new ArrayList<>();\r
54     ParameterDTO param1 = new ParameterDTO("Device.Info", "info-details");\r
55     parameters.add(param1);\r
56     netConNotifDTO.setParameters(parameters);\r
57     service.processNotification(netConNotifDTO);\r
58 \r
59   }\r
60 }\r