From d3394bba7c8e30073a1f7874fed4320be18545d0 Mon Sep 17 00:00:00 2001 From: liamfallon Date: Sun, 5 May 2019 21:26:36 +0000 Subject: Serializaiton of properties to DB as JSON Properties should be serialized to JSON prior to writing to database and deserialized from JSON when read from database. Issue-ID: POLICY-1736 Change-Id: I5ad3fd4a87079f4557f5fcb825395f0b4bec3318 Signed-off-by: liamfallon --- .../onap/policy/models/tosca/simple/concepts/JpaToscaPolicyTest.java | 2 +- .../models/tosca/simple/concepts/JpaToscaServiceTemplateTest.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'models-tosca/src/test/java/org') diff --git a/models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaPolicyTest.java b/models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaPolicyTest.java index 571cde485..ae38ab916 100644 --- a/models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaPolicyTest.java +++ b/models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaPolicyTest.java @@ -81,7 +81,7 @@ public class JpaToscaPolicyTest { JpaToscaPolicy tp = new JpaToscaPolicy(tpKey, ptKey); Map propertyMap = new HashMap<>(); - propertyMap.put("Property", "Property Value"); + propertyMap.put("Property", "\"Property Value\""); tp.setProperties(propertyMap); assertEquals(propertyMap, tp.getProperties()); diff --git a/models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaServiceTemplateTest.java b/models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaServiceTemplateTest.java index 4569d42ff..a2a418ef9 100644 --- a/models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaServiceTemplateTest.java +++ b/models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaServiceTemplateTest.java @@ -157,7 +157,7 @@ public class JpaToscaServiceTemplateTest { tst.clean(); assertEquals(tttClone0, tst); - assertFalse(new JpaToscaServiceTemplate().validate(new PfValidationResult()).isValid()); + assertTrue(new JpaToscaServiceTemplate().validate(new PfValidationResult()).isValid()); assertTrue(tst.validate(new PfValidationResult()).isValid()); tst.setDescription(null); -- cgit 1.2.3-korg