summaryrefslogtreecommitdiffstats
path: root/core/sliapi/provider/src/test
diff options
context:
space:
mode:
authorDan Timoney <dtimoney@att.com>2021-01-29 17:42:42 +0000
committerDan Timoney <dtimoney@att.com>2021-01-29 17:42:42 +0000
commit0e4e58bf061df695341ac250beb97a978cefdaf7 (patch)
tree06539b81ae2f3bbeddd3f7f30199cdd200a8480c /core/sliapi/provider/src/test
parentce4e5f9a00d2677495240ad367b9bfc4b74752d0 (diff)
Revert "migrate sli to alu-SR1"
This reverts commit ce4e5f9a00d2677495240ad367b9bfc4b74752d0. Reason for revert: ODL upgrade changes need to be backed out until issues in ccsdk/features are resolved. Change-Id: I168e2519e37f3eee61609d0da890c14db49ec49e
Diffstat (limited to 'core/sliapi/provider/src/test')
-rw-r--r--core/sliapi/provider/src/test/java/org/onap/ccsdk/sli/core/sliapi/TestSliapiProvider.java45
1 files changed, 15 insertions, 30 deletions
diff --git a/core/sliapi/provider/src/test/java/org/onap/ccsdk/sli/core/sliapi/TestSliapiProvider.java b/core/sliapi/provider/src/test/java/org/onap/ccsdk/sli/core/sliapi/TestSliapiProvider.java
index b731423c5..f48cf783b 100644
--- a/core/sliapi/provider/src/test/java/org/onap/ccsdk/sli/core/sliapi/TestSliapiProvider.java
+++ b/core/sliapi/provider/src/test/java/org/onap/ccsdk/sli/core/sliapi/TestSliapiProvider.java
@@ -1,30 +1,15 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP : CCSDK
- * ================================================================================
- * Copyright (C) 2018 IBM. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
+/**
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
*/
package org.onap.ccsdk.sli.core.sliapi;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
-import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.Matchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
+
import java.io.InputStream;
import java.net.URL;
import java.util.HashMap;
@@ -62,9 +47,10 @@ import org.onap.ccsdk.sli.core.sli.provider.base.SetNodeExecutor;
import org.onap.ccsdk.sli.core.sli.provider.base.SwitchNodeExecutor;
import org.onap.ccsdk.sli.core.sli.provider.base.UpdateNodeExecutor;
import org.onap.ccsdk.sli.core.sli.provider.base.WhileNodeExecutor;
-import org.opendaylight.mdsal.binding.api.NotificationPublishService;
-import org.opendaylight.mdsal.binding.api.RpcProviderService;
-import org.opendaylight.mdsal.dom.api.DOMDataBroker;
+import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService;
+import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
+import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.rev161110.ExecuteGraphInput;
import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.rev161110.ExecuteGraphInputBuilder;
import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.rev161110.HealthcheckInput;
@@ -72,7 +58,6 @@ import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.rev161110.SLI
import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.rev161110.VlbcheckInput;
import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.rev161110.execute.graph.input.SliParameter;
import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.rev161110.execute.graph.input.SliParameterBuilder;
-import org.opendaylight.yangtools.concepts.ObjectRegistration;
/**
* @author dt5972
@@ -114,12 +99,12 @@ public class TestSliapiProvider {
*/
@Before
public void setUp() throws Exception {
- DOMDataBroker dataBroker = mock(DOMDataBroker.class);
+ DataBroker dataBroker = mock(DataBroker.class);
NotificationPublishService notifyService = mock(NotificationPublishService.class);
- RpcProviderService rpcRegistry = mock(RpcProviderService.class);
- ObjectRegistration<SLIAPIService> rpcRegistration = mock(
- ObjectRegistration.class);
- when(rpcRegistry.registerRpcImplementation(any(Class.class), any(SLIAPIService.class))).thenReturn(rpcRegistration);
+ RpcProviderRegistry rpcRegistry = mock(RpcProviderRegistry.class);
+ BindingAwareBroker.RpcRegistration<SLIAPIService> rpcRegistration = (BindingAwareBroker.RpcRegistration<SLIAPIService>) mock(
+ BindingAwareBroker.RpcRegistration.class);
+ when(rpcRegistry.addRpcImplementation(any(Class.class), any(SLIAPIService.class))).thenReturn(rpcRegistration);
// Load svclogic.properties and get a SvcLogicStore
InputStream propStr = TestSliapiProvider.class.getResourceAsStream("/svclogic.properties");
@@ -187,8 +172,8 @@ public class TestSliapiProvider {
pList.add(pBuilder.build());
inputBuilder.setSliParameter(pList);
provider.executeGraph(inputBuilder.build());
-
-
+
+
// Invalid test - graph does not exist
inputBuilder.setMode(ExecuteGraphInput.Mode.Sync);
inputBuilder.setModuleName("sli");
@@ -208,7 +193,7 @@ public class TestSliapiProvider {
pList.add(pBuilder.build());
inputBuilder.setSliParameter(pList);
provider.executeGraph(inputBuilder.build());
-
+
assertTrue(provider.vlbcheck(mock(VlbcheckInput.class)) instanceof Future<?>);
}