From 31766a14a51d34d7ef9a74b61d54928d3c63d5f8 Mon Sep 17 00:00:00 2001 From: Sumapriya Date: Wed, 14 Mar 2018 10:30:14 +0530 Subject: Adding Junit Adding Junit for: ApplicationException.java Sonar-Link: https://sonar.onap.org/code?id=org.onap.so%3Aso&selected=org.onap.so.adapters%3Amso-vfc-adapter%3Asrc%2Fmain%2Fjava%2Forg%2Fopenecomp%2Fmso%2Fadapters%2Fvfc%2Fexceptions%2FApplicationException.java Change-Id: I4a65874b63aa98aacbaabf6961c89ec500dc85d9 Issue-ID: SO-479 Signed-off-by: Sumapriya --- .../vfc/exceptions/ApplicationExceptionTest.java | 42 ++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 adapters/mso-vfc-adapter/src/test/java/org/openecomp/mso/adapters/vfc/exceptions/ApplicationExceptionTest.java (limited to 'adapters/mso-vfc-adapter/src') diff --git a/adapters/mso-vfc-adapter/src/test/java/org/openecomp/mso/adapters/vfc/exceptions/ApplicationExceptionTest.java b/adapters/mso-vfc-adapter/src/test/java/org/openecomp/mso/adapters/vfc/exceptions/ApplicationExceptionTest.java new file mode 100644 index 0000000000..231e210bbe --- /dev/null +++ b/adapters/mso-vfc-adapter/src/test/java/org/openecomp/mso/adapters/vfc/exceptions/ApplicationExceptionTest.java @@ -0,0 +1,42 @@ +/* +* ============LICENSE_START======================================================= +* ONAP : SO +* ================================================================================ +* Copyright 2018 TechMahindra +*================================================================================= +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* ============LICENSE_END========================================================= +*/ + +package org.openecomp.mso.adapters.vfc.exceptions; + +import static org.junit.Assert.*; + +import org.junit.Test; + +public class ApplicationExceptionTest { + private ApplicationException application = new ApplicationException(0,null); + + @Test + public void testApplicationException() { + application.setErrorCode(0); + application.setErrorMsg("ErrorMsg"); + assertEquals(application.getErrorCode(), 0); + assertEquals(application.getErrorMsg(), "ErrorMsg"); + } + + @Test + public void testbuildErrorResponse(){ + assert(application.buildErrorResponse()!=null); + } +} -- cgit 1.2.3-korg