diff options
author | Dan Timoney <dtimoney@att.com> | 2020-05-19 12:57:27 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2020-05-19 12:57:27 +0000 |
commit | 7b99a668283dd6b8d33ee2bda7a1f3c42c9822d3 (patch) | |
tree | f6617901899c5b30add5654aed711a77f003d6f9 /ms/blueprintsprocessor/modules | |
parent | 2f467eb7afcaad363ea08246ec473094a5346c9e (diff) | |
parent | a726d7aa14e0ae841ede2dbdbc1a825290bf1452 (diff) |
Merge "Add Naming Service & IP Assign custom resource resolution capability"
Diffstat (limited to 'ms/blueprintsprocessor/modules')
2 files changed, 12 insertions, 6 deletions
diff --git a/ms/blueprintsprocessor/modules/blueprints/resource-dict/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/resource/dict/utils/BulkResourceSequencingUtils.kt b/ms/blueprintsprocessor/modules/blueprints/resource-dict/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/resource/dict/utils/BulkResourceSequencingUtils.kt index 9a5523113..422f65157 100644 --- a/ms/blueprintsprocessor/modules/blueprints/resource-dict/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/resource/dict/utils/BulkResourceSequencingUtils.kt +++ b/ms/blueprintsprocessor/modules/blueprints/resource-dict/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/resource/dict/utils/BulkResourceSequencingUtils.kt @@ -17,6 +17,7 @@ package org.onap.ccsdk.cds.controllerblueprints.resource.dict.utils import org.apache.commons.collections.CollectionUtils +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException import org.onap.ccsdk.cds.controllerblueprints.core.asListOfString import org.onap.ccsdk.cds.controllerblueprints.core.utils.TopologicalSortingUtils import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResourceAssignment @@ -51,20 +52,25 @@ object BulkResourceSequencingUtils { resourceAssignmentMap.forEach { _, resourceAssignment -> // Get the dependencies from the assignment sources, if not get from the Resource Assignment dependencies if (resourceAssignment.dictionarySourceDefinition != null) { - val dependencies = resourceAssignment.dictionarySourceDefinition?.properties?.get("key-dependencies")?.asListOfString() + val dependencies = + resourceAssignment.dictionarySourceDefinition?.properties?.get("key-dependencies")?.asListOfString() dependencies?.forEach { dependency -> topologySorting.add(resourceAssignmentMap[dependency]!!, resourceAssignment) } } else if (CollectionUtils.isNotEmpty(resourceAssignment.dependencies)) { for (dependency in resourceAssignment.dependencies!!) { - topologySorting.add(resourceAssignmentMap[dependency]!!, resourceAssignment) + val ra = resourceAssignmentMap[dependency] + ?: throw BluePrintProcessorException("Couldn't get Resource Assignment dependency " + + "Key($dependency)") + topologySorting.add(ra, resourceAssignment) } } else { topologySorting.add(startResourceAssignment, resourceAssignment) } } - val sequencedResourceAssignments: MutableList<ResourceAssignment> = topologySorting.topSort()!! as MutableList<ResourceAssignment> + val sequencedResourceAssignments: MutableList<ResourceAssignment> = + topologySorting.topSort()!! as MutableList<ResourceAssignment> log.trace("Sorted Sequenced Assignments ({})", sequencedResourceAssignments) var batchResourceAssignment: MutableList<ResourceAssignment>? = null diff --git a/ms/blueprintsprocessor/modules/commons/rest-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/service/RestClientServiceTest.kt b/ms/blueprintsprocessor/modules/commons/rest-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/service/RestClientServiceTest.kt index fa357e1fe..326031487 100644 --- a/ms/blueprintsprocessor/modules/commons/rest-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/service/RestClientServiceTest.kt +++ b/ms/blueprintsprocessor/modules/commons/rest-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/service/RestClientServiceTest.kt @@ -77,7 +77,7 @@ import kotlin.test.assertNotNull "server.ssl.keyStoreType=PKCS12", "server.ssl.keyAlias=tomcat", "blueprintsprocessor.restclient.sample.type=basic-auth", - "blueprintsprocessor.restclient.sample.url=http://127.0.0.1:8081", + "blueprintsprocessor.restclient.sample.url=http://127.0.0.1:9081", "blueprintsprocessor.restclient.sample.username=admin", "blueprintsprocessor.restclient.sample.password=jans", "blueprintsprocessor.restclient.test.type=ssl-basic-auth", @@ -104,7 +104,7 @@ class RestClientServiceTest { @Before fun start() { // Second Http server required for non-SSL requests to be processed along with the https server. - val factory: ReactiveWebServerFactory = NettyReactiveWebServerFactory(8081) + val factory: ReactiveWebServerFactory = NettyReactiveWebServerFactory(9081) this.http = factory.getWebServer(this.httpHandler) this.http.start() } @@ -144,7 +144,7 @@ class RestClientServiceTest { fun testSimpleBasicAuth() { val json: String = "{\n" + " \"type\" : \"basic-auth\",\n" + - " \"url\" : \"http://localhost:8081\",\n" + + " \"url\" : \"http://localhost:9081\",\n" + " \"username\" : \"admin\",\n" + " \"password\" : \"jans\"\n" + "}" |