summaryrefslogtreecommitdiffstats
path: root/appc-provider/appc-provider-bundle/src/test
diff options
context:
space:
mode:
authorLathishbabu Ganesan <lathishbabu.ganesan@ericsson.com>2019-02-19 07:29:58 -0500
committerTakamune Cho <takamune.cho@att.com>2019-02-20 15:05:55 +0000
commit4dc98f06ad922fdb4b647114f37e78024df118a3 (patch)
tree2cf829cd19a5a14ccfbf31c8943141141645aa39 /appc-provider/appc-provider-bundle/src/test
parent054810c72f2e33488118796388be809b32357104 (diff)
Added test case for Appc Provider client
Increased the coverage from 0% to 100% Issue-ID: APPC-1455 Change-Id: I0e719bd084a985b63110f15681b6a87ec4affb4d Signed-off-by: Lathishbabu Ganesan <lathishbabu.ganesan@ericsson.com>
Diffstat (limited to 'appc-provider/appc-provider-bundle/src/test')
-rw-r--r--appc-provider/appc-provider-bundle/src/test/java/org/onap/appc/provider/TestAppcProviderClient.java54
1 files changed, 54 insertions, 0 deletions
diff --git a/appc-provider/appc-provider-bundle/src/test/java/org/onap/appc/provider/TestAppcProviderClient.java b/appc-provider/appc-provider-bundle/src/test/java/org/onap/appc/provider/TestAppcProviderClient.java
new file mode 100644
index 000000000..c4de29d8a
--- /dev/null
+++ b/appc-provider/appc-provider-bundle/src/test/java/org/onap/appc/provider/TestAppcProviderClient.java
@@ -0,0 +1,54 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2019 Ericsson. 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.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.appc.provider;
+
+import static org.junit.Assert.assertSame;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.when;
+import java.util.Properties;
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.Mockito;
+import org.onap.ccsdk.sli.core.sli.SvcLogicException;
+import org.onap.ccsdk.sli.core.sli.provider.SvcLogicService;
+
+public class TestAppcProviderClient {
+
+ private AppcProviderClient appcProviderClient;
+ private SvcLogicService svcLogicService;
+
+ @Before
+ public void setUp() {
+ svcLogicService = Mockito.mock(SvcLogicService.class);
+ appcProviderClient = new AppcProviderClient(svcLogicService);
+ }
+
+ @Test
+ public void testHasGraph() throws SvcLogicException {
+ when(svcLogicService.hasGraph("APPC", "healthcheck", "1.0", "active")).thenReturn(true);
+ assertTrue(appcProviderClient.hasGraph("APPC", "healthcheck", "1.0", "active"));
+ }
+
+ @Test
+ public void testExecute() throws SvcLogicException {
+ Properties respProps = new Properties();
+ when(svcLogicService.execute("APPC", "healthcheck", "1.0", "active", null)).thenReturn(respProps);
+ assertSame(respProps, appcProviderClient.execute("APPC", "healthcheck", "1.0", "active", null));
+ }
+}