diff options
author | Dan Timoney <dtimoney@att.com> | 2019-08-10 23:09:38 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-08-10 23:09:38 +0000 |
commit | f3ce37cb044d2ea93f3cc5e73d9afd5d9f9b5554 (patch) | |
tree | fa1f634e4c2182fe7901e9cfcb4adbb8cc83deca /generic-resource-api/provider/src/test | |
parent | 890e15ea07a855ca83a35009bc25bc967ea38f49 (diff) | |
parent | 4b7431b5d45cd50ee6331fd7dc72f7db73b587e5 (diff) |
Merge "Test case addition for code coverage"
Diffstat (limited to 'generic-resource-api/provider/src/test')
-rw-r--r-- | generic-resource-api/provider/src/test/java/org/onap/sdnc/northbound/PolicyUpdateNotifyOperationRPCTest.java | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/generic-resource-api/provider/src/test/java/org/onap/sdnc/northbound/PolicyUpdateNotifyOperationRPCTest.java b/generic-resource-api/provider/src/test/java/org/onap/sdnc/northbound/PolicyUpdateNotifyOperationRPCTest.java new file mode 100644 index 00000000..b73bd113 --- /dev/null +++ b/generic-resource-api/provider/src/test/java/org/onap/sdnc/northbound/PolicyUpdateNotifyOperationRPCTest.java @@ -0,0 +1,36 @@ +package org.onap.sdnc.northbound; + +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.runners.MockitoJUnitRunner; +import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.generic.resource.rev170824.PolicyUpdateNotifyOperationInput; +import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.generic.resource.rev170824.PolicyUpdateNotifyOperationOutput; +import org.opendaylight.yangtools.yang.common.RpcResult; + +import static org.junit.Assert.assertEquals; +import static org.onap.sdnc.northbound.util.MDSALUtil.*; + +@RunWith(MockitoJUnitRunner.class) +public class PolicyUpdateNotifyOperationRPCTest extends GenericResourceApiProviderTest { + + private static final String SVC_OPERATION = "policy-update-notify-operation"; + + @Before + public void setUp() throws Exception { + super.setUp(); + svcClient.setScvOperation(SVC_OPERATION); + } + + @Test + public void should_fail_when_invalid_vnf_topology() throws Exception { + + PolicyUpdateNotifyOperationInput input = build(PolicyUpdateNotifyOperationInput()); + + PolicyUpdateNotifyOperationOutput output = + exec(genericResourceApiProvider::policyUpdateNotifyOperation, input, RpcResult::getResult); + + assertEquals("404", output.getErrorCode()); + assertEquals("Invalid input, missing input data", output.getErrorMsg()); + } +} |