From 12e91a2cad984eb491a3083139db80b10d544f30 Mon Sep 17 00:00:00 2001
From: vinal patel <vinal.narendrabhai.patel@ibm.com>
Date: Wed, 20 Feb 2019 16:02:44 -0500
Subject: Ressource resolution using configurable database

Change-Id: I40338a221884d6f4df4c8a7dc3dac1f58f142074
Issue-ID: CCSDK-1092
Signed-off-by: vinal patel <vinal.narendrabhai.patel@ibm.com>
---
 .../resource/dict/ResourceDictionaryConstants.kt                    | 2 ++
 .../resource/dict/utils/ResourceDictionaryUtilsTest.java            | 6 +++---
 .../modules/service/src/test/resources/application.properties       | 2 +-
 3 files changed, 6 insertions(+), 4 deletions(-)

(limited to 'ms/controllerblueprints/modules')

diff --git a/ms/controllerblueprints/modules/resource-dict/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/resource/dict/ResourceDictionaryConstants.kt b/ms/controllerblueprints/modules/resource-dict/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/resource/dict/ResourceDictionaryConstants.kt
index d33a2f04..75368684 100644
--- a/ms/controllerblueprints/modules/resource-dict/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/resource/dict/ResourceDictionaryConstants.kt
+++ b/ms/controllerblueprints/modules/resource-dict/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/resource/dict/ResourceDictionaryConstants.kt
@@ -24,6 +24,8 @@ package org.onap.ccsdk.apps.controllerblueprints.resource.dict
 object ResourceDictionaryConstants {
     const val SOURCE_INPUT = "input"
     const val SOURCE_DEFAULT = "default"
+    //const val SOURCE_PRIMARY_CONFIG_DATA = "rest"
+    const val SOURCE_PROCESSOR_DB = "processor-db"
     const val SOURCE_PRIMARY_CONFIG_DATA = "primary-config-data"
     const val SOURCE_PRIMARY_DB = "primary-db"
 
diff --git a/ms/controllerblueprints/modules/resource-dict/src/test/java/org/onap/ccsdk/apps/controllerblueprints/resource/dict/utils/ResourceDictionaryUtilsTest.java b/ms/controllerblueprints/modules/resource-dict/src/test/java/org/onap/ccsdk/apps/controllerblueprints/resource/dict/utils/ResourceDictionaryUtilsTest.java
index e4ddac13..45fc739d 100644
--- a/ms/controllerblueprints/modules/resource-dict/src/test/java/org/onap/ccsdk/apps/controllerblueprints/resource/dict/utils/ResourceDictionaryUtilsTest.java
+++ b/ms/controllerblueprints/modules/resource-dict/src/test/java/org/onap/ccsdk/apps/controllerblueprints/resource/dict/utils/ResourceDictionaryUtilsTest.java
@@ -59,9 +59,9 @@ public class ResourceDictionaryUtilsTest {
         Assert.assertEquals("Expected First source Default, but.", ResourceDictionaryConstants.SOURCE_DEFAULT, resourceAssignment.getDictionarySource());
 
         // To Check Assigned Source
-        resourceAssignment.setDictionarySource(ResourceDictionaryConstants.SOURCE_PRIMARY_DB);
+        resourceAssignment.setDictionarySource(ResourceDictionaryConstants.SOURCE_PROCESSOR_DB);
         ResourceDictionaryUtils.populateSourceMapping(resourceAssignment, resourceDefinition);
-        Assert.assertEquals("Expected Assigned source DB, but.", ResourceDictionaryConstants.SOURCE_PRIMARY_DB, resourceAssignment.getDictionarySource());
+        Assert.assertEquals("Expected Assigned source DB, but.", ResourceDictionaryConstants.SOURCE_PROCESSOR_DB, resourceAssignment.getDictionarySource());
 
     }
 
@@ -78,7 +78,7 @@ public class ResourceDictionaryUtilsTest {
         Assert.assertEquals("Expected source Input, but.", ResourceDictionaryConstants.SOURCE_INPUT, inputFirstSource);
 
         // TO check the multiple Source
-        sources.put(ResourceDictionaryConstants.SOURCE_PRIMARY_DB, new NodeTemplate());
+        sources.put(ResourceDictionaryConstants.SOURCE_PROCESSOR_DB, new NodeTemplate());
         String multipleFirstSource = ResourceDictionaryUtils.findFirstSource(sources);
         Assert.assertEquals("Expected source Input, but.", ResourceDictionaryConstants.SOURCE_INPUT, multipleFirstSource);
 
diff --git a/ms/controllerblueprints/modules/service/src/test/resources/application.properties b/ms/controllerblueprints/modules/service/src/test/resources/application.properties
index 20450f44..011bad32 100755
--- a/ms/controllerblueprints/modules/service/src/test/resources/application.properties
+++ b/ms/controllerblueprints/modules/service/src/test/resources/application.properties
@@ -20,7 +20,7 @@ logging.level.org.springframework.web=INFO
 logging.level.org.hibernate.SQL=warn
 logging.level.org.hibernate.type.descriptor.sql=debug
 # Load Resource Source Mappings
-resourceSourceMappings=primary-db=source-primary-db,input=source-input,default=source-default,primary-config-data=source-rest,capability=source-capability
+resourceSourceMappings=processor-db=source-processor-db,input=source-input,default=source-default,primary-config-data=source-rest,capability=source-capability
 # Controller Blueprints Core Configuration
 controllerblueprints.blueprintDeployPath=./target/blueprints/deploy
 controllerblueprints.blueprintArchivePath=./target/blueprints/archive
-- 
cgit 1.2.3-korg