diff options
author | Singal, Kapil (ks220y) <ks220y@att.com> | 2019-01-11 13:58:38 -0500 |
---|---|---|
committer | KAPIL SINGAL <ks220y@att.com> | 2019-01-11 20:39:43 +0000 |
commit | d035fe08249fe8b1e5988b79c7355620727e5da0 (patch) | |
tree | e71cec98ba6790f5982ac124a6a06700c347e76d /components/resource-dict/src/test | |
parent | 5916e79bab772cc79765b0d8fedbc2de38e4ff4b (diff) |
Resource Resolution Service : 2
Changes for Primary-DB Resource Resolution Processor Service
Change-Id: Iaf6ad6277d36787d87881819ae530de1d7038a2e
Issue-ID: CCSDK-942
Signed-off-by: Singal, Kapil (ks220y) <ks220y@att.com>
Diffstat (limited to 'components/resource-dict/src/test')
7 files changed, 40 insertions, 10 deletions
diff --git a/components/resource-dict/src/test/java/org/onap/ccsdk/apps/controllerblueprints/resource/dict/ResourceDefinitionTest.java b/components/resource-dict/src/test/java/org/onap/ccsdk/apps/controllerblueprints/resource/dict/ResourceDefinitionTest.java index cb39200f..1ed306e2 100644 --- a/components/resource-dict/src/test/java/org/onap/ccsdk/apps/controllerblueprints/resource/dict/ResourceDefinitionTest.java +++ b/components/resource-dict/src/test/java/org/onap/ccsdk/apps/controllerblueprints/resource/dict/ResourceDefinitionTest.java @@ -46,9 +46,9 @@ public class ResourceDefinitionTest { @Test
public void testDictionaryDefinitionDBSource(){
- String fileName = basePath + "/db-source.json";
+ String fileName = basePath + "/primary-db-source.json";
ResourceDefinition resourceDefinition = JacksonUtils.Companion.readValueFromFile(fileName, ResourceDefinition.class);
- Assert.assertNotNull("Failed to populate dictionaryDefinition for db type", resourceDefinition);
+ Assert.assertNotNull("Failed to populate dictionaryDefinition for primary-db type", resourceDefinition);
}
@Test
diff --git a/components/resource-dict/src/test/java/org/onap/ccsdk/apps/controllerblueprints/resource/dict/factory/ResourceSourceMappingFactoryTest.java b/components/resource-dict/src/test/java/org/onap/ccsdk/apps/controllerblueprints/resource/dict/factory/ResourceSourceMappingFactoryTest.java index b67aa799..3f5aef43 100644 --- a/components/resource-dict/src/test/java/org/onap/ccsdk/apps/controllerblueprints/resource/dict/factory/ResourceSourceMappingFactoryTest.java +++ b/components/resource-dict/src/test/java/org/onap/ccsdk/apps/controllerblueprints/resource/dict/factory/ResourceSourceMappingFactoryTest.java @@ -25,13 +25,13 @@ public class ResourceSourceMappingFactoryTest { @Test
public void testRegisterResourceMapping() {
- ResourceSourceMappingFactory.INSTANCE.registerSourceMapping("db", "source-db");
+ ResourceSourceMappingFactory.INSTANCE.registerSourceMapping("primary-db", "source-primary-db");
ResourceSourceMappingFactory.INSTANCE.registerSourceMapping("input", "source-input");
ResourceSourceMappingFactory.INSTANCE.registerSourceMapping("default", "source-default");
ResourceSourceMappingFactory.INSTANCE.registerSourceMapping("mdsal", "source-rest");
- String nodeTypeName = ResourceSourceMappingFactory.INSTANCE.getRegisterSourceMapping("db");
- Assert.notNull(nodeTypeName, "Failed to get db mapping");
+ String nodeTypeName = ResourceSourceMappingFactory.INSTANCE.getRegisterSourceMapping("primary-db");
+ Assert.notNull(nodeTypeName, "Failed to get primary-db mapping");
ResourceSourceMapping resourceSourceMapping = ResourceSourceMappingFactory.INSTANCE.getRegisterSourceMapping();
Assert.notNull(resourceSourceMapping, "Failed to get resource source mapping");
diff --git a/components/resource-dict/src/test/java/org/onap/ccsdk/apps/controllerblueprints/resource/dict/service/ResourceDefinitionValidationServiceTest.java b/components/resource-dict/src/test/java/org/onap/ccsdk/apps/controllerblueprints/resource/dict/service/ResourceDefinitionValidationServiceTest.java index f5c3567f..7f040b2e 100644 --- a/components/resource-dict/src/test/java/org/onap/ccsdk/apps/controllerblueprints/resource/dict/service/ResourceDefinitionValidationServiceTest.java +++ b/components/resource-dict/src/test/java/org/onap/ccsdk/apps/controllerblueprints/resource/dict/service/ResourceDefinitionValidationServiceTest.java @@ -30,10 +30,10 @@ public class ResourceDefinitionValidationServiceTest { @Test public void testValidateSource() throws Exception { - String inputFileName = dictionaryPath + "/db-source.json"; + String inputFileName = dictionaryPath + "/input-source.json"; testValidate(inputFileName); - String dbFileName = dictionaryPath + "/db-source.json"; + String dbFileName = dictionaryPath + "/primary-db-source.json"; testValidate(dbFileName); String defaultFileName = dictionaryPath + "/default-source.json"; diff --git a/components/resource-dict/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/resource/dict/utils/ResourceDictionaryTestUtils.kt b/components/resource-dict/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/resource/dict/utils/ResourceDictionaryTestUtils.kt new file mode 100644 index 00000000..50e5c329 --- /dev/null +++ b/components/resource-dict/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/resource/dict/utils/ResourceDictionaryTestUtils.kt @@ -0,0 +1,30 @@ +/*
+ * Copyright © 2017-2018 AT&T Intellectual Property.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onap.ccsdk.apps.controllerblueprints.resource.dict.utils
+
+import org.onap.ccsdk.apps.controllerblueprints.resource.dict.factory.ResourceSourceMappingFactory
+
+object ResourceDictionaryTestUtils {
+
+ @JvmStatic
+ fun setUpResourceSourceMapping() {
+ ResourceSourceMappingFactory.registerSourceMapping("primary-db", "source-primary-db")
+ ResourceSourceMappingFactory.registerSourceMapping("input", "source-input")
+ ResourceSourceMappingFactory.registerSourceMapping("default", "source-default")
+ ResourceSourceMappingFactory.registerSourceMapping("mdsal", "source-rest")
+ }
+}
\ No newline at end of file diff --git a/components/resource-dict/src/test/resources/validation/cyclic.json b/components/resource-dict/src/test/resources/validation/cyclic.json index d837dc5d..7e6472f5 100644 --- a/components/resource-dict/src/test/resources/validation/cyclic.json +++ b/components/resource-dict/src/test/resources/validation/cyclic.json @@ -102,7 +102,7 @@ "type": "string"
},
"dictionary-name": "loopback-ip",
- "dictionary-source": "db",
+ "dictionary-source": "primary-db",
"dependencies": [
"bundle-mac",
"managed-ip1"
diff --git a/components/resource-dict/src/test/resources/validation/duplicate.json b/components/resource-dict/src/test/resources/validation/duplicate.json index 330324cd..28ab71fc 100644 --- a/components/resource-dict/src/test/resources/validation/duplicate.json +++ b/components/resource-dict/src/test/resources/validation/duplicate.json @@ -102,7 +102,7 @@ "type": "string"
},
"dictionary-name": "loopback-ip",
- "dictionary-source": "db",
+ "dictionary-source": "primary-db",
"dependencies": [
"bundle-mac"
]
diff --git a/components/resource-dict/src/test/resources/validation/success.json b/components/resource-dict/src/test/resources/validation/success.json index 3215d06d..5d0e8980 100644 --- a/components/resource-dict/src/test/resources/validation/success.json +++ b/components/resource-dict/src/test/resources/validation/success.json @@ -102,7 +102,7 @@ "type": "string"
},
"dictionary-name": "loopback-ip",
- "dictionary-source": "db",
+ "dictionary-source": "primary-db",
"dependencies": [
"bundle-mac"
]
|