aboutsummaryrefslogtreecommitdiffstats
path: root/sdc-workflow-designer-server/src/test/java
diff options
context:
space:
mode:
authorYuanHu <yuan.hu1@zte.com.cn>2018-04-13 08:56:42 +0800
committerYuanHu <yuan.hu1@zte.com.cn>2018-04-17 14:24:17 +0800
commit84372056e279fbc8a5df3d8e0e60b3b0919e4362 (patch)
tree99f804308dd003fb62a5fc3558bf653305582460 /sdc-workflow-designer-server/src/test/java
parente789e3060b7860075820af76a71e6dfc050cc286 (diff)
Json Serialize 'clazz' to 'class'
Add @JsonProperty(value="class") to field 'clazz' to indicate the Json Serialize name. Issue-ID: SDC-1235 Change-Id: I21de7514a9d6c8f7227b25d8c8c9ecf4e9c35171 Signed-off-by: YuanHu <yuan.hu1@zte.com.cn>
Diffstat (limited to 'sdc-workflow-designer-server/src/test/java')
-rw-r--r--sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/externalservice/sdc/entity/ActivityContentTest.java6
-rw-r--r--sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/resources/entity/ContentTest.java17
2 files changed, 17 insertions, 6 deletions
diff --git a/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/externalservice/sdc/entity/ActivityContentTest.java b/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/externalservice/sdc/entity/ActivityContentTest.java
index 2ede2611..4aa2dd0f 100644
--- a/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/externalservice/sdc/entity/ActivityContentTest.java
+++ b/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/externalservice/sdc/entity/ActivityContentTest.java
@@ -39,16 +39,16 @@ public class ActivityContentTest {
*/
@Test
public void testToString() {
- String clazz = "clazz";
+// String clazz = "clazz";
String script = "script";
String scriptFormat = "scriptFormat";
ActivityContent ac = new ActivityContent();
- ac.setClazz(clazz);
+// ac.setClass(clazz);
ac.setScript(script);
ac.setScriptFormat(scriptFormat );
- assertEquals(clazz, ac.getClazz());
+// assertEquals(clazz, ac.getClazz());
assertEquals(script, ac.getScript());
assertEquals(scriptFormat, ac.getScriptFormat());
}
diff --git a/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/resources/entity/ContentTest.java b/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/resources/entity/ContentTest.java
index 58738bc0..1c6612ea 100644
--- a/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/resources/entity/ContentTest.java
+++ b/sdc-workflow-designer-server/src/test/java/org/onap/sdc/workflowdesigner/resources/entity/ContentTest.java
@@ -19,6 +19,7 @@ import java.util.Map;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
+import org.onap.sdc.workflowdesigner.utils.JsonUtils;
/**
*
@@ -39,24 +40,34 @@ public class ContentTest {
@Test
public void test() {
- String clazz = "clazz";
+// String clazz = "clazz";
String script = "script";
String scriptFormat = "scriptFormat";
Map<String, InputOutput> inputs = new HashMap<String, InputOutput>();
Map<String, InputOutput> outputs = new HashMap<String, InputOutput>();
Content c = new Content();
- c.setClass(clazz);
+// c.setClass(clazz);
c.setInputs(inputs);
c.setOutputs(outputs);
c.setScript(script);
c.setScriptFormat(scriptFormat);
- assertEquals(clazz, c.getClazz());
+// assertEquals(clazz, c.getClazz());
assertEquals(inputs, c.getInputs());
assertEquals(outputs, c.getOutputs());
assertEquals(script, c.getScript());
assertEquals(scriptFormat, c.getScriptFormat());
}
+
+ @Test
+ public void testGson() {
+ String json = "{\r\n" +
+ " \"class\": \"aaaa\",\r\n" +
+ " \"inputs\": {}\r\n" +
+ " }";
+ Content content = JsonUtils.fromJson(json, Content.class);
+ assertNotNull(content);
+ }
}