added test case to TestVlangtagApiServiceImpl 67/67467/1
authorSandeep J <sandeejh@in.ibm.com>
Tue, 18 Sep 2018 20:27:38 +0000 (01:57 +0530)
committerSandeep J <sandeejh@in.ibm.com>
Tue, 18 Sep 2018 20:27:51 +0000 (01:57 +0530)
to increase code coverage

Issue-ID: CCSDK-552
Change-Id: I2649fe9385b1fa62f1879e02db2993f9000d04ce
Signed-off-by: Sandeep J <sandeejh@in.ibm.com>
ms/vlantag-api/src/test/java/org/onap/ccsdk/apps/ms/vlantagapi/core/service/TestVlantagApiServiceImpl.java

index 4655d3d..18aa302 100644 (file)
@@ -1,5 +1,6 @@
 /*******************************************************************************\r
  * Copyright © 2017-2018 AT&T Intellectual Property.\r
+ * Modifications Copyright © 2018 IBM.\r
  * \r
  * Licensed under the Apache License, Version 2.0 (the "License");\r
  * you may not use this file except in compliance with the License.\r
@@ -16,6 +17,7 @@
 \r
 package org.onap.ccsdk.apps.ms.vlantagapi.core.service;\r
 \r
+import static org.junit.Assert.assertEquals;\r
 import static org.mockito.ArgumentMatchers.any;\r
 import java.util.ArrayList;\r
 import java.util.List;\r
@@ -82,6 +84,22 @@ private static final Logger log = LoggerFactory.getLogger(TestVlantagApiServiceI
                Mockito.doReturn(peResponses).when(policyEngineSpy).getConfigUsingPost(any());\r
        }\r
        \r
+       @Test\r
+       public void testAssignVlanTagForNullRequest() throws Exception\r
+       {\r
+               AssignVlanTagResponse response = service.assignVlanTag(null);\r
+               Integer expectedErrorCode=500;\r
+               assertEquals(expectedErrorCode, response.getErrorCode());\r
+       }\r
+       \r
+       @Test\r
+       public void testUnAssignVlanTagForNullRequest() throws Exception\r
+       {\r
+               UnassignVlanTagResponse response = service.unassignVlanTag(null);\r
+               Integer expectedErrorCode=500;\r
+               assertEquals(expectedErrorCode, response.getErrorCode());\r
+       }\r
+       \r
        @Test(expected = Test.None.class /* no exception expected */)\r
        public void test_assign_sucess_001() throws Exception {\r
                \r