From: Sandeep J Date: Tue, 18 Sep 2018 20:27:38 +0000 (+0530) Subject: added test case to TestVlangtagApiServiceImpl X-Git-Tag: 0.3.0~24^2 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=52f5180942137e82080c9cda7cbe16011985fe79;p=ccsdk%2Fapps.git added test case to TestVlangtagApiServiceImpl to increase code coverage Issue-ID: CCSDK-552 Change-Id: I2649fe9385b1fa62f1879e02db2993f9000d04ce Signed-off-by: Sandeep J --- 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 {