summaryrefslogtreecommitdiffstats
path: root/src/test
diff options
context:
space:
mode:
authorBrendan Tschaen <ctschaen@att.com>2019-05-17 14:49:51 +0000
committerGerrit Code Review <gerrit@onap.org>2019-05-17 14:49:51 +0000
commit641255c612fae09ff8840124eb7dcf5046083dd0 (patch)
tree2acc6d3a9401646cf256989ebe6e358ea348f514 /src/test
parent66aac8e2b8f61f075b285f969c1f8a88fdb313bd (diff)
parentb426a6e832df4db4a57c0d271559fd0b0926e02d (diff)
Merge "Update junit test"
Diffstat (limited to 'src/test')
-rw-r--r--src/test/java/org/onap/music/unittests/jsonobjects/JsonInsertTest.java23
1 files changed, 20 insertions, 3 deletions
diff --git a/src/test/java/org/onap/music/unittests/jsonobjects/JsonInsertTest.java b/src/test/java/org/onap/music/unittests/jsonobjects/JsonInsertTest.java
index 69403cc7..535cdd84 100644
--- a/src/test/java/org/onap/music/unittests/jsonobjects/JsonInsertTest.java
+++ b/src/test/java/org/onap/music/unittests/jsonobjects/JsonInsertTest.java
@@ -23,8 +23,12 @@
package org.onap.music.unittests.jsonobjects;
import static org.junit.Assert.*;
+
+import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
+
+import org.apache.commons.lang3.SerializationUtils;
import org.junit.Test;
import org.onap.music.datastore.jsonobjects.JsonInsert;
@@ -74,13 +78,26 @@ public class JsonInsertTest {
}
@Test
- public void testGetRow_specification() {
+ public void testGetRowSpecification() {
+ Map<String,Object> cons = new HashMap<>();
+ cons.put("val1","one");
+ cons.put("val2","two");
+ ji.setRowSpecification(cons);
+ assertEquals("two",ji.getRowSpecification().get("val2"));
+ }
+
+ @Test
+ public void testSerialize() {
Map<String,Object> cons = new HashMap<>();
cons.put("val1","one");
cons.put("val2","two");
- ji.setRow_specification(cons);
- assertEquals("two",ji.getRow_specification().get("val2"));
+ ji.setTimestamp("10:30");
+ ji.setRowSpecification(cons);
+ byte[] test1 = ji.serialize();
+ byte[] ji1 = SerializationUtils.serialize(ji);
+ assertArrayEquals(ji1,test1);
}
+
}