summaryrefslogtreecommitdiffstats
path: root/src/test/java
diff options
context:
space:
mode:
authorStone, Avi (as206k) <as206k@att.com>2018-04-12 15:12:44 +0300
committerStone, Avi (as206k) <as206k@att.com>2018-04-12 15:16:30 +0300
commit438bdef0d2473a4db83aac3d71d4596b223879d7 (patch)
treec6cd021d4b64d83c435ae07143ee4aa1ae0cfd6b /src/test/java
parenta5e73f1e0597834ba46754aaae4683f7acf06e47 (diff)
DCAE-D property initial commit
DCAE-D property initial commit Change-Id: I5ba79eddaa1732524e30652b679e4dd5dfed56b5 Issue-ID: SDC-1218 Signed-off-by: Stone, Avi (as206k) <as206k@att.com>
Diffstat (limited to 'src/test/java')
-rw-r--r--src/test/java/org/onap/sdc/dcae/composition/restmodels/ruleeditor/ActionDeserializerTest.java29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/test/java/org/onap/sdc/dcae/composition/restmodels/ruleeditor/ActionDeserializerTest.java b/src/test/java/org/onap/sdc/dcae/composition/restmodels/ruleeditor/ActionDeserializerTest.java
new file mode 100644
index 0000000..c98b408
--- /dev/null
+++ b/src/test/java/org/onap/sdc/dcae/composition/restmodels/ruleeditor/ActionDeserializerTest.java
@@ -0,0 +1,29 @@
+package org.onap.sdc.dcae.composition.restmodels.ruleeditor;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import org.junit.Test;
+import org.onap.sdc.dcae.composition.restmodels.ruleeditor.ActionDeserializer;
+import org.onap.sdc.dcae.composition.restmodels.ruleeditor.BaseAction;
+import org.onap.sdc.dcae.composition.restmodels.ruleeditor.MapAction;
+
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
+
+public class ActionDeserializerTest {
+
+
+ private Gson gson = new GsonBuilder().registerTypeAdapter(BaseAction.class, new ActionDeserializer()).create();
+
+ @Test
+ public void deserializerTest(){
+ BaseAction action = new BaseAction();
+ action.setActionType("map");
+ String input = gson.toJson(action);
+ BaseAction res = gson.fromJson(input, BaseAction.class);
+ assertEquals(gson.toJson(res), input);
+ assertTrue(res instanceof MapAction);
+ }
+
+} \ No newline at end of file