From 52f5180942137e82080c9cda7cbe16011985fe79 Mon Sep 17 00:00:00 2001 From: Sandeep J Date: Wed, 19 Sep 2018 01:57:38 +0530 Subject: added test case to TestVlangtagApiServiceImpl to increase code coverage Issue-ID: CCSDK-552 Change-Id: I2649fe9385b1fa62f1879e02db2993f9000d04ce Signed-off-by: Sandeep J --- .../core/service/TestVlantagApiServiceImpl.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'ms/vlantag-api') 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 { -- cgit 1.2.3-korg