summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore4
-rw-r--r--src/main/java/org/onap/music/datastore/jsonobjects/JsonInsert.java5
-rw-r--r--src/test/java/org/onap/music/unittests/jsonobjects/JsonInsertTest.java23
3 files changed, 27 insertions, 5 deletions
diff --git a/.gitignore b/.gitignore
index 0631baac..3af6f43f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -15,7 +15,11 @@ src/main/webapp
.DS_Store
._*
+# Ignore jars
+**/*.jar
*.jar
+
+
.metadata
# Eclipse stuff
.settings/
diff --git a/src/main/java/org/onap/music/datastore/jsonobjects/JsonInsert.java b/src/main/java/org/onap/music/datastore/jsonobjects/JsonInsert.java
index 4533f947..09cd65dc 100644
--- a/src/main/java/org/onap/music/datastore/jsonobjects/JsonInsert.java
+++ b/src/main/java/org/onap/music/datastore/jsonobjects/JsonInsert.java
@@ -43,6 +43,7 @@ import org.onap.music.eelf.logging.format.ErrorTypes;
@ApiModel(value = "JsonTable", description = "Json model for table vlaues insert")
@JsonIgnoreProperties(ignoreUnknown = true)
public class JsonInsert implements Serializable {
+ private static final long serialVersionUID = 1L;
private String keyspaceName;
private String tableName;
private transient Map<String, Object> values;
@@ -117,11 +118,11 @@ public class JsonInsert implements Serializable {
}
@ApiModelProperty(value = "Information for selecting specific rows for insert")
- public Map<String, Object> getRow_specification() {
+ public Map<String, Object> getRowSpecification() {
return rowSpecification;
}
- public void setRow_specification(Map<String, Object> rowSpecification) {
+ public void setRowSpecification(Map<String, Object> rowSpecification) {
this.rowSpecification = rowSpecification;
}
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);
}
+
}