From ec92866fa0bc8d8cd7a6ce4d5d5fd014d8eacef1 Mon Sep 17 00:00:00 2001 From: "Muthuramalingam, Brinda Santh(bs2796)" Date: Thu, 15 Nov 2018 08:36:28 -0500 Subject: Blueprints Processor Microservice Refactor functon module as seperate module project. Change-Id: I392fc62e6dfb6c5f38f478c00e46460d5084f85c Issue-ID: CCSDK-688 Signed-off-by: Muthuramalingam, Brinda Santh(bs2796) --- components/parent/pom.xml | 5 +- ms/blueprintsprocessor/application/pom.xml | 1 + .../BlueprintProcessorApplication.java | 3 +- .../src/test/resources/logback-test.xml | 35 +++++++++ ms/blueprintsprocessor/functions/pom.xml | 63 ++++++++++++++++ .../functions/resource-resolution/pom.xml | 31 ++++++++ .../resolution/ResourceResolutionComponent.kt | 39 ++++++++++ .../resolution/ResourceResolutionService.kt | 79 +++++++++++++++++++ .../DefaultResourceAssignmentProcessor.kt | 49 ++++++++++++ .../processor/InputResourceAssignmentProcessor.kt | 49 ++++++++++++ .../processor/MDSALResourceAssignmentProcessor.kt | 48 ++++++++++++ .../processor/SdncResourceAssignmentProcessor.kt | 50 ++++++++++++ .../resolution/ResourceResolutionServiceTest.java | 88 ++++++++++++++++++++++ .../src/test/resources/mapping/db/db-array.json | 35 +++++++++ .../src/test/resources/mapping/db/db-complex.json | 27 +++++++ .../src/test/resources/mapping/db/db-simple.json | 26 +++++++ .../src/test/resources/mapping/db/dt-location.json | 15 ++++ .../mapping/db/resource-assignments-simple.json | 22 ++++++ .../src/test/resources/payload/inputs/input.json | 18 +++++ .../sample-resourceresolution-request.json | 22 ++++++ .../modules/commons/core/pom.xml | 42 +++++------ ms/blueprintsprocessor/modules/commons/pom.xml | 12 +-- ms/blueprintsprocessor/modules/inbounds/pom.xml | 9 +-- ms/blueprintsprocessor/modules/pom.xml | 62 +++++---------- .../modules/services/execution-service/pom.xml | 32 +++++++- ms/blueprintsprocessor/modules/services/pom.xml | 8 -- .../modules/services/resolution-service/pom.xml | 36 --------- .../resolution/ResourceResolutionComponent.kt | 39 ---------- .../resolution/ResourceResolutionService.kt | 79 ------------------- .../DefaultResourceAssignmentProcessor.kt | 49 ------------ .../processor/InputResourceAssignmentProcessor.kt | 49 ------------ .../processor/MDSALResourceAssignmentProcessor.kt | 48 ------------ .../processor/SdncResourceAssignmentProcessor.kt | 50 ------------ .../resolution/ResourceResolutionServiceTest.java | 88 ---------------------- .../src/test/resources/mapping/db/db-array.json | 35 --------- .../src/test/resources/mapping/db/db-complex.json | 27 ------- .../src/test/resources/mapping/db/db-simple.json | 26 ------- .../src/test/resources/mapping/db/dt-location.json | 15 ---- .../mapping/db/resource-assignments-simple.json | 22 ------ .../src/test/resources/payload/inputs/input.json | 18 ----- .../sample-resourceresolution-request.json | 22 ------ .../modules/services/workflow-service/pom.xml | 21 ++++++ .../src/test/resources/logback.xml | 35 +++++++++ ms/blueprintsprocessor/parent/pom.xml | 79 +++++++++++++++---- ms/blueprintsprocessor/pom.xml | 1 + ms/controllerblueprints/parent/pom.xml | 7 +- 46 files changed, 902 insertions(+), 714 deletions(-) create mode 100644 ms/blueprintsprocessor/application/src/test/resources/logback-test.xml create mode 100644 ms/blueprintsprocessor/functions/pom.xml create mode 100644 ms/blueprintsprocessor/functions/resource-resolution/pom.xml create mode 100644 ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/services/resolution/ResourceResolutionComponent.kt create mode 100644 ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/services/resolution/ResourceResolutionService.kt create mode 100644 ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/services/resolution/processor/DefaultResourceAssignmentProcessor.kt create mode 100644 ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/services/resolution/processor/InputResourceAssignmentProcessor.kt create mode 100644 ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/services/resolution/processor/MDSALResourceAssignmentProcessor.kt create mode 100644 ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/services/resolution/processor/SdncResourceAssignmentProcessor.kt create mode 100644 ms/blueprintsprocessor/functions/resource-resolution/src/test/java/org/onap/ccsdk/apps/blueprintsprocessor/services/resolution/ResourceResolutionServiceTest.java create mode 100644 ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/mapping/db/db-array.json create mode 100644 ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/mapping/db/db-complex.json create mode 100644 ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/mapping/db/db-simple.json create mode 100644 ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/mapping/db/dt-location.json create mode 100644 ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/mapping/db/resource-assignments-simple.json create mode 100644 ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/payload/inputs/input.json create mode 100644 ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/payload/requests/sample-resourceresolution-request.json delete mode 100644 ms/blueprintsprocessor/modules/services/resolution-service/pom.xml delete mode 100644 ms/blueprintsprocessor/modules/services/resolution-service/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/services/resolution/ResourceResolutionComponent.kt delete mode 100644 ms/blueprintsprocessor/modules/services/resolution-service/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/services/resolution/ResourceResolutionService.kt delete mode 100644 ms/blueprintsprocessor/modules/services/resolution-service/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/services/resolution/processor/DefaultResourceAssignmentProcessor.kt delete mode 100644 ms/blueprintsprocessor/modules/services/resolution-service/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/services/resolution/processor/InputResourceAssignmentProcessor.kt delete mode 100644 ms/blueprintsprocessor/modules/services/resolution-service/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/services/resolution/processor/MDSALResourceAssignmentProcessor.kt delete mode 100644 ms/blueprintsprocessor/modules/services/resolution-service/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/services/resolution/processor/SdncResourceAssignmentProcessor.kt delete mode 100644 ms/blueprintsprocessor/modules/services/resolution-service/src/test/java/org/onap/ccsdk/apps/blueprintsprocessor/services/resolution/ResourceResolutionServiceTest.java delete mode 100644 ms/blueprintsprocessor/modules/services/resolution-service/src/test/resources/mapping/db/db-array.json delete mode 100644 ms/blueprintsprocessor/modules/services/resolution-service/src/test/resources/mapping/db/db-complex.json delete mode 100644 ms/blueprintsprocessor/modules/services/resolution-service/src/test/resources/mapping/db/db-simple.json delete mode 100644 ms/blueprintsprocessor/modules/services/resolution-service/src/test/resources/mapping/db/dt-location.json delete mode 100644 ms/blueprintsprocessor/modules/services/resolution-service/src/test/resources/mapping/db/resource-assignments-simple.json delete mode 100644 ms/blueprintsprocessor/modules/services/resolution-service/src/test/resources/payload/inputs/input.json delete mode 100644 ms/blueprintsprocessor/modules/services/resolution-service/src/test/resources/payload/requests/sample-resourceresolution-request.json create mode 100644 ms/blueprintsprocessor/modules/services/workflow-service/src/test/resources/logback.xml diff --git a/components/parent/pom.xml b/components/parent/pom.xml index 7308e9d2..71310f1e 100644 --- a/components/parent/pom.xml +++ b/components/parent/pom.xml @@ -31,7 +31,8 @@ 2.0.6.RELEASE 5.0.10.RELEASE - 1.3.0 + 1.3.10 + 1.3.0 1.0.1 1.0.0 26.0-jre @@ -234,7 +235,7 @@ kotlin-maven-plugin org.jetbrains.kotlin - ${kotlin.version} + ${kotlin.maven.version} compile diff --git a/ms/blueprintsprocessor/application/pom.xml b/ms/blueprintsprocessor/application/pom.xml index 0fe62e9e..086a9883 100644 --- a/ms/blueprintsprocessor/application/pom.xml +++ b/ms/blueprintsprocessor/application/pom.xml @@ -40,6 +40,7 @@ org.springframework.boot spring-boot-starter-web + org.onap.ccsdk.apps.blueprintsprocessor resource-api diff --git a/ms/blueprintsprocessor/application/src/main/java/org/onap/ccsdk/apps/blueprintsprocessor/BlueprintProcessorApplication.java b/ms/blueprintsprocessor/application/src/main/java/org/onap/ccsdk/apps/blueprintsprocessor/BlueprintProcessorApplication.java index 2a13f929..241d920a 100644 --- a/ms/blueprintsprocessor/application/src/main/java/org/onap/ccsdk/apps/blueprintsprocessor/BlueprintProcessorApplication.java +++ b/ms/blueprintsprocessor/application/src/main/java/org/onap/ccsdk/apps/blueprintsprocessor/BlueprintProcessorApplication.java @@ -19,6 +19,7 @@ package org.onap.ccsdk.apps.blueprintsprocessor; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; import org.springframework.context.annotation.ComponentScan; import org.springframework.web.reactive.config.EnableWebFlux; @@ -28,7 +29,7 @@ import org.springframework.web.reactive.config.EnableWebFlux; * @author Brinda Santh 8/14/2018 */ @SpringBootApplication -@EnableAutoConfiguration +@EnableAutoConfiguration(exclude = {DataSourceAutoConfiguration.class}) @EnableWebFlux @ComponentScan(basePackages = {"org.onap.ccsdk.apps.controllerblueprints", "org.onap.ccsdk.apps.blueprintsprocessor"}) diff --git a/ms/blueprintsprocessor/application/src/test/resources/logback-test.xml b/ms/blueprintsprocessor/application/src/test/resources/logback-test.xml new file mode 100644 index 00000000..a816a06c --- /dev/null +++ b/ms/blueprintsprocessor/application/src/test/resources/logback-test.xml @@ -0,0 +1,35 @@ + + + + + + + %d{HH:mm:ss.SSS} %-5level %logger{100} - %msg%n + + + + + + + + + + + + + diff --git a/ms/blueprintsprocessor/functions/pom.xml b/ms/blueprintsprocessor/functions/pom.xml new file mode 100644 index 00000000..50ea7b0e --- /dev/null +++ b/ms/blueprintsprocessor/functions/pom.xml @@ -0,0 +1,63 @@ + + + + + + org.onap.ccsdk.apps.blueprintsprocessor + parent + 0.4.0-SNAPSHOT + ../parent + + 4.0.0 + pom + functions + Blueprints Processor Functions POM + Blueprints Processor Functions POM + + resource-resolution + + + + + org.onap.ccsdk.apps.blueprintsprocessor + execution-service + + + + org.powermock + powermock-api-mockito2 + test + + + org.springframework.boot + spring-boot-starter-test + test + + + org.jetbrains.kotlin + kotlin-test-junit + test + + + io.projectreactor + reactor-test + test + + + \ No newline at end of file diff --git a/ms/blueprintsprocessor/functions/resource-resolution/pom.xml b/ms/blueprintsprocessor/functions/resource-resolution/pom.xml new file mode 100644 index 00000000..a2d3bb85 --- /dev/null +++ b/ms/blueprintsprocessor/functions/resource-resolution/pom.xml @@ -0,0 +1,31 @@ + + + + 4.0.0 + + org.onap.ccsdk.apps.blueprintsprocessor + functions + 0.4.0-SNAPSHOT + + org.onap.ccsdk.apps.blueprintsprocessor.functions + resource-resolution + jar + Blueprints Processor Resolution Service + Blueprints Processor Resolution Service + + diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/services/resolution/ResourceResolutionComponent.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/services/resolution/ResourceResolutionComponent.kt new file mode 100644 index 00000000..ff1a01d5 --- /dev/null +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/services/resolution/ResourceResolutionComponent.kt @@ -0,0 +1,39 @@ +/* + * 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.blueprintsprocessor.services.resolution + +import org.onap.ccsdk.apps.blueprintsprocessor.core.factory.ComponentNode +import org.springframework.stereotype.Component + +@Component("component-resource-resolution") +open class ResourceResolutionComponent : ComponentNode { + override fun validate(context: MutableMap, componentContext: MutableMap) { + TODO("not implemented") //To change body of created functions use File | Settings | File Templates. + } + + override fun process(context: MutableMap, componentContext: MutableMap) { + TODO("not implemented") //To change body of created functions use File | Settings | File Templates. + } + + override fun errorHandle(context: MutableMap, componentContext: MutableMap) { + TODO("not implemented") //To change body of created functions use File | Settings | File Templates. + } + + override fun reTrigger(context: MutableMap, componentContext: MutableMap) { + TODO("not implemented") //To change body of created functions use File | Settings | File Templates. + } +} \ No newline at end of file diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/services/resolution/ResourceResolutionService.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/services/resolution/ResourceResolutionService.kt new file mode 100644 index 00000000..3ee7e41f --- /dev/null +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/services/resolution/ResourceResolutionService.kt @@ -0,0 +1,79 @@ +/* + * Copyright © 2017-2018 AT&T Intellectual Property. + * Modifications Copyright © 2018 IBM. + * + * 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.blueprintsprocessor.services.resolution + +import org.onap.ccsdk.apps.blueprintsprocessor.core.api.data.ResourceResolutionInput +import org.onap.ccsdk.apps.blueprintsprocessor.core.api.data.ResourceResolutionOutput +import org.onap.ccsdk.apps.blueprintsprocessor.core.api.data.Status +import org.onap.ccsdk.apps.blueprintsprocessor.core.factory.ResourceAssignmentProcessorFactory +import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintProcessorException +import org.onap.ccsdk.apps.controllerblueprints.resource.dict.ResourceAssignment +import org.onap.ccsdk.apps.controllerblueprints.resource.dict.utils.BulkResourceSequencingUtils +import org.springframework.stereotype.Service + +/** + * ResourceResolutionService + * @author Brinda Santh + * 8/14/2018 + */ + +@Service +class ResourceResolutionService(private val resourceAssignmentProcessorFactory: ResourceAssignmentProcessorFactory) { + + fun resolveResource(resourceResolutionInput: ResourceResolutionInput): ResourceResolutionOutput { + val resourceResolutionOutput = ResourceResolutionOutput() + resourceResolutionOutput.actionIdentifiers = resourceResolutionInput.actionIdentifiers + resourceResolutionOutput.commonHeader = resourceResolutionInput.commonHeader + resourceResolutionOutput.resourceAssignments = resourceResolutionInput.resourceAssignments + + val context = hashMapOf() + + process(resourceResolutionOutput.resourceAssignments, context) + + val status = Status() + status.code = 200 + status.message = "Success" + resourceResolutionOutput.status = status + + return resourceResolutionOutput + } + + fun process(resourceAssignments: MutableList, context: MutableMap): Unit { + + val bulkSequenced = BulkResourceSequencingUtils.process(resourceAssignments) + + bulkSequenced.map { batchResourceAssignments -> + batchResourceAssignments.filter { it.name != "*" && it.name != "start" } + .map { resourceAssignment -> + val dictionarySource = resourceAssignment.dictionarySource + val processorInstanceName = "resource-assignment-processor-".plus(dictionarySource) + val resourceAssignmentProcessor = resourceAssignmentProcessorFactory.getInstance(processorInstanceName) + ?: throw BluePrintProcessorException("failed to get resource processor for instance name($processorInstanceName) " + + "for resource assignment(${resourceAssignment.name})") + try { + resourceAssignmentProcessor.validate(resourceAssignment, context) + resourceAssignmentProcessor.process(resourceAssignment, context) + } catch (e: Exception) { + resourceAssignmentProcessor.errorHandle(resourceAssignment, context) + throw BluePrintProcessorException(e) + } + + } + } + } +} diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/services/resolution/processor/DefaultResourceAssignmentProcessor.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/services/resolution/processor/DefaultResourceAssignmentProcessor.kt new file mode 100644 index 00000000..9580ca49 --- /dev/null +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/services/resolution/processor/DefaultResourceAssignmentProcessor.kt @@ -0,0 +1,49 @@ +/* + * Copyright © 2017-2018 AT&T Intellectual Property. + * Modifications Copyright © 2018 IBM. + * + * 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.blueprintsprocessor.services.resolution.processor + +import com.att.eelf.configuration.EELFManager +import org.onap.ccsdk.apps.controllerblueprints.resource.dict.ResourceAssignment +import org.onap.ccsdk.apps.controllerblueprints.resource.dict.ResourceAssignmentProcessor +import org.springframework.stereotype.Service + +/** + * DefaultResourceAssignmentProcessor + * + * @author Brinda Santh + */ +@Service("resource-assignment-processor-default") +open class DefaultResourceAssignmentProcessor : ResourceAssignmentProcessor { + private val log = EELFManager.getInstance().getLogger(DefaultResourceAssignmentProcessor::class.java) + + override fun validate(resourceAssignment: ResourceAssignment, context: MutableMap) { + log.info("Validation Resource Assignments") + } + + override fun process(resourceAssignment: ResourceAssignment, context: MutableMap) { + log.info("Processing Resource Assignments") + } + + override fun errorHandle(resourceAssignment: ResourceAssignment, context: MutableMap) { + log.info("ErrorHandle Resource Assignments") + } + + override fun reTrigger(resourceAssignment: ResourceAssignment, context: MutableMap) { + log.info("Re Trigger Resource Assignments") + } +} \ No newline at end of file diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/services/resolution/processor/InputResourceAssignmentProcessor.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/services/resolution/processor/InputResourceAssignmentProcessor.kt new file mode 100644 index 00000000..05f7d5cd --- /dev/null +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/services/resolution/processor/InputResourceAssignmentProcessor.kt @@ -0,0 +1,49 @@ +/* + * Copyright © 2017-2018 AT&T Intellectual Property. + * Modifications Copyright © 2018 IBM. + * + * 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.blueprintsprocessor.services.resolution.processor + +import com.att.eelf.configuration.EELFManager +import org.onap.ccsdk.apps.controllerblueprints.resource.dict.ResourceAssignment +import org.onap.ccsdk.apps.controllerblueprints.resource.dict.ResourceAssignmentProcessor +import org.springframework.stereotype.Service + +/** + * InputResourceAssignmentProcessor + * + * @author Brinda Santh + */ +@Service("resource-assignment-processor-input") +open class InputResourceAssignmentProcessor : ResourceAssignmentProcessor { + private val log = EELFManager.getInstance().getLogger(InputResourceAssignmentProcessor::class.java) + + override fun validate(resourceAssignment: ResourceAssignment, context: MutableMap) { + log.info("Validation Resource Assignments") + } + + override fun process(resourceAssignment: ResourceAssignment, context: MutableMap) { + log.info("Processing Resource Assignments") + } + + override fun errorHandle(resourceAssignment: ResourceAssignment, context: MutableMap) { + log.info("ErrorHandle Resource Assignments") + } + + override fun reTrigger(resourceAssignment: ResourceAssignment, context: MutableMap) { + log.info("Re Trigger Resource Assignments") + } +} \ No newline at end of file diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/services/resolution/processor/MDSALResourceAssignmentProcessor.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/services/resolution/processor/MDSALResourceAssignmentProcessor.kt new file mode 100644 index 00000000..9d54cd46 --- /dev/null +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/services/resolution/processor/MDSALResourceAssignmentProcessor.kt @@ -0,0 +1,48 @@ +/* + * Copyright © 2018 IBM. + * + * 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.blueprintsprocessor.services.resolution.processor + +import com.att.eelf.configuration.EELFManager +import org.onap.ccsdk.apps.controllerblueprints.resource.dict.ResourceAssignment +import org.onap.ccsdk.apps.controllerblueprints.resource.dict.ResourceAssignmentProcessor +import org.springframework.stereotype.Service + +/** + * MDSALResourceAssignmentProcessor + * + * @author Brinda Santh + */ +@Service("resource-assignment-processor-mdsal") +open class MDSALResourceAssignmentProcessor : ResourceAssignmentProcessor { + private val log = EELFManager.getInstance().getLogger(MDSALResourceAssignmentProcessor::class.java) + + override fun validate(resourceAssignment: ResourceAssignment, context: MutableMap) { + log.info("Validation Resource Assignments") + } + + override fun process(resourceAssignment: ResourceAssignment, context: MutableMap) { + log.info("Processing Resource Assignments") + } + + override fun errorHandle(resourceAssignment: ResourceAssignment, context: MutableMap) { + log.info("ErrorHandle Resource Assignments") + } + + override fun reTrigger(resourceAssignment: ResourceAssignment, context: MutableMap) { + log.info("Re Trigger Resource Assignments") + } +} \ No newline at end of file diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/services/resolution/processor/SdncResourceAssignmentProcessor.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/services/resolution/processor/SdncResourceAssignmentProcessor.kt new file mode 100644 index 00000000..4b11f580 --- /dev/null +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/services/resolution/processor/SdncResourceAssignmentProcessor.kt @@ -0,0 +1,50 @@ +/* + * Copyright © 2018 IBM. + * + * 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.blueprintsprocessor.services.resolution.processor + +import com.att.eelf.configuration.EELFManager +import org.onap.ccsdk.apps.controllerblueprints.resource.dict.ResourceAssignment +import org.onap.ccsdk.apps.controllerblueprints.resource.dict.ResourceAssignmentProcessor +import org.springframework.stereotype.Service + +/** + * SdncResourceAssignmentProcessor + * + * @author Brinda Santh + */ +@Service("resource-assignment-processor-db") +open class SdncResourceAssignmentProcessor : ResourceAssignmentProcessor { + + private val log = EELFManager.getInstance().getLogger(SdncResourceAssignmentProcessor::class.java) + + override fun validate(resourceAssignment: ResourceAssignment, context: MutableMap) { + log.info("Validation Resource Assignments") + } + + override fun process(resourceAssignment: ResourceAssignment, context: MutableMap) { + log.info("Processing Resource Assignments") + } + + override fun errorHandle(resourceAssignment: ResourceAssignment, context: MutableMap) { + log.info("ErrorHandle Resource Assignments") + } + + override fun reTrigger(resourceAssignment: ResourceAssignment, context: MutableMap) { + log.info("Re Trigger Resource Assignments") + } + +} \ No newline at end of file diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/test/java/org/onap/ccsdk/apps/blueprintsprocessor/services/resolution/ResourceResolutionServiceTest.java b/ms/blueprintsprocessor/functions/resource-resolution/src/test/java/org/onap/ccsdk/apps/blueprintsprocessor/services/resolution/ResourceResolutionServiceTest.java new file mode 100644 index 00000000..0768c609 --- /dev/null +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/test/java/org/onap/ccsdk/apps/blueprintsprocessor/services/resolution/ResourceResolutionServiceTest.java @@ -0,0 +1,88 @@ +/* + * Copyright © 2017-2018 AT&T Intellectual Property. + * Modifications Copyright © 2018 IBM. + * + * 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.blueprintsprocessor.services.resolution; + +import com.fasterxml.jackson.databind.node.ObjectNode; +import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.io.FileUtils; +import org.junit.Assert; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.onap.ccsdk.apps.blueprintsprocessor.core.api.data.ResourceResolutionInput; +import org.onap.ccsdk.apps.blueprintsprocessor.core.api.data.ResourceResolutionOutput; +import org.onap.ccsdk.apps.blueprintsprocessor.core.factory.ResourceAssignmentProcessorFactory; +import org.onap.ccsdk.apps.blueprintsprocessor.services.resolution.processor.DefaultResourceAssignmentProcessor; +import org.onap.ccsdk.apps.blueprintsprocessor.services.resolution.processor.InputResourceAssignmentProcessor; +import org.onap.ccsdk.apps.blueprintsprocessor.services.resolution.processor.MDSALResourceAssignmentProcessor; +import org.onap.ccsdk.apps.blueprintsprocessor.services.resolution.processor.SdncResourceAssignmentProcessor; +import org.onap.ccsdk.apps.controllerblueprints.core.utils.JacksonUtils; +import org.onap.ccsdk.apps.controllerblueprints.resource.dict.ResourceAssignment; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringRunner; + +import java.io.File; +import java.nio.charset.Charset; +import java.util.List; + +/** + * ResourceResolutionServiceTest + * + * @author Brinda Santh DATE : 8/15/2018 + */ +@RunWith(SpringRunner.class) +@ContextConfiguration(classes = {ResourceResolutionService.class, ResourceAssignmentProcessorFactory.class, + InputResourceAssignmentProcessor.class, DefaultResourceAssignmentProcessor.class, + SdncResourceAssignmentProcessor.class, MDSALResourceAssignmentProcessor.class}) +public class ResourceResolutionServiceTest { + private static Logger log = LoggerFactory.getLogger(ResourceResolutionServiceTest.class); + + @Autowired + private ResourceResolutionService resourceResolutionService; + + @Test + public void testResolveResource() throws Exception { + + Assert.assertNotNull("failed to create ResourceResolutionService", resourceResolutionService); + + String resourceResolutionInputContent = FileUtils.readFileToString( + new File("src/test/resources/payload/requests/sample-resourceresolution-request.json"), Charset.defaultCharset()); + + ResourceResolutionInput resourceResolutionInput = JacksonUtils.readValue(resourceResolutionInputContent, ResourceResolutionInput.class); + Assert.assertNotNull("failed to populate resourceResolutionInput request ", resourceResolutionInput); + + String resourceAssignmentContent = FileUtils.readFileToString( + new File("src/test/resources/mapping/db/resource-assignments-simple.json"), Charset.defaultCharset()); + List batchResourceAssignment = + JacksonUtils.getListFromJson(resourceAssignmentContent, ResourceAssignment.class); + + Assert.assertTrue("failed to create ResourceAssignment from file", CollectionUtils.isNotEmpty(batchResourceAssignment)); + resourceResolutionInput.setResourceAssignments(batchResourceAssignment); + + ObjectNode inputContent = (ObjectNode) JacksonUtils.jsonNodeFromFile("src/test/resources/payload/inputs/input.json"); + Assert.assertNotNull("failed to populate input payload ", inputContent); + resourceResolutionInput.setPayload(inputContent); + log.info("ResourceResolutionInput : {}", JacksonUtils.getJson(resourceResolutionInput, true)); + + ResourceResolutionOutput resourceResolutionOutput = resourceResolutionService.resolveResource(resourceResolutionInput); + Assert.assertNotNull("failed to populate output", resourceResolutionOutput); + + } +} diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/mapping/db/db-array.json b/ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/mapping/db/db-array.json new file mode 100644 index 00000000..679b92db --- /dev/null +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/mapping/db/db-array.json @@ -0,0 +1,35 @@ +{ + "locations": { + "name": "locations", + "data-type": "list", + "entry-schema": "dt-location", + "source": { + "db": { + "query": "SELECT db-country, db-state FROM DEVICE_PROFILE WHERE profile_name = :profile_name", + "input-key-mapping": { + "profile_name": "profile_name" + }, + "output-key-mapping": { + "db-country": "country", + "db-state": "state" + } + } + }, + "candidate-dependency": { + "db": { + "names": [ + "profile_name" + ] + } + } + }, + "profile_name": { + "name": "profile_name", + "data-type": "string", + "source": { + "input": { + + } + } + } +} diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/mapping/db/db-complex.json b/ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/mapping/db/db-complex.json new file mode 100644 index 00000000..32d04b69 --- /dev/null +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/mapping/db/db-complex.json @@ -0,0 +1,27 @@ +{ + "location": { + "name": "location", + "data-type": "dt-location", + "source": { + "db": { + "query": "SELECT db-country, db-state FROM DEVICE_PROFILE WHERE profile_name = :profile_name", + "input-key-mapping": { + "profile_name": "profile_name" + }, + "output-key-mapping": { + "db-country": "country", + "db-state": "state" + } + } + } + }, + "profile_name": { + "name": "profile_name", + "data-type": "string", + "source": { + "input": { + + } + } + } +} diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/mapping/db/db-simple.json b/ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/mapping/db/db-simple.json new file mode 100644 index 00000000..841404f2 --- /dev/null +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/mapping/db/db-simple.json @@ -0,0 +1,26 @@ +{ + "country": { + "name": "country", + "data-type": "string", + "source": { + "db": { + "query": "SELECT country FROM DEVICE_PROFILE WHERE profile_name = :profile_name", + "input-key-mapping": { + "profile_name": "profile_name" + }, + "output-key-mapping": { + "country": "country" + } + } + } + }, + "profile_name": { + "name": "profile_name", + "data-type": "string", + "source": { + "input": { + + } + } + } +} diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/mapping/db/dt-location.json b/ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/mapping/db/dt-location.json new file mode 100644 index 00000000..52e0a796 --- /dev/null +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/mapping/db/dt-location.json @@ -0,0 +1,15 @@ +{ + "version": "1.0.0", + "description": "test Data Type", + "properties": { + "country": { + "required": true, + "type": "string" + }, + "state": { + "required": false, + "type": "string" + } + }, + "derived_from": "tosca.datatypes.Root" +} diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/mapping/db/resource-assignments-simple.json b/ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/mapping/db/resource-assignments-simple.json new file mode 100644 index 00000000..ddcf32ee --- /dev/null +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/mapping/db/resource-assignments-simple.json @@ -0,0 +1,22 @@ +[ + { + "name": "country", + "input-param": true, + "property": { + "type": "string" + }, + "dictionary-name": "country", + "dictionary-source": "db", + "dependencies": ["state"] + }, + { + "name": "state", + "input-param": true, + "property": { + "type": "string" + }, + "dictionary-name": "state", + "dictionary-source": "input", + "dependencies": [] + } +] diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/payload/inputs/input.json b/ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/payload/inputs/input.json new file mode 100644 index 00000000..cd6fac12 --- /dev/null +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/payload/inputs/input.json @@ -0,0 +1,18 @@ +{ + "api-ver": "2.00", + "originator-id": "MSO", + "request-id": "123456", + "service-instance-id": "ibcx0001vm001", + "service-type": "AVPN", + "vnf-type": "vUSP - vDBE-IPX HUB", + "vnf-id": 123456, + "service-template-name": "VRR-baseconfiguration", + "service-template-version": "1.0.0", + "action-name": "resource-assignment-action", + "group-name": "sample group name", + "bundle-id": "sample bundle id", + "bundle-mac": [ + "Sample bundle mac", + "Sample bundle mac" + ] +} diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/payload/requests/sample-resourceresolution-request.json b/ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/payload/requests/sample-resourceresolution-request.json new file mode 100644 index 00000000..e8830a8a --- /dev/null +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/payload/requests/sample-resourceresolution-request.json @@ -0,0 +1,22 @@ +{ + "actionIdentifiers": { + "actionName": "sample-action", + "blueprintName": "sample-blurprint", + "blueprintVersion": "1.0.0", + "mode": "sync" + }, + "commonHeader": { + "flags": { + "force": true, + "ttl": 3600 + }, + "originatorId": "sdnc", + "requestId": "123456-1000", + "subRequestId": "sub-123456-1000", + "timestamp": "2012-04-23T18:25:43.511Z" + }, + "payload": { + }, + "resourceAssignments": [ + ] +} diff --git a/ms/blueprintsprocessor/modules/commons/core/pom.xml b/ms/blueprintsprocessor/modules/commons/core/pom.xml index 094f42b7..626a27a3 100644 --- a/ms/blueprintsprocessor/modules/commons/core/pom.xml +++ b/ms/blueprintsprocessor/modules/commons/core/pom.xml @@ -17,27 +17,27 @@ ~ limitations under the License. --> - 4.0.0 - - org.onap.ccsdk.apps.blueprintsprocessor - commons - 0.4.0-SNAPSHOT - + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + + org.onap.ccsdk.apps.blueprintsprocessor + commons + 0.4.0-SNAPSHOT + - core - jar - Blueprints Processor Core - Blueprints Processor Core + core + jar + Blueprints Processor Core + Blueprints Processor Core - - - org.onap.ccsdk.apps.blueprintsprocessor - db-lib - - - org.onap.ccsdk.apps.blueprintsprocessor - rest-lib - - + + + org.onap.ccsdk.apps.blueprintsprocessor + db-lib + + + org.onap.ccsdk.apps.blueprintsprocessor + rest-lib + + diff --git a/ms/blueprintsprocessor/modules/commons/pom.xml b/ms/blueprintsprocessor/modules/commons/pom.xml index c080f817..7bfec58c 100644 --- a/ms/blueprintsprocessor/modules/commons/pom.xml +++ b/ms/blueprintsprocessor/modules/commons/pom.xml @@ -35,16 +35,8 @@ - com.fasterxml.jackson.module - jackson-module-kotlin - - - org.jetbrains.kotlin - kotlin-stdlib-jdk8 - - - org.jetbrains.kotlin - kotlin-reflect + org.onap.ccsdk.apps.controllerblueprints + resource-dict org.jetbrains.kotlin diff --git a/ms/blueprintsprocessor/modules/inbounds/pom.xml b/ms/blueprintsprocessor/modules/inbounds/pom.xml index f03e5557..e26af0f0 100644 --- a/ms/blueprintsprocessor/modules/inbounds/pom.xml +++ b/ms/blueprintsprocessor/modules/inbounds/pom.xml @@ -33,16 +33,13 @@ selfservice-api - - - org.onap.ccsdk.apps.blueprintsprocessor - execution-service + workflow-service - org.onap.ccsdk.apps.blueprintsprocessor - resolution-service + org.onap.ccsdk.apps.blueprintsprocessor.functions + resource-resolution org.springframework.boot diff --git a/ms/blueprintsprocessor/modules/pom.xml b/ms/blueprintsprocessor/modules/pom.xml index 93f312b8..0230cd7e 100644 --- a/ms/blueprintsprocessor/modules/pom.xml +++ b/ms/blueprintsprocessor/modules/pom.xml @@ -17,56 +17,32 @@ ~ limitations under the License. --> - 4.0.0 - - org.onap.ccsdk.apps.blueprintsprocessor - parent - 0.4.0-SNAPSHOT - ../parent - + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + + org.onap.ccsdk.apps.blueprintsprocessor + parent + 0.4.0-SNAPSHOT + ../parent + - modules - pom - Blueprints Processor Modules POM - Blueprints Processor Modules - - - commons - outbounds - services - inbounds - - - - - org.powermock - powermock-api-mockito2 - test - - - org.springframework.boot - spring-boot-starter-test - test - - - org.jetbrains.kotlin - kotlin-test-junit - test - - - io.projectreactor - reactor-test - test - - + modules + pom + Blueprints Processor Modules POM + Blueprints Processor Modules + + commons + outbounds + services + inbounds + org.jetbrains.kotlin kotlin-maven-plugin - ${kotlin.version} + ${kotlin.maven.version} compile diff --git a/ms/blueprintsprocessor/modules/services/execution-service/pom.xml b/ms/blueprintsprocessor/modules/services/execution-service/pom.xml index 158496df..4f0e6c0b 100644 --- a/ms/blueprintsprocessor/modules/services/execution-service/pom.xml +++ b/ms/blueprintsprocessor/modules/services/execution-service/pom.xml @@ -31,7 +31,37 @@ org.onap.ccsdk.apps.blueprintsprocessor - db-service + core + + + org.onap.ccsdk.apps.controllerblueprints + resource-dict + + + + org.onap.ccsdk.sli.core + sli-provider + + + + org.powermock + powermock-api-mockito2 + test + + + org.springframework.boot + spring-boot-starter-test + test + + + org.jetbrains.kotlin + kotlin-test-junit + test + + + io.projectreactor + reactor-test + test diff --git a/ms/blueprintsprocessor/modules/services/pom.xml b/ms/blueprintsprocessor/modules/services/pom.xml index d175f129..d2f2e0cb 100644 --- a/ms/blueprintsprocessor/modules/services/pom.xml +++ b/ms/blueprintsprocessor/modules/services/pom.xml @@ -30,14 +30,6 @@ execution-service - resolution-service workflow-service - - - - org.onap.ccsdk.apps.blueprintsprocessor - core - - diff --git a/ms/blueprintsprocessor/modules/services/resolution-service/pom.xml b/ms/blueprintsprocessor/modules/services/resolution-service/pom.xml deleted file mode 100644 index 21464c14..00000000 --- a/ms/blueprintsprocessor/modules/services/resolution-service/pom.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - 4.0.0 - - org.onap.ccsdk.apps.blueprintsprocessor - services - 0.4.0-SNAPSHOT - - resolution-service - jar - Blueprints Processor Resolution Service - Blueprints Processor Resolution Service - - - - org.onap.ccsdk.apps.blueprintsprocessor - db-service - - - diff --git a/ms/blueprintsprocessor/modules/services/resolution-service/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/services/resolution/ResourceResolutionComponent.kt b/ms/blueprintsprocessor/modules/services/resolution-service/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/services/resolution/ResourceResolutionComponent.kt deleted file mode 100644 index ff1a01d5..00000000 --- a/ms/blueprintsprocessor/modules/services/resolution-service/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/services/resolution/ResourceResolutionComponent.kt +++ /dev/null @@ -1,39 +0,0 @@ -/* - * 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.blueprintsprocessor.services.resolution - -import org.onap.ccsdk.apps.blueprintsprocessor.core.factory.ComponentNode -import org.springframework.stereotype.Component - -@Component("component-resource-resolution") -open class ResourceResolutionComponent : ComponentNode { - override fun validate(context: MutableMap, componentContext: MutableMap) { - TODO("not implemented") //To change body of created functions use File | Settings | File Templates. - } - - override fun process(context: MutableMap, componentContext: MutableMap) { - TODO("not implemented") //To change body of created functions use File | Settings | File Templates. - } - - override fun errorHandle(context: MutableMap, componentContext: MutableMap) { - TODO("not implemented") //To change body of created functions use File | Settings | File Templates. - } - - override fun reTrigger(context: MutableMap, componentContext: MutableMap) { - TODO("not implemented") //To change body of created functions use File | Settings | File Templates. - } -} \ No newline at end of file diff --git a/ms/blueprintsprocessor/modules/services/resolution-service/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/services/resolution/ResourceResolutionService.kt b/ms/blueprintsprocessor/modules/services/resolution-service/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/services/resolution/ResourceResolutionService.kt deleted file mode 100644 index 3ee7e41f..00000000 --- a/ms/blueprintsprocessor/modules/services/resolution-service/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/services/resolution/ResourceResolutionService.kt +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright © 2017-2018 AT&T Intellectual Property. - * Modifications Copyright © 2018 IBM. - * - * 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.blueprintsprocessor.services.resolution - -import org.onap.ccsdk.apps.blueprintsprocessor.core.api.data.ResourceResolutionInput -import org.onap.ccsdk.apps.blueprintsprocessor.core.api.data.ResourceResolutionOutput -import org.onap.ccsdk.apps.blueprintsprocessor.core.api.data.Status -import org.onap.ccsdk.apps.blueprintsprocessor.core.factory.ResourceAssignmentProcessorFactory -import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintProcessorException -import org.onap.ccsdk.apps.controllerblueprints.resource.dict.ResourceAssignment -import org.onap.ccsdk.apps.controllerblueprints.resource.dict.utils.BulkResourceSequencingUtils -import org.springframework.stereotype.Service - -/** - * ResourceResolutionService - * @author Brinda Santh - * 8/14/2018 - */ - -@Service -class ResourceResolutionService(private val resourceAssignmentProcessorFactory: ResourceAssignmentProcessorFactory) { - - fun resolveResource(resourceResolutionInput: ResourceResolutionInput): ResourceResolutionOutput { - val resourceResolutionOutput = ResourceResolutionOutput() - resourceResolutionOutput.actionIdentifiers = resourceResolutionInput.actionIdentifiers - resourceResolutionOutput.commonHeader = resourceResolutionInput.commonHeader - resourceResolutionOutput.resourceAssignments = resourceResolutionInput.resourceAssignments - - val context = hashMapOf() - - process(resourceResolutionOutput.resourceAssignments, context) - - val status = Status() - status.code = 200 - status.message = "Success" - resourceResolutionOutput.status = status - - return resourceResolutionOutput - } - - fun process(resourceAssignments: MutableList, context: MutableMap): Unit { - - val bulkSequenced = BulkResourceSequencingUtils.process(resourceAssignments) - - bulkSequenced.map { batchResourceAssignments -> - batchResourceAssignments.filter { it.name != "*" && it.name != "start" } - .map { resourceAssignment -> - val dictionarySource = resourceAssignment.dictionarySource - val processorInstanceName = "resource-assignment-processor-".plus(dictionarySource) - val resourceAssignmentProcessor = resourceAssignmentProcessorFactory.getInstance(processorInstanceName) - ?: throw BluePrintProcessorException("failed to get resource processor for instance name($processorInstanceName) " + - "for resource assignment(${resourceAssignment.name})") - try { - resourceAssignmentProcessor.validate(resourceAssignment, context) - resourceAssignmentProcessor.process(resourceAssignment, context) - } catch (e: Exception) { - resourceAssignmentProcessor.errorHandle(resourceAssignment, context) - throw BluePrintProcessorException(e) - } - - } - } - } -} diff --git a/ms/blueprintsprocessor/modules/services/resolution-service/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/services/resolution/processor/DefaultResourceAssignmentProcessor.kt b/ms/blueprintsprocessor/modules/services/resolution-service/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/services/resolution/processor/DefaultResourceAssignmentProcessor.kt deleted file mode 100644 index 9580ca49..00000000 --- a/ms/blueprintsprocessor/modules/services/resolution-service/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/services/resolution/processor/DefaultResourceAssignmentProcessor.kt +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright © 2017-2018 AT&T Intellectual Property. - * Modifications Copyright © 2018 IBM. - * - * 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.blueprintsprocessor.services.resolution.processor - -import com.att.eelf.configuration.EELFManager -import org.onap.ccsdk.apps.controllerblueprints.resource.dict.ResourceAssignment -import org.onap.ccsdk.apps.controllerblueprints.resource.dict.ResourceAssignmentProcessor -import org.springframework.stereotype.Service - -/** - * DefaultResourceAssignmentProcessor - * - * @author Brinda Santh - */ -@Service("resource-assignment-processor-default") -open class DefaultResourceAssignmentProcessor : ResourceAssignmentProcessor { - private val log = EELFManager.getInstance().getLogger(DefaultResourceAssignmentProcessor::class.java) - - override fun validate(resourceAssignment: ResourceAssignment, context: MutableMap) { - log.info("Validation Resource Assignments") - } - - override fun process(resourceAssignment: ResourceAssignment, context: MutableMap) { - log.info("Processing Resource Assignments") - } - - override fun errorHandle(resourceAssignment: ResourceAssignment, context: MutableMap) { - log.info("ErrorHandle Resource Assignments") - } - - override fun reTrigger(resourceAssignment: ResourceAssignment, context: MutableMap) { - log.info("Re Trigger Resource Assignments") - } -} \ No newline at end of file diff --git a/ms/blueprintsprocessor/modules/services/resolution-service/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/services/resolution/processor/InputResourceAssignmentProcessor.kt b/ms/blueprintsprocessor/modules/services/resolution-service/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/services/resolution/processor/InputResourceAssignmentProcessor.kt deleted file mode 100644 index 05f7d5cd..00000000 --- a/ms/blueprintsprocessor/modules/services/resolution-service/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/services/resolution/processor/InputResourceAssignmentProcessor.kt +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright © 2017-2018 AT&T Intellectual Property. - * Modifications Copyright © 2018 IBM. - * - * 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.blueprintsprocessor.services.resolution.processor - -import com.att.eelf.configuration.EELFManager -import org.onap.ccsdk.apps.controllerblueprints.resource.dict.ResourceAssignment -import org.onap.ccsdk.apps.controllerblueprints.resource.dict.ResourceAssignmentProcessor -import org.springframework.stereotype.Service - -/** - * InputResourceAssignmentProcessor - * - * @author Brinda Santh - */ -@Service("resource-assignment-processor-input") -open class InputResourceAssignmentProcessor : ResourceAssignmentProcessor { - private val log = EELFManager.getInstance().getLogger(InputResourceAssignmentProcessor::class.java) - - override fun validate(resourceAssignment: ResourceAssignment, context: MutableMap) { - log.info("Validation Resource Assignments") - } - - override fun process(resourceAssignment: ResourceAssignment, context: MutableMap) { - log.info("Processing Resource Assignments") - } - - override fun errorHandle(resourceAssignment: ResourceAssignment, context: MutableMap) { - log.info("ErrorHandle Resource Assignments") - } - - override fun reTrigger(resourceAssignment: ResourceAssignment, context: MutableMap) { - log.info("Re Trigger Resource Assignments") - } -} \ No newline at end of file diff --git a/ms/blueprintsprocessor/modules/services/resolution-service/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/services/resolution/processor/MDSALResourceAssignmentProcessor.kt b/ms/blueprintsprocessor/modules/services/resolution-service/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/services/resolution/processor/MDSALResourceAssignmentProcessor.kt deleted file mode 100644 index 9d54cd46..00000000 --- a/ms/blueprintsprocessor/modules/services/resolution-service/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/services/resolution/processor/MDSALResourceAssignmentProcessor.kt +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright © 2018 IBM. - * - * 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.blueprintsprocessor.services.resolution.processor - -import com.att.eelf.configuration.EELFManager -import org.onap.ccsdk.apps.controllerblueprints.resource.dict.ResourceAssignment -import org.onap.ccsdk.apps.controllerblueprints.resource.dict.ResourceAssignmentProcessor -import org.springframework.stereotype.Service - -/** - * MDSALResourceAssignmentProcessor - * - * @author Brinda Santh - */ -@Service("resource-assignment-processor-mdsal") -open class MDSALResourceAssignmentProcessor : ResourceAssignmentProcessor { - private val log = EELFManager.getInstance().getLogger(MDSALResourceAssignmentProcessor::class.java) - - override fun validate(resourceAssignment: ResourceAssignment, context: MutableMap) { - log.info("Validation Resource Assignments") - } - - override fun process(resourceAssignment: ResourceAssignment, context: MutableMap) { - log.info("Processing Resource Assignments") - } - - override fun errorHandle(resourceAssignment: ResourceAssignment, context: MutableMap) { - log.info("ErrorHandle Resource Assignments") - } - - override fun reTrigger(resourceAssignment: ResourceAssignment, context: MutableMap) { - log.info("Re Trigger Resource Assignments") - } -} \ No newline at end of file diff --git a/ms/blueprintsprocessor/modules/services/resolution-service/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/services/resolution/processor/SdncResourceAssignmentProcessor.kt b/ms/blueprintsprocessor/modules/services/resolution-service/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/services/resolution/processor/SdncResourceAssignmentProcessor.kt deleted file mode 100644 index 4b11f580..00000000 --- a/ms/blueprintsprocessor/modules/services/resolution-service/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/services/resolution/processor/SdncResourceAssignmentProcessor.kt +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright © 2018 IBM. - * - * 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.blueprintsprocessor.services.resolution.processor - -import com.att.eelf.configuration.EELFManager -import org.onap.ccsdk.apps.controllerblueprints.resource.dict.ResourceAssignment -import org.onap.ccsdk.apps.controllerblueprints.resource.dict.ResourceAssignmentProcessor -import org.springframework.stereotype.Service - -/** - * SdncResourceAssignmentProcessor - * - * @author Brinda Santh - */ -@Service("resource-assignment-processor-db") -open class SdncResourceAssignmentProcessor : ResourceAssignmentProcessor { - - private val log = EELFManager.getInstance().getLogger(SdncResourceAssignmentProcessor::class.java) - - override fun validate(resourceAssignment: ResourceAssignment, context: MutableMap) { - log.info("Validation Resource Assignments") - } - - override fun process(resourceAssignment: ResourceAssignment, context: MutableMap) { - log.info("Processing Resource Assignments") - } - - override fun errorHandle(resourceAssignment: ResourceAssignment, context: MutableMap) { - log.info("ErrorHandle Resource Assignments") - } - - override fun reTrigger(resourceAssignment: ResourceAssignment, context: MutableMap) { - log.info("Re Trigger Resource Assignments") - } - -} \ No newline at end of file diff --git a/ms/blueprintsprocessor/modules/services/resolution-service/src/test/java/org/onap/ccsdk/apps/blueprintsprocessor/services/resolution/ResourceResolutionServiceTest.java b/ms/blueprintsprocessor/modules/services/resolution-service/src/test/java/org/onap/ccsdk/apps/blueprintsprocessor/services/resolution/ResourceResolutionServiceTest.java deleted file mode 100644 index 0768c609..00000000 --- a/ms/blueprintsprocessor/modules/services/resolution-service/src/test/java/org/onap/ccsdk/apps/blueprintsprocessor/services/resolution/ResourceResolutionServiceTest.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright © 2017-2018 AT&T Intellectual Property. - * Modifications Copyright © 2018 IBM. - * - * 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.blueprintsprocessor.services.resolution; - -import com.fasterxml.jackson.databind.node.ObjectNode; -import org.apache.commons.collections.CollectionUtils; -import org.apache.commons.io.FileUtils; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.onap.ccsdk.apps.blueprintsprocessor.core.api.data.ResourceResolutionInput; -import org.onap.ccsdk.apps.blueprintsprocessor.core.api.data.ResourceResolutionOutput; -import org.onap.ccsdk.apps.blueprintsprocessor.core.factory.ResourceAssignmentProcessorFactory; -import org.onap.ccsdk.apps.blueprintsprocessor.services.resolution.processor.DefaultResourceAssignmentProcessor; -import org.onap.ccsdk.apps.blueprintsprocessor.services.resolution.processor.InputResourceAssignmentProcessor; -import org.onap.ccsdk.apps.blueprintsprocessor.services.resolution.processor.MDSALResourceAssignmentProcessor; -import org.onap.ccsdk.apps.blueprintsprocessor.services.resolution.processor.SdncResourceAssignmentProcessor; -import org.onap.ccsdk.apps.controllerblueprints.core.utils.JacksonUtils; -import org.onap.ccsdk.apps.controllerblueprints.resource.dict.ResourceAssignment; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringRunner; - -import java.io.File; -import java.nio.charset.Charset; -import java.util.List; - -/** - * ResourceResolutionServiceTest - * - * @author Brinda Santh DATE : 8/15/2018 - */ -@RunWith(SpringRunner.class) -@ContextConfiguration(classes = {ResourceResolutionService.class, ResourceAssignmentProcessorFactory.class, - InputResourceAssignmentProcessor.class, DefaultResourceAssignmentProcessor.class, - SdncResourceAssignmentProcessor.class, MDSALResourceAssignmentProcessor.class}) -public class ResourceResolutionServiceTest { - private static Logger log = LoggerFactory.getLogger(ResourceResolutionServiceTest.class); - - @Autowired - private ResourceResolutionService resourceResolutionService; - - @Test - public void testResolveResource() throws Exception { - - Assert.assertNotNull("failed to create ResourceResolutionService", resourceResolutionService); - - String resourceResolutionInputContent = FileUtils.readFileToString( - new File("src/test/resources/payload/requests/sample-resourceresolution-request.json"), Charset.defaultCharset()); - - ResourceResolutionInput resourceResolutionInput = JacksonUtils.readValue(resourceResolutionInputContent, ResourceResolutionInput.class); - Assert.assertNotNull("failed to populate resourceResolutionInput request ", resourceResolutionInput); - - String resourceAssignmentContent = FileUtils.readFileToString( - new File("src/test/resources/mapping/db/resource-assignments-simple.json"), Charset.defaultCharset()); - List batchResourceAssignment = - JacksonUtils.getListFromJson(resourceAssignmentContent, ResourceAssignment.class); - - Assert.assertTrue("failed to create ResourceAssignment from file", CollectionUtils.isNotEmpty(batchResourceAssignment)); - resourceResolutionInput.setResourceAssignments(batchResourceAssignment); - - ObjectNode inputContent = (ObjectNode) JacksonUtils.jsonNodeFromFile("src/test/resources/payload/inputs/input.json"); - Assert.assertNotNull("failed to populate input payload ", inputContent); - resourceResolutionInput.setPayload(inputContent); - log.info("ResourceResolutionInput : {}", JacksonUtils.getJson(resourceResolutionInput, true)); - - ResourceResolutionOutput resourceResolutionOutput = resourceResolutionService.resolveResource(resourceResolutionInput); - Assert.assertNotNull("failed to populate output", resourceResolutionOutput); - - } -} diff --git a/ms/blueprintsprocessor/modules/services/resolution-service/src/test/resources/mapping/db/db-array.json b/ms/blueprintsprocessor/modules/services/resolution-service/src/test/resources/mapping/db/db-array.json deleted file mode 100644 index 679b92db..00000000 --- a/ms/blueprintsprocessor/modules/services/resolution-service/src/test/resources/mapping/db/db-array.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "locations": { - "name": "locations", - "data-type": "list", - "entry-schema": "dt-location", - "source": { - "db": { - "query": "SELECT db-country, db-state FROM DEVICE_PROFILE WHERE profile_name = :profile_name", - "input-key-mapping": { - "profile_name": "profile_name" - }, - "output-key-mapping": { - "db-country": "country", - "db-state": "state" - } - } - }, - "candidate-dependency": { - "db": { - "names": [ - "profile_name" - ] - } - } - }, - "profile_name": { - "name": "profile_name", - "data-type": "string", - "source": { - "input": { - - } - } - } -} diff --git a/ms/blueprintsprocessor/modules/services/resolution-service/src/test/resources/mapping/db/db-complex.json b/ms/blueprintsprocessor/modules/services/resolution-service/src/test/resources/mapping/db/db-complex.json deleted file mode 100644 index 32d04b69..00000000 --- a/ms/blueprintsprocessor/modules/services/resolution-service/src/test/resources/mapping/db/db-complex.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "location": { - "name": "location", - "data-type": "dt-location", - "source": { - "db": { - "query": "SELECT db-country, db-state FROM DEVICE_PROFILE WHERE profile_name = :profile_name", - "input-key-mapping": { - "profile_name": "profile_name" - }, - "output-key-mapping": { - "db-country": "country", - "db-state": "state" - } - } - } - }, - "profile_name": { - "name": "profile_name", - "data-type": "string", - "source": { - "input": { - - } - } - } -} diff --git a/ms/blueprintsprocessor/modules/services/resolution-service/src/test/resources/mapping/db/db-simple.json b/ms/blueprintsprocessor/modules/services/resolution-service/src/test/resources/mapping/db/db-simple.json deleted file mode 100644 index 841404f2..00000000 --- a/ms/blueprintsprocessor/modules/services/resolution-service/src/test/resources/mapping/db/db-simple.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "country": { - "name": "country", - "data-type": "string", - "source": { - "db": { - "query": "SELECT country FROM DEVICE_PROFILE WHERE profile_name = :profile_name", - "input-key-mapping": { - "profile_name": "profile_name" - }, - "output-key-mapping": { - "country": "country" - } - } - } - }, - "profile_name": { - "name": "profile_name", - "data-type": "string", - "source": { - "input": { - - } - } - } -} diff --git a/ms/blueprintsprocessor/modules/services/resolution-service/src/test/resources/mapping/db/dt-location.json b/ms/blueprintsprocessor/modules/services/resolution-service/src/test/resources/mapping/db/dt-location.json deleted file mode 100644 index 52e0a796..00000000 --- a/ms/blueprintsprocessor/modules/services/resolution-service/src/test/resources/mapping/db/dt-location.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "version": "1.0.0", - "description": "test Data Type", - "properties": { - "country": { - "required": true, - "type": "string" - }, - "state": { - "required": false, - "type": "string" - } - }, - "derived_from": "tosca.datatypes.Root" -} diff --git a/ms/blueprintsprocessor/modules/services/resolution-service/src/test/resources/mapping/db/resource-assignments-simple.json b/ms/blueprintsprocessor/modules/services/resolution-service/src/test/resources/mapping/db/resource-assignments-simple.json deleted file mode 100644 index ddcf32ee..00000000 --- a/ms/blueprintsprocessor/modules/services/resolution-service/src/test/resources/mapping/db/resource-assignments-simple.json +++ /dev/null @@ -1,22 +0,0 @@ -[ - { - "name": "country", - "input-param": true, - "property": { - "type": "string" - }, - "dictionary-name": "country", - "dictionary-source": "db", - "dependencies": ["state"] - }, - { - "name": "state", - "input-param": true, - "property": { - "type": "string" - }, - "dictionary-name": "state", - "dictionary-source": "input", - "dependencies": [] - } -] diff --git a/ms/blueprintsprocessor/modules/services/resolution-service/src/test/resources/payload/inputs/input.json b/ms/blueprintsprocessor/modules/services/resolution-service/src/test/resources/payload/inputs/input.json deleted file mode 100644 index cd6fac12..00000000 --- a/ms/blueprintsprocessor/modules/services/resolution-service/src/test/resources/payload/inputs/input.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "api-ver": "2.00", - "originator-id": "MSO", - "request-id": "123456", - "service-instance-id": "ibcx0001vm001", - "service-type": "AVPN", - "vnf-type": "vUSP - vDBE-IPX HUB", - "vnf-id": 123456, - "service-template-name": "VRR-baseconfiguration", - "service-template-version": "1.0.0", - "action-name": "resource-assignment-action", - "group-name": "sample group name", - "bundle-id": "sample bundle id", - "bundle-mac": [ - "Sample bundle mac", - "Sample bundle mac" - ] -} diff --git a/ms/blueprintsprocessor/modules/services/resolution-service/src/test/resources/payload/requests/sample-resourceresolution-request.json b/ms/blueprintsprocessor/modules/services/resolution-service/src/test/resources/payload/requests/sample-resourceresolution-request.json deleted file mode 100644 index e8830a8a..00000000 --- a/ms/blueprintsprocessor/modules/services/resolution-service/src/test/resources/payload/requests/sample-resourceresolution-request.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "actionIdentifiers": { - "actionName": "sample-action", - "blueprintName": "sample-blurprint", - "blueprintVersion": "1.0.0", - "mode": "sync" - }, - "commonHeader": { - "flags": { - "force": true, - "ttl": 3600 - }, - "originatorId": "sdnc", - "requestId": "123456-1000", - "subRequestId": "sub-123456-1000", - "timestamp": "2012-04-23T18:25:43.511Z" - }, - "payload": { - }, - "resourceAssignments": [ - ] -} diff --git a/ms/blueprintsprocessor/modules/services/workflow-service/pom.xml b/ms/blueprintsprocessor/modules/services/workflow-service/pom.xml index 5809c06d..5caeac13 100644 --- a/ms/blueprintsprocessor/modules/services/workflow-service/pom.xml +++ b/ms/blueprintsprocessor/modules/services/workflow-service/pom.xml @@ -38,6 +38,27 @@ org.onap.ccsdk.sli.core sli-provider + + + org.powermock + powermock-api-mockito2 + test + + + org.springframework.boot + spring-boot-starter-test + test + + + org.jetbrains.kotlin + kotlin-test-junit + test + + + io.projectreactor + reactor-test + test + diff --git a/ms/blueprintsprocessor/modules/services/workflow-service/src/test/resources/logback.xml b/ms/blueprintsprocessor/modules/services/workflow-service/src/test/resources/logback.xml new file mode 100644 index 00000000..a816a06c --- /dev/null +++ b/ms/blueprintsprocessor/modules/services/workflow-service/src/test/resources/logback.xml @@ -0,0 +1,35 @@ + + + + + + + %d{HH:mm:ss.SSS} %-5level %logger{100} - %msg%n + + + + + + + + + + + + + diff --git a/ms/blueprintsprocessor/parent/pom.xml b/ms/blueprintsprocessor/parent/pom.xml index a53ea2df..761fdc72 100644 --- a/ms/blueprintsprocessor/parent/pom.xml +++ b/ms/blueprintsprocessor/parent/pom.xml @@ -32,13 +32,15 @@ 2.0.6.RELEASE 5.0.10.RELEASE - 1.3.0 + 1.3.10 + 1.3.0 1.0.1 1.0.0 0.3.1 26.0-jre 2.9.2 1.4.197 + 1.2.2 1.7.4 @@ -58,6 +60,11 @@ eelf-core ${eelf.version} + + org.onap.logging-analytics + logging-slf4j + ${onap.logger.slf4j} + @@ -124,6 +131,10 @@ org.mariadb.jdbc * + + org.powermock + * + @@ -144,11 +155,6 @@ core ${project.version} - - org.onap.ccsdk.apps.blueprintsprocessor - db-service - ${project.version} - org.onap.ccsdk.apps.blueprintsprocessor execution-service @@ -161,17 +167,19 @@ org.onap.ccsdk.apps.blueprintsprocessor - resolution-service + resource-api ${project.version} org.onap.ccsdk.apps.blueprintsprocessor - resource-api + selfservice-api ${project.version} + + - org.onap.ccsdk.apps.blueprintsprocessor - selfservice-api + org.onap.ccsdk.apps.blueprintsprocessor.functions + resource-resolution ${project.version} @@ -226,6 +234,7 @@ com.h2database h2 ${h2database.version} + test @@ -242,20 +251,60 @@ - - + + + com.att.eelf + eelf-core + - org.onap.ccsdk.apps.controllerblueprints - resource-dict + org.onap.logging-analytics + logging-slf4j + + + org.apache.commons + commons-lang3 + + + commons-collections + commons-collections + + + commons-io + commons-io + + + com.jayway.jsonpath + json-path + + + io.springfox + springfox-swagger2 + + + io.springfox + springfox-swagger-ui + + + org.jetbrains.kotlin + kotlin-stdlib + + + org.jetbrains.kotlin + kotlin-stdlib-jdk8 + + + com.fasterxml.jackson.module + jackson-module-kotlin + org.jetbrains.kotlin kotlin-maven-plugin - ${kotlin.version} + ${kotlin.maven.version} compile diff --git a/ms/blueprintsprocessor/pom.xml b/ms/blueprintsprocessor/pom.xml index 740407dc..4e119b77 100644 --- a/ms/blueprintsprocessor/pom.xml +++ b/ms/blueprintsprocessor/pom.xml @@ -43,6 +43,7 @@ parent modules + functions application diff --git a/ms/controllerblueprints/parent/pom.xml b/ms/controllerblueprints/parent/pom.xml index 76ea4dcb..e69a947b 100644 --- a/ms/controllerblueprints/parent/pom.xml +++ b/ms/controllerblueprints/parent/pom.xml @@ -30,7 +30,8 @@ 2.0.6.RELEASE 5.0.10.RELEASE - 1.3.0 + 1.3.10 + 1.3.0 1.0.1 1.0.0 26.0-jre @@ -126,8 +127,6 @@ ${kotlin.version} - - com.h2database @@ -240,7 +239,7 @@ kotlin-maven-plugin org.jetbrains.kotlin - ${kotlin.version} + ${kotlin.maven.version} compile -- cgit 1.2.3-korg