From a1140e2490ae560b3f85e8e2a4e424badaae1c48 Mon Sep 17 00:00:00 2001 From: "Muthuramalingam, Brinda Santh(bs2796)" Date: Wed, 5 Sep 2018 17:42:22 +0000 Subject: Controller Blueprints Microservice Modify Model Type and Resource Defintions persistance and access from String to JSON type for easy handling. Change-Id: Icfe7e95abad715b0ccad16c681ed057d289a6229 Issue-ID: CCSDK-431 Signed-off-by: Muthuramalingam, Brinda Santh(bs2796) --- .../ccsdk/apps/controllerblueprints/service/rs/ModelTypeRestTest.java | 3 ++- .../controllerblueprints/service/rs/ResourceDictionaryRestTest.java | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'ms/controllerblueprints/modules/service/src/test') diff --git a/ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/service/rs/ModelTypeRestTest.java b/ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/service/rs/ModelTypeRestTest.java index 8e88f0a69..c28abe2d3 100644 --- a/ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/service/rs/ModelTypeRestTest.java +++ b/ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/service/rs/ModelTypeRestTest.java @@ -22,6 +22,7 @@ import org.junit.runner.RunWith; import org.junit.runners.MethodSorters; import org.onap.ccsdk.apps.controllerblueprints.TestApplication; import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintConstants; +import org.onap.ccsdk.apps.controllerblueprints.core.utils.JacksonUtils; import org.onap.ccsdk.apps.controllerblueprints.service.domain.ModelType; import com.att.eelf.configuration.EELFLogger; import com.att.eelf.configuration.EELFManager; @@ -64,7 +65,7 @@ public class ModelTypeRestTest { modelType.setDefinitionType(BluePrintConstants.MODEL_DEFINITION_TYPE_DATA_TYPE); modelType.setDerivedFrom(BluePrintConstants.MODEL_TYPE_DATATYPES_ROOT); modelType.setDescription("Definition for Sample Datatype "); - modelType.setDefinition(content); + modelType.setDefinition(JacksonUtils.jsonNode(content)); modelType.setModelName(modelName); modelType.setVersion("1.0.0"); modelType.setTags("test-datatype ," + BluePrintConstants.MODEL_TYPE_DATATYPES_ROOT + "," diff --git a/ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/service/rs/ResourceDictionaryRestTest.java b/ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/service/rs/ResourceDictionaryRestTest.java index 8bb1f0b89..82346954c 100644 --- a/ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/service/rs/ResourceDictionaryRestTest.java +++ b/ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/service/rs/ResourceDictionaryRestTest.java @@ -24,6 +24,8 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.MethodSorters; import org.onap.ccsdk.apps.controllerblueprints.TestApplication; +import org.onap.ccsdk.apps.controllerblueprints.core.utils.JacksonUtils; +import org.onap.ccsdk.apps.controllerblueprints.resource.dict.ResourceDefinition; import org.onap.ccsdk.apps.controllerblueprints.service.domain.ResourceDictionary; import com.att.eelf.configuration.EELFLogger; import com.att.eelf.configuration.EELFManager; @@ -58,7 +60,7 @@ public class ResourceDictionaryRestTest { ResourceDictionary dataDictionary = new ResourceDictionary(); dataDictionary.setResourcePath("test/vnf/ipaddress"); dataDictionary.setName("test-name"); - dataDictionary.setDefinition(definition); + dataDictionary.setDefinition(JacksonUtils.readValue(definition, ResourceDefinition.class)); dataDictionary.setValidValues("127.0.0.1"); dataDictionary.setResourceType("ONAP"); dataDictionary.setDataType("string"); -- cgit 1.2.3-korg