summaryrefslogtreecommitdiffstats
path: root/csarvalidation/src/test
diff options
context:
space:
mode:
authorpriyanka.akhade <priyanka.akhade@huawei.com>2020-03-13 10:52:03 +0000
committerpriyanka.akhade <priyanka.akhade@huawei.com>2020-03-13 10:52:03 +0000
commit471d10938b8886d695bd9c50b88ad210a61b5a8c (patch)
treeee44ea20e32928f26fa4e1a071f3e36254f82f22 /csarvalidation/src/test
parent222fe26ea3926a08f3797ebc50cb958fe756683f (diff)
Migrate to gson
Issue-ID: VNFSDK-553 Signed-off-by: priyanka.akhade <priyanka.akhade@huawei.com> Change-Id: Ideb0e20ebe09945f221cc31560922aae9e375dde
Diffstat (limited to 'csarvalidation/src/test')
-rw-r--r--csarvalidation/src/test/java/org/onap/cvc/csar/CSARArchiveTest.java11
1 files changed, 11 insertions, 0 deletions
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());
+
+ }
+
}