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 | 32e90cd22a5e2fb21ca369102dfa063f2db9e93f (patch) | |
tree | 7ca5eb8e3d010e48f1a681456117700e83b3ffd9 /components/resource-dict/src/test | |
parent | bf19a3a88eac9220051453180614edb4d146a134 (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 cb39200f3..1ed306e21 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 b67aa7998..3f5aef43d 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 f5c3567fa..7f040b2e2 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 000000000..50e5c3290 --- /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 d837dc5d8..7e6472f5a 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 330324cda..28ab71fca 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 3215d06d7..5d0e89805 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"
]
|