aboutsummaryrefslogtreecommitdiffstats
path: root/appc-inbound/appc-artifact-handler
diff options
context:
space:
mode:
authorSandeep J <sandeejh@in.ibm.com>2019-03-26 13:41:32 +0530
committerPatrick Brady <patrick.brady@att.com>2019-03-26 20:05:17 +0000
commitf59155c1c12543e54972298a3020e2372edb79b7 (patch)
tree61c4dfc4e2d47315dad0d6e239fb0bbaec895d3b /appc-inbound/appc-artifact-handler
parent9c018402d46127218dd8ed2bf67ed41f925b2305 (diff)
added test cases to ArtifactHandlerProviderTest
to increase code coverage Issue-ID: APPC-1086 Change-Id: Ic03b32bc4c8b87a76db2e2aae45f7706f19e9bd4 Signed-off-by: Sandeep J <sandeejh@in.ibm.com>
Diffstat (limited to 'appc-inbound/appc-artifact-handler')
-rw-r--r--appc-inbound/appc-artifact-handler/provider/src/test/java/org/onap/appc/artifact/handler/ArtifactHandlerProviderTest.java27
1 files changed, 22 insertions, 5 deletions
diff --git a/appc-inbound/appc-artifact-handler/provider/src/test/java/org/onap/appc/artifact/handler/ArtifactHandlerProviderTest.java b/appc-inbound/appc-artifact-handler/provider/src/test/java/org/onap/appc/artifact/handler/ArtifactHandlerProviderTest.java
index aa1c86ad2..9b6af8791 100644
--- a/appc-inbound/appc-artifact-handler/provider/src/test/java/org/onap/appc/artifact/handler/ArtifactHandlerProviderTest.java
+++ b/appc-inbound/appc-artifact-handler/provider/src/test/java/org/onap/appc/artifact/handler/ArtifactHandlerProviderTest.java
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2019 Ericsson
* ================================================================================
+ * Modifications Copyright (C) 2019 IBM.
+ * ================================================================================
* 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
@@ -21,12 +23,11 @@
package org.onap.appc.artifact.handler;
-import com.google.common.util.concurrent.CheckedFuture;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
+
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
+
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mockito;
@@ -37,14 +38,15 @@ import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService
import org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction;
import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
-import org.opendaylight.yangtools.yang.common.RpcResult;
import org.opendaylight.yang.gen.v1.org.onap.appc.artifacthandler.rev170321.ArtifactHandlerService;
import org.opendaylight.yang.gen.v1.org.onap.appc.artifacthandler.rev170321.UploadartifactInput;
import org.opendaylight.yang.gen.v1.org.onap.appc.artifacthandler.rev170321.UploadartifactInputBuilder;
import org.opendaylight.yang.gen.v1.org.onap.appc.artifacthandler.rev170321.UploadartifactOutput;
import org.opendaylight.yang.gen.v1.org.onap.appc.artifacthandler.rev170321.document.parameters.DocumentParameters;
import org.opendaylight.yang.gen.v1.org.onap.appc.artifacthandler.rev170321.request.information.RequestInformation;
-import org.powermock.reflect.Whitebox;
+import org.opendaylight.yangtools.yang.common.RpcResult;
+
+import com.google.common.util.concurrent.CheckedFuture;
public class ArtifactHandlerProviderTest {
@@ -149,5 +151,20 @@ public class ArtifactHandlerProviderTest {
Future<RpcResult<UploadartifactOutput>> output = (Future<RpcResult<UploadartifactOutput>>) artifactHandlerProvider.uploadartifact(uploadArtifactInput);
assertTrue(output.get().getResult() instanceof UploadartifactOutput);
}
+
+ @Test
+ public void testClose() throws Exception
+ {
+ artifactHandlerProvider = new ArtifactHandlerProvider(dataBroker, notificationService, rpcRegistry);
+ artifactHandlerProvider.close();
+ }
+
+ @Test
+ public void testGetArtifactHandlerProviderUtil() throws Exception
+ {
+ artifactHandlerProvider = new ArtifactHandlerProvider(dataBroker, notificationService, rpcRegistry);
+ UploadartifactInput uploadArtifactInput = Mockito.mock(UploadartifactInput.class);
+ assertTrue(artifactHandlerProvider.getArtifactHandlerProviderUtil(uploadArtifactInput) instanceof ArtifactHandlerProviderUtil);
+ }
}