From 1f9a8648b139281fdd8391949e0a54a2be2added Mon Sep 17 00:00:00 2001 From: "Muthuramalingam, Brinda Santh(bs2796)" Date: Thu, 13 Sep 2018 14:25:49 +0000 Subject: Controller Blueprints Microservice Optimise dictionary dummy data creation reusability and property usage optimisation. Change-Id: Ibbd56d514f437f29943cebc0e607becb6798e4b6 Issue-ID: CCSDK-491 Signed-off-by: Muthuramalingam, Brinda Santh(bs2796) --- .../service/enhancer/ResourceAssignmentEnhancerServiceTest.java | 8 +++----- .../service/validator/ServiceTemplateValidationTest.java | 7 +++---- 2 files changed, 6 insertions(+), 9 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/enhancer/ResourceAssignmentEnhancerServiceTest.java b/ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/service/enhancer/ResourceAssignmentEnhancerServiceTest.java index e279ec9c..a5d1e417 100644 --- a/ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/service/enhancer/ResourceAssignmentEnhancerServiceTest.java +++ b/ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/service/enhancer/ResourceAssignmentEnhancerServiceTest.java @@ -26,9 +26,9 @@ import org.onap.ccsdk.apps.controllerblueprints.core.data.ServiceTemplate; import org.onap.ccsdk.apps.controllerblueprints.core.utils.JacksonReactorUtils; import org.onap.ccsdk.apps.controllerblueprints.core.utils.JacksonUtils; import org.onap.ccsdk.apps.controllerblueprints.resource.dict.ResourceAssignment; -import org.onap.ccsdk.apps.controllerblueprints.resource.dict.factory.ResourceSourceMappingFactory; import org.onap.ccsdk.apps.controllerblueprints.resource.dict.service.ResourceDefinitionFileRepoService; import org.onap.ccsdk.apps.controllerblueprints.resource.dict.service.ResourceDefinitionRepoService; +import org.onap.ccsdk.apps.controllerblueprints.resource.dict.utils.ResourceDictionaryTestUtils; import java.util.List; @@ -42,10 +42,8 @@ public class ResourceAssignmentEnhancerServiceTest { @Before public void setUp(){ - ResourceSourceMappingFactory.INSTANCE.registerSourceMapping("db", "source-db"); - ResourceSourceMappingFactory.INSTANCE.registerSourceMapping("input", "source-input"); - ResourceSourceMappingFactory.INSTANCE.registerSourceMapping("default", "source-default"); - ResourceSourceMappingFactory.INSTANCE.registerSourceMapping("mdsal", "source-rest"); + // Setup dummy Source Instance Mapping + ResourceDictionaryTestUtils.setUpResourceSourceMapping(); } @Test diff --git a/ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/service/validator/ServiceTemplateValidationTest.java b/ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/service/validator/ServiceTemplateValidationTest.java index 5f34b551..26fb1d32 100644 --- a/ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/service/validator/ServiceTemplateValidationTest.java +++ b/ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/service/validator/ServiceTemplateValidationTest.java @@ -24,6 +24,7 @@ import org.junit.Test; import org.onap.ccsdk.apps.controllerblueprints.core.data.ServiceTemplate; import org.onap.ccsdk.apps.controllerblueprints.core.utils.JacksonUtils; import org.onap.ccsdk.apps.controllerblueprints.resource.dict.factory.ResourceSourceMappingFactory; +import org.onap.ccsdk.apps.controllerblueprints.resource.dict.utils.ResourceDictionaryTestUtils; import org.onap.ccsdk.apps.controllerblueprints.service.utils.ConfigModelUtils; import com.att.eelf.configuration.EELFLogger; import com.att.eelf.configuration.EELFManager; @@ -37,10 +38,8 @@ public class ServiceTemplateValidationTest { @Before public void setUp(){ - ResourceSourceMappingFactory.INSTANCE.registerSourceMapping("db", "source-db"); - ResourceSourceMappingFactory.INSTANCE.registerSourceMapping("input", "source-input"); - ResourceSourceMappingFactory.INSTANCE.registerSourceMapping("default", "source-default"); - ResourceSourceMappingFactory.INSTANCE.registerSourceMapping("mdsal", "source-rest"); + // Setup dummy Source Instance Mapping + ResourceDictionaryTestUtils.setUpResourceSourceMapping(); } @Test -- cgit 1.2.3-korg