aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSandeep J <sandeejh@in.ibm.com>2018-09-19 01:57:38 +0530
committerSandeep J <sandeejh@in.ibm.com>2018-09-19 01:57:51 +0530
commit52f5180942137e82080c9cda7cbe16011985fe79 (patch)
tree10d3ca7e5739e200276365887326197dd398f59b
parent758bc233c125d2ffec0bf16618747af747aafa45 (diff)
added test case to TestVlangtagApiServiceImpl
to increase code coverage Issue-ID: CCSDK-552 Change-Id: I2649fe9385b1fa62f1879e02db2993f9000d04ce Signed-off-by: Sandeep J <sandeejh@in.ibm.com>
-rw-r--r--ms/vlantag-api/src/test/java/org/onap/ccsdk/apps/ms/vlantagapi/core/service/TestVlantagApiServiceImpl.java18
1 files changed, 18 insertions, 0 deletions
diff --git a/ms/vlantag-api/src/test/java/org/onap/ccsdk/apps/ms/vlantagapi/core/service/TestVlantagApiServiceImpl.java b/ms/vlantag-api/src/test/java/org/onap/ccsdk/apps/ms/vlantagapi/core/service/TestVlantagApiServiceImpl.java
index 4655d3d1..18aa3024 100644
--- a/ms/vlantag-api/src/test/java/org/onap/ccsdk/apps/ms/vlantagapi/core/service/TestVlantagApiServiceImpl.java
+++ b/ms/vlantag-api/src/test/java/org/onap/ccsdk/apps/ms/vlantagapi/core/service/TestVlantagApiServiceImpl.java
@@ -1,5 +1,6 @@
/*******************************************************************************
* Copyright © 2017-2018 AT&T Intellectual Property.
+ * Modifications Copyright © 2018 IBM.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,6 +17,7 @@
package org.onap.ccsdk.apps.ms.vlantagapi.core.service;
+import static org.junit.Assert.assertEquals;
import static org.mockito.ArgumentMatchers.any;
import java.util.ArrayList;
import java.util.List;
@@ -82,6 +84,22 @@ private static final Logger log = LoggerFactory.getLogger(TestVlantagApiServiceI
Mockito.doReturn(peResponses).when(policyEngineSpy).getConfigUsingPost(any());
}
+ @Test
+ public void testAssignVlanTagForNullRequest() throws Exception
+ {
+ AssignVlanTagResponse response = service.assignVlanTag(null);
+ Integer expectedErrorCode=500;
+ assertEquals(expectedErrorCode, response.getErrorCode());
+ }
+
+ @Test
+ public void testUnAssignVlanTagForNullRequest() throws Exception
+ {
+ UnassignVlanTagResponse response = service.unassignVlanTag(null);
+ Integer expectedErrorCode=500;
+ assertEquals(expectedErrorCode, response.getErrorCode());
+ }
+
@Test(expected = Test.None.class /* no exception expected */)
public void test_assign_sucess_001() throws Exception {