From 471d10938b8886d695bd9c50b88ad210a61b5a8c Mon Sep 17 00:00:00 2001 From: "priyanka.akhade" Date: Fri, 13 Mar 2020 10:52:03 +0000 Subject: Migrate to gson Issue-ID: VNFSDK-553 Signed-off-by: priyanka.akhade Change-Id: Ideb0e20ebe09945f221cc31560922aae9e375dde --- .../src/test/java/org/onap/cvc/csar/CSARArchiveTest.java | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'csarvalidation/src/test') diff --git a/csarvalidation/src/test/java/org/onap/cvc/csar/CSARArchiveTest.java b/csarvalidation/src/test/java/org/onap/cvc/csar/CSARArchiveTest.java index bd9b191..2831532 100644 --- a/csarvalidation/src/test/java/org/onap/cvc/csar/CSARArchiveTest.java +++ b/csarvalidation/src/test/java/org/onap/cvc/csar/CSARArchiveTest.java @@ -21,6 +21,7 @@ import java.util.Arrays; import org.junit.Test; +import static org.junit.Assert.assertEquals; public class CSARArchiveTest { @Test @@ -42,4 +43,14 @@ public class CSARArchiveTest { } } + @Test + public void testErrorToStringForGson(){ + + String expected = "{\"code\":\"0x1001\",\"message\":\"Invalid value. Entry [testEntry]. Valid values are [-1]. InvalidEntry\",\"file\":\"abc\",\"lineNumber\":-1}"; + CSARArchive.CSARErrorInvalidEntryValue testError = + new CSARArchive.CSARErrorInvalidEntryValue("testEntry","abc","InvalidEntry","-1"); + assertEquals(expected,testError.toString()); + + } + } -- cgit 1.2.3-korg