ad2e85498d5ce0c09684d183581fb4b2f911a652
[ccsdk/sli.git] /
1 /*-
2  * ============LICENSE_START=======================================================
3  * openECOMP : SDN-C
4  * ================================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property. All rights
6  *                                                      reserved.
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
11  *
12  *      http://www.apache.org/licenses/LICENSE-2.0
13  *
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=========================================================
20  */
21
22 package org.onap.sdnc.northbound.dataChange;
23
24 public class TestDataChange {//extends AbstractConcurrentDataBrokerTest {
25
26 //    private DataChangeProvider dataChangeProvider;
27 //    private static final Logger LOG = LoggerFactory.getLogger(DataChangeProvider.class);
28 //
29 //    @Before
30 //    public void setUp() throws Exception {
31 //        if (null == dataChangeProvider) {
32 //            DataBroker dataBroker = getDataBroker();
33 //            NotificationPublishService mockNotification = mock(NotificationPublishService.class);
34 //            RpcProviderService mockRpcRegistry = mock(RpcProviderService.class);
35 //            DataChangeClient mockSliClient = mock(DataChangeClient.class);
36 //            dataChangeProvider = new DataChangeProvider(dataBroker, mockNotification, mockRpcRegistry, mockSliClient);
37 //        }
38 //    }
39 //
40 //    //Testcase should return error 503 when No service logic active for dataChange.
41 //    @Test
42 //    public void testDataChangeNotification() {
43 //
44 //        DataChangeNotificationInputBuilder inputBuilder = new DataChangeNotificationInputBuilder();
45 //
46 //        inputBuilder.setAaiEventId("1");
47 //
48 //
49 //        // TODO: currently initialize SvcLogicServiceClient is failing, need to fix
50 //        java.util.concurrent.Future<RpcResult<DataChangeNotificationOutput>> future = dataChangeProvider
51 //                                                                          .dataChangeNotification(inputBuilder.build());
52 //        RpcResult<DataChangeNotificationOutput> rpcResult = null;
53 //        try {
54 //            rpcResult = future.get();
55 //        } catch (Exception e) {
56 //            fail("Error : " + e);
57 //        }
58 //        LOG.info("result: {}", rpcResult);
59 //        assertEquals("503", rpcResult.getResult().getDataChangeResponseCode());
60 //    }
61 //
62 //    //Input parameter validation
63 //    @Test
64 //    public void testDataChangeNotificationInputValidation() {
65 //
66 //        java.util.concurrent.Future<RpcResult<DataChangeNotificationOutput>> future = dataChangeProvider
67 //                                                                                      .dataChangeNotification(null);
68 //        RpcResult<DataChangeNotificationOutput> rpcResult = null;
69 //        try {
70 //            rpcResult = future.get();
71 //        } catch (Exception e) {
72 //            fail("Error : " + e);
73 //        }
74 //        LOG.info("result: {}", rpcResult);
75 //        assertEquals("403", rpcResult.getResult().getDataChangeResponseCode());
76 //    }
77 }