diff options
author | Dan Timoney <dtimoney@att.com> | 2019-09-04 15:44:22 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-09-04 15:44:22 +0000 |
commit | e0d9599425f68a331f3b2f7ee4b84a244aba5657 (patch) | |
tree | 89355d6a78e21c6144d8d3f5ea581a0172057d1a /ms | |
parent | f2a6a305dc53624d598de6492deb8ff7869b2c00 (diff) | |
parent | 9039b516eaa55a08d2f97ef290c17de781e13ae2 (diff) |
Merge "Refactor handlers, services to designer api."
Diffstat (limited to 'ms')
38 files changed, 665 insertions, 650 deletions
diff --git a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/BlueprintModelController.kt b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/BlueprintModelController.kt index 26420cc56..f67ed25c3 100644 --- a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/BlueprintModelController.kt +++ b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/BlueprintModelController.kt @@ -20,6 +20,7 @@ package org.onap.ccsdk.cds.blueprintsprocessor.designer.api import kotlinx.coroutines.runBlocking import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintException import org.onap.ccsdk.cds.blueprintsprocessor.db.primary.domain.BlueprintModelSearch +import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.handler.BluePrintModelHandler import org.springframework.core.io.Resource import org.springframework.http.MediaType import org.springframework.http.ResponseEntity diff --git a/ms/controllerblueprints/modules/service/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/service/controller/ControllerBlueprintExceptionHandler.kt b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/ControllerBlueprintExceptionHandler.kt index 4537dbb9d..f4dabcded 100644 --- a/ms/controllerblueprints/modules/service/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/service/controller/ControllerBlueprintExceptionHandler.kt +++ b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/ControllerBlueprintExceptionHandler.kt @@ -14,9 +14,8 @@ * limitations under the License. */ -package org.onap.ccsdk.cds.controllerblueprints.service.controller +package org.onap.ccsdk.cds.blueprintsprocessor.designer.api -import org.springframework.web.bind.annotation.RestControllerAdvice import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintException import org.onap.ccsdk.cds.controllerblueprints.core.data.ErrorCode import org.onap.ccsdk.cds.controllerblueprints.service.common.ErrorMessage @@ -24,6 +23,7 @@ import org.slf4j.LoggerFactory import org.springframework.http.HttpStatus import org.springframework.http.ResponseEntity import org.springframework.web.bind.annotation.ExceptionHandler +import org.springframework.web.bind.annotation.RestControllerAdvice /** * ControllerBlueprintExceptionHandler Purpose: Handle exceptions in controllerBlueprint API and provide the right @@ -41,7 +41,7 @@ open class ControllerBlueprintExceptionHandler { @ExceptionHandler fun ControllerBlueprintExceptionHandler(e: BluePrintException): ResponseEntity<ErrorMessage> { - var errorCode = ErrorCode.valueOf(e.code) + val errorCode = ErrorCode.valueOf(e.code) val errorMessage = ErrorMessage(errorCode?.message(e.message!!), errorCode?.value, "ControllerBluePrint_Error_Message") LOG.error("Error: $errorCode ${e.message}") return ResponseEntity(errorMessage, HttpStatus.resolve(errorCode!!.httpCode)) @@ -49,7 +49,7 @@ open class ControllerBlueprintExceptionHandler { @ExceptionHandler fun ControllerBlueprintExceptionHandler(e: Exception): ResponseEntity<ErrorMessage> { - var errorCode = ErrorCode.GENERIC_FAILURE + val errorCode = ErrorCode.GENERIC_FAILURE val errorMessage = ErrorMessage(errorCode?.message(e.message!!), errorCode?.value, "ControllerBluePrint_Error_Message") LOG.error("Error: $errorCode ${e.message}") return ResponseEntity(errorMessage, HttpStatus.resolve(errorCode!!.httpCode)) diff --git a/ms/controllerblueprints/modules/service/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/service/controller/ModelTypeController.kt b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/ModelTypeController.kt index 341d63bf0..4c2ec6aa9 100644 --- a/ms/controllerblueprints/modules/service/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/service/controller/ModelTypeController.kt +++ b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/ModelTypeController.kt @@ -15,12 +15,12 @@ * limitations under the License. */ -package org.onap.ccsdk.cds.controllerblueprints.service.controller +package org.onap.ccsdk.cds.blueprintsprocessor.designer.api +import kotlinx.coroutines.runBlocking +import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.handler.ModelTypeHandler import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintException import org.onap.ccsdk.cds.controllerblueprints.service.domain.ModelType -import org.onap.ccsdk.cds.controllerblueprints.service.handler.ModelTypeHandler -import kotlinx.coroutines.runBlocking import org.springframework.http.MediaType import org.springframework.web.bind.annotation.* diff --git a/ms/controllerblueprints/modules/service/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/service/controller/ResourceDictionaryController.kt b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/ResourceDictionaryController.kt index d728fc229..89744dd2f 100644 --- a/ms/controllerblueprints/modules/service/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/service/controller/ResourceDictionaryController.kt +++ b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/ResourceDictionaryController.kt @@ -14,13 +14,13 @@ * limitations under the License. */ -package org.onap.ccsdk.cds.controllerblueprints.service.controller +package org.onap.ccsdk.cds.blueprintsprocessor.designer.api +import kotlinx.coroutines.runBlocking +import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.handler.ResourceDictionaryHandler import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintException import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResourceSourceMapping import org.onap.ccsdk.cds.controllerblueprints.service.domain.ResourceDictionary -import org.onap.ccsdk.cds.controllerblueprints.service.handler.ResourceDictionaryHandler -import kotlinx.coroutines.runBlocking import org.springframework.http.MediaType import org.springframework.web.bind.annotation.* diff --git a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/BluePrintArtifactDefinitionEnhancerImpl.kt b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/BluePrintArtifactDefinitionEnhancerImpl.kt index b4c658f92..552339be9 100644 --- a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/BluePrintArtifactDefinitionEnhancerImpl.kt +++ b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/BluePrintArtifactDefinitionEnhancerImpl.kt @@ -16,6 +16,7 @@ package org.onap.ccsdk.cds.blueprintsprocessor.designer.api.enhancer +import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.utils.BluePrintEnhancerUtils import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintException import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException import org.onap.ccsdk.cds.controllerblueprints.core.asJsonPrimitive @@ -28,7 +29,6 @@ import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintContext import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintRuntimeService import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResourceAssignment -import org.onap.ccsdk.cds.controllerblueprints.service.utils.BluePrintEnhancerUtils import org.springframework.stereotype.Service @Service diff --git a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/BluePrintAttributeDefinitionEnhancerImpl.kt b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/BluePrintAttributeDefinitionEnhancerImpl.kt index e018b9d7f..0b64ed503 100644 --- a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/BluePrintAttributeDefinitionEnhancerImpl.kt +++ b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/BluePrintAttributeDefinitionEnhancerImpl.kt @@ -16,6 +16,7 @@ package org.onap.ccsdk.cds.blueprintsprocessor.designer.api.enhancer +import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.utils.BluePrintEnhancerUtils import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintException import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintTypes import org.onap.ccsdk.cds.controllerblueprints.core.data.AttributeDefinition @@ -24,7 +25,6 @@ import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintRepoServ import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintTypeEnhancerService import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintContext import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintRuntimeService -import org.onap.ccsdk.cds.controllerblueprints.service.utils.BluePrintEnhancerUtils class BluePrintAttributeDefinitionEnhancerImpl(private val bluePrintRepoService: BluePrintRepoService, private val bluePrintTypeEnhancerService: BluePrintTypeEnhancerService) diff --git a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/BluePrintNodeTemplateEnhancerImpl.kt b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/BluePrintNodeTemplateEnhancerImpl.kt index acee7c076..723d7bb27 100644 --- a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/BluePrintNodeTemplateEnhancerImpl.kt +++ b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/BluePrintNodeTemplateEnhancerImpl.kt @@ -17,6 +17,7 @@ package org.onap.ccsdk.cds.blueprintsprocessor.designer.api.enhancer +import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.utils.BluePrintEnhancerUtils import org.onap.ccsdk.cds.controllerblueprints.core.data.NodeTemplate import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintNodeTemplateEnhancer import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintRepoService @@ -24,7 +25,6 @@ import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintTypeEnha import org.onap.ccsdk.cds.controllerblueprints.core.logger import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintContext import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintRuntimeService -import org.onap.ccsdk.cds.controllerblueprints.service.utils.BluePrintEnhancerUtils import org.springframework.beans.factory.config.ConfigurableBeanFactory import org.springframework.context.annotation.Scope import org.springframework.stereotype.Service diff --git a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/BluePrintNodeTypeEnhancerImpl.kt b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/BluePrintNodeTypeEnhancerImpl.kt index 05cfa5a14..efb695b22 100644 --- a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/BluePrintNodeTypeEnhancerImpl.kt +++ b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/BluePrintNodeTypeEnhancerImpl.kt @@ -16,6 +16,7 @@ package org.onap.ccsdk.cds.blueprintsprocessor.designer.api.enhancer +import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.utils.BluePrintEnhancerUtils import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintException import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintTypes import org.onap.ccsdk.cds.controllerblueprints.core.data.InterfaceDefinition @@ -27,7 +28,6 @@ import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintTypeEnha import org.onap.ccsdk.cds.controllerblueprints.core.logger import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintContext import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintRuntimeService -import org.onap.ccsdk.cds.controllerblueprints.service.utils.BluePrintEnhancerUtils import org.springframework.beans.factory.config.ConfigurableBeanFactory import org.springframework.context.annotation.Scope import org.springframework.stereotype.Service diff --git a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/BluePrintPropertyDefinitionEnhancerImpl.kt b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/BluePrintPropertyDefinitionEnhancerImpl.kt index 62812c0fa..b87cf9c6b 100644 --- a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/BluePrintPropertyDefinitionEnhancerImpl.kt +++ b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/BluePrintPropertyDefinitionEnhancerImpl.kt @@ -17,6 +17,7 @@ package org.onap.ccsdk.cds.blueprintsprocessor.designer.api.enhancer +import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.utils.BluePrintEnhancerUtils import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintException import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintTypes import org.onap.ccsdk.cds.controllerblueprints.core.data.PropertyDefinition @@ -25,7 +26,6 @@ import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintRepoServ import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintTypeEnhancerService import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintContext import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintRuntimeService -import org.onap.ccsdk.cds.controllerblueprints.service.utils.BluePrintEnhancerUtils import org.springframework.beans.factory.config.ConfigurableBeanFactory import org.springframework.context.annotation.Scope import org.springframework.stereotype.Service diff --git a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/ResourceAssignmentEnhancerService.kt b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/ResourceAssignmentEnhancerService.kt index e4db71904..55eb42f89 100644 --- a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/ResourceAssignmentEnhancerService.kt +++ b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/ResourceAssignmentEnhancerService.kt @@ -25,7 +25,7 @@ import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResourceAssignment import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResourceDefinition import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResourceDictionaryConstants import org.onap.ccsdk.cds.controllerblueprints.resource.dict.factory.ResourceSourceMappingFactory -import org.onap.ccsdk.cds.controllerblueprints.service.ResourceDefinitionRepoService +import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.service.ResourceDefinitionRepoService import org.springframework.beans.factory.config.ConfigurableBeanFactory import org.springframework.context.annotation.Scope import org.springframework.stereotype.Service diff --git a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/ResourceDefinitionEnhancerService.kt b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/ResourceDefinitionEnhancerService.kt index d3907946e..c018664e4 100644 --- a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/ResourceDefinitionEnhancerService.kt +++ b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/enhancer/ResourceDefinitionEnhancerService.kt @@ -28,8 +28,8 @@ import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintRuntimeServ import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResourceAssignment import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResourceDefinition import org.onap.ccsdk.cds.controllerblueprints.resource.dict.utils.ResourceDictionaryUtils -import org.onap.ccsdk.cds.controllerblueprints.service.ResourceDefinitionRepoService -import org.onap.ccsdk.cds.controllerblueprints.service.utils.BluePrintEnhancerUtils +import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.service.ResourceDefinitionRepoService +import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.utils.BluePrintEnhancerUtils import org.springframework.stereotype.Service interface ResourceDefinitionEnhancerService { diff --git a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/BluePrintModelHandler.kt b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/handler/BluePrintModelHandler.kt index 3a68951db..44b0c4bc8 100644 --- a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/BluePrintModelHandler.kt +++ b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/handler/BluePrintModelHandler.kt @@ -16,19 +16,19 @@ * limitations under the License. */ -package org.onap.ccsdk.cds.blueprintsprocessor.designer.api +package org.onap.ccsdk.cds.blueprintsprocessor.designer.api.handler import org.onap.ccsdk.cds.blueprintsprocessor.db.primary.domain.BlueprintModel import org.onap.ccsdk.cds.blueprintsprocessor.db.primary.domain.BlueprintModelSearch import org.onap.ccsdk.cds.blueprintsprocessor.db.primary.repository.ControllerBlueprintModelContentRepository import org.onap.ccsdk.cds.blueprintsprocessor.db.primary.repository.ControllerBlueprintModelRepository import org.onap.ccsdk.cds.blueprintsprocessor.db.primary.repository.ControllerBlueprintModelSearchRepository +import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.utils.BluePrintEnhancerUtils import org.onap.ccsdk.cds.controllerblueprints.core.* import org.onap.ccsdk.cds.controllerblueprints.core.config.BluePrintLoadConfiguration import org.onap.ccsdk.cds.controllerblueprints.core.data.ErrorCode import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintCatalogService import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintEnhancerService -import org.onap.ccsdk.cds.controllerblueprints.service.utils.BluePrintEnhancerUtils import org.slf4j.LoggerFactory import org.springframework.core.io.ByteArrayResource import org.springframework.core.io.Resource diff --git a/ms/controllerblueprints/modules/service/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/service/handler/ModelTypeHandler.kt b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/handler/ModelTypeHandler.kt index d68fdd025..034c40774 100644 --- a/ms/controllerblueprints/modules/service/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/service/handler/ModelTypeHandler.kt +++ b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/handler/ModelTypeHandler.kt @@ -15,12 +15,12 @@ * limitations under the License. */ -package org.onap.ccsdk.cds.controllerblueprints.service.handler +package org.onap.ccsdk.cds.blueprintsprocessor.designer.api.handler +import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.repository.ModelTypeRepository +import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.utils.ModelTypeValidator import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintException import org.onap.ccsdk.cds.controllerblueprints.service.domain.ModelType -import org.onap.ccsdk.cds.controllerblueprints.service.repository.ModelTypeRepository -import org.onap.ccsdk.cds.controllerblueprints.service.validator.ModelTypeValidator import org.slf4j.LoggerFactory import org.springframework.stereotype.Service diff --git a/ms/controllerblueprints/modules/service/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/service/handler/ResourceDictionaryHandler.kt b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/handler/ResourceDictionaryHandler.kt index e339bcd68..a7e8f2011 100644 --- a/ms/controllerblueprints/modules/service/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/service/handler/ResourceDictionaryHandler.kt +++ b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/handler/ResourceDictionaryHandler.kt @@ -15,17 +15,17 @@ * limitations under the License. */ -package org.onap.ccsdk.cds.controllerblueprints.service.handler +package org.onap.ccsdk.cds.blueprintsprocessor.designer.api.handler import com.google.common.base.Preconditions import org.apache.commons.collections.CollectionUtils import org.apache.commons.lang3.StringUtils +import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.repository.ResourceDictionaryRepository import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintException import org.onap.ccsdk.cds.controllerblueprints.core.checkNotEmpty import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResourceSourceMapping import org.onap.ccsdk.cds.controllerblueprints.resource.dict.factory.ResourceSourceMappingFactory import org.onap.ccsdk.cds.controllerblueprints.service.domain.ResourceDictionary -import org.onap.ccsdk.cds.controllerblueprints.service.repository.ResourceDictionaryRepository import org.springframework.stereotype.Service @Service diff --git a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/load/ModelTypeLoadService.kt b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/load/ModelTypeLoadService.kt index 9d1eaff33..1434bccb4 100644 --- a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/load/ModelTypeLoadService.kt +++ b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/load/ModelTypeLoadService.kt @@ -22,6 +22,7 @@ import kotlinx.coroutines.awaitAll import kotlinx.coroutines.coroutineScope import org.apache.commons.io.FilenameUtils import org.apache.commons.lang3.text.StrBuilder +import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.handler.ModelTypeHandler import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintException import org.onap.ccsdk.cds.controllerblueprints.core.data.* @@ -29,7 +30,6 @@ import org.onap.ccsdk.cds.controllerblueprints.core.normalizedFile import org.onap.ccsdk.cds.controllerblueprints.core.readNBText import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils import org.onap.ccsdk.cds.controllerblueprints.service.domain.ModelType -import org.onap.ccsdk.cds.controllerblueprints.service.handler.ModelTypeHandler import org.slf4j.LoggerFactory import org.springframework.stereotype.Service import java.io.File diff --git a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/load/ResourceDictionaryLoadService.kt b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/load/ResourceDictionaryLoadService.kt index 308c08f82..14dc4473a 100644 --- a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/load/ResourceDictionaryLoadService.kt +++ b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/load/ResourceDictionaryLoadService.kt @@ -22,13 +22,13 @@ import kotlinx.coroutines.awaitAll import kotlinx.coroutines.coroutineScope import org.apache.commons.lang3.StringUtils import org.apache.commons.lang3.text.StrBuilder +import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.handler.ResourceDictionaryHandler import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintException import org.onap.ccsdk.cds.controllerblueprints.core.normalizedFile import org.onap.ccsdk.cds.controllerblueprints.core.readNBText import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResourceDefinition import org.onap.ccsdk.cds.controllerblueprints.service.domain.ResourceDictionary -import org.onap.ccsdk.cds.controllerblueprints.service.handler.ResourceDictionaryHandler import org.slf4j.LoggerFactory import org.springframework.stereotype.Service import java.io.File diff --git a/ms/controllerblueprints/modules/service/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/service/repository/BluePrintsReactRepository.kt b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/repository/BluePrintsReactRepository.kt index 0041fa7c8..78175724f 100644 --- a/ms/controllerblueprints/modules/service/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/service/repository/BluePrintsReactRepository.kt +++ b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/repository/BluePrintsReactRepository.kt @@ -1,5 +1,5 @@ /* - * Copyright © 2018 IBM. + * Copyright © 2019 IBM. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,14 +14,14 @@ * limitations under the License. */ -package org.onap.ccsdk.cds.controllerblueprints.service.repository +package org.onap.ccsdk.cds.blueprintsprocessor.designer.api.repository import org.onap.ccsdk.cds.controllerblueprints.service.domain.ModelType import org.springframework.stereotype.Service import reactor.core.publisher.Flux import reactor.core.publisher.Mono import reactor.core.scheduler.Schedulers - +// TODO("Convert into coroutines") /** * ModelTypeReactRepository. * diff --git a/ms/controllerblueprints/modules/service/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/service/repository/ModelTypeRepository.kt b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/repository/ModelTypeRepository.kt index 4fefc8144..82dc89c3e 100644 --- a/ms/controllerblueprints/modules/service/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/service/repository/ModelTypeRepository.kt +++ b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/repository/ModelTypeRepository.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.onap.ccsdk.cds.controllerblueprints.service.repository +package org.onap.ccsdk.cds.blueprintsprocessor.designer.api.repository import org.onap.ccsdk.cds.controllerblueprints.service.domain.ModelType import org.springframework.data.jpa.repository.JpaRepository diff --git a/ms/controllerblueprints/modules/service/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/service/repository/ResourceDictionaryRepository.kt b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/repository/ResourceDictionaryRepository.kt index b1b633a10..ccd91b84d 100644 --- a/ms/controllerblueprints/modules/service/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/service/repository/ResourceDictionaryRepository.kt +++ b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/repository/ResourceDictionaryRepository.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.onap.ccsdk.cds.controllerblueprints.service.repository +package org.onap.ccsdk.cds.blueprintsprocessor.designer.api.repository import org.onap.ccsdk.cds.controllerblueprints.service.domain.ResourceDictionary import org.springframework.data.jpa.repository.JpaRepository diff --git a/ms/controllerblueprints/modules/service/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/service/AutoResourceMappingService.kt b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/service/AutoResourceMappingService.kt index 3ab9fee58..56bd01e11 100644 --- a/ms/controllerblueprints/modules/service/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/service/AutoResourceMappingService.kt +++ b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/service/AutoResourceMappingService.kt @@ -15,18 +15,18 @@ * limitations under the License. */ -package org.onap.ccsdk.cds.controllerblueprints.service +package org.onap.ccsdk.cds.blueprintsprocessor.designer.api.service import com.google.common.base.Preconditions import org.apache.commons.collections.CollectionUtils import org.apache.commons.lang3.StringUtils +import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.repository.ResourceDictionaryRepository import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintException import org.onap.ccsdk.cds.controllerblueprints.core.data.PropertyDefinition import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResourceAssignment import org.onap.ccsdk.cds.controllerblueprints.resource.dict.utils.ResourceDictionaryUtils import org.onap.ccsdk.cds.controllerblueprints.service.domain.ResourceDictionary import org.onap.ccsdk.cds.controllerblueprints.service.model.AutoMapResponse -import org.onap.ccsdk.cds.controllerblueprints.service.repository.ResourceDictionaryRepository import org.slf4j.LoggerFactory import org.springframework.stereotype.Service import java.util.* diff --git a/ms/controllerblueprints/modules/service/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/service/BluePrintRepoServiceImpl.kt b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/service/BluePrintRepoServiceImpl.kt index e1fa1882d..f8e6163a5 100644 --- a/ms/controllerblueprints/modules/service/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/service/BluePrintRepoServiceImpl.kt +++ b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/service/BluePrintRepoServiceImpl.kt @@ -15,18 +15,18 @@ * limitations under the License. */ -package org.onap.ccsdk.cds.controllerblueprints.service +package org.onap.ccsdk.cds.blueprintsprocessor.designer.api.service import com.fasterxml.jackson.databind.JsonNode import com.google.common.base.Preconditions import org.apache.commons.lang3.StringUtils +import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.repository.ModelTypeRepository +import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.repository.ResourceDictionaryRepository import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintException import org.onap.ccsdk.cds.controllerblueprints.core.data.* import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintRepoService import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResourceDefinition -import org.onap.ccsdk.cds.controllerblueprints.service.repository.ModelTypeRepository -import org.onap.ccsdk.cds.controllerblueprints.service.repository.ResourceDictionaryRepository import org.springframework.stereotype.Service interface ResourceDefinitionRepoService : BluePrintRepoService { diff --git a/ms/controllerblueprints/modules/service/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/service/utils/BluePrintEnhancerUtils.kt b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/utils/BluePrintEnhancerUtils.kt index 97b9a813a..6eab5cd3f 100644 --- a/ms/controllerblueprints/modules/service/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/service/utils/BluePrintEnhancerUtils.kt +++ b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/utils/BluePrintEnhancerUtils.kt @@ -16,7 +16,7 @@ * limitations under the License. */ -package org.onap.ccsdk.cds.controllerblueprints.service.utils +package org.onap.ccsdk.cds.blueprintsprocessor.designer.api.utils import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.reactive.awaitSingle diff --git a/ms/controllerblueprints/modules/service/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/service/validator/ModelTypeValidator.kt b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/utils/ModelTypeValidator.kt index 9bfb29c23..7d6644219 100644 --- a/ms/controllerblueprints/modules/service/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/service/validator/ModelTypeValidator.kt +++ b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/utils/ModelTypeValidator.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.onap.ccsdk.cds.controllerblueprints.service.validator +package org.onap.ccsdk.cds.blueprintsprocessor.designer.api.utils import com.fasterxml.jackson.databind.JsonNode import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants diff --git a/ms/controllerblueprints/modules/service/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/service/controller/ModelTypeControllerTest.kt b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/ModelTypeControllerTest.kt index 4af8851a5..6d3b3da4a 100644 --- a/ms/controllerblueprints/modules/service/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/service/controller/ModelTypeControllerTest.kt +++ b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/ModelTypeControllerTest.kt @@ -14,27 +14,30 @@ * limitations under the License. */ -package org.onap.ccsdk.cds.controllerblueprints.service.controller +package org.onap.ccsdk.cds.blueprintsprocessor.designer.api import org.junit.Assert import org.junit.FixMethodOrder import org.junit.Test import org.junit.runner.RunWith import org.junit.runners.MethodSorters -import org.onap.ccsdk.cds.controllerblueprints.TestApplication +import org.onap.ccsdk.cds.blueprintsprocessor.core.BluePrintProperties +import org.onap.ccsdk.cds.blueprintsprocessor.core.BlueprintPropertyConfiguration +import org.onap.ccsdk.cds.blueprintsprocessor.db.BluePrintDBLibConfiguration import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils import org.onap.ccsdk.cds.controllerblueprints.service.domain.ModelType import org.slf4j.LoggerFactory import org.springframework.beans.factory.annotation.Autowired -import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest import org.springframework.test.annotation.Commit import org.springframework.test.context.ContextConfiguration +import org.springframework.test.context.TestPropertySource import org.springframework.test.context.junit4.SpringRunner @RunWith(SpringRunner::class) -@DataJpaTest -@ContextConfiguration(classes = [TestApplication::class]) +@ContextConfiguration(classes = [DesignerApiTestConfiguration::class, + BlueprintPropertyConfiguration::class, BluePrintProperties::class, BluePrintDBLibConfiguration::class]) +@TestPropertySource(locations = ["classpath:application-test.properties"]) @FixMethodOrder(MethodSorters.NAME_ASCENDING) class ModelTypeControllerTest { diff --git a/ms/controllerblueprints/modules/service/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/service/controller/ResourceDictionaryControllerTest.kt b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/ResourceDictionaryControllerTest.kt index cf139ec00..893622308 100644 --- a/ms/controllerblueprints/modules/service/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/service/controller/ResourceDictionaryControllerTest.kt +++ b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/ResourceDictionaryControllerTest.kt @@ -14,22 +14,28 @@ * limitations under the License. */ -package org.onap.ccsdk.cds.controllerblueprints.service.controller +package org.onap.ccsdk.cds.blueprintsprocessor.designer.api +import org.junit.FixMethodOrder import org.junit.Test import org.junit.runner.RunWith -import org.onap.ccsdk.cds.controllerblueprints.TestApplication +import org.junit.runners.MethodSorters +import org.onap.ccsdk.cds.blueprintsprocessor.core.BluePrintProperties +import org.onap.ccsdk.cds.blueprintsprocessor.core.BlueprintPropertyConfiguration +import org.onap.ccsdk.cds.blueprintsprocessor.db.BluePrintDBLibConfiguration import org.springframework.beans.factory.annotation.Autowired import org.springframework.boot.test.context.SpringBootTest -import org.springframework.context.annotation.ComponentScan import org.springframework.test.context.ContextConfiguration +import org.springframework.test.context.TestPropertySource import org.springframework.test.context.junit4.SpringRunner import kotlin.test.assertNotNull @RunWith(SpringRunner::class) -@ContextConfiguration(classes = [TestApplication::class]) @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) -@ComponentScan(basePackages = ["org.onap.ccsdk.cds.controllerblueprints"]) +@ContextConfiguration(classes = [DesignerApiTestConfiguration::class, + BlueprintPropertyConfiguration::class, BluePrintProperties::class, BluePrintDBLibConfiguration::class]) +@TestPropertySource(locations = ["classpath:application-test.properties"]) +@FixMethodOrder(MethodSorters.NAME_ASCENDING) class ResourceDictionaryControllerTest { @Autowired diff --git a/ms/controllerblueprints/modules/service/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/service/ModelTypeServiceTest.kt b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/handler/ModelTypeServiceTest.kt index e55f2a511..31ae54036 100644 --- a/ms/controllerblueprints/modules/service/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/service/ModelTypeServiceTest.kt +++ b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/handler/ModelTypeServiceTest.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.onap.ccsdk.cds.controllerblueprints.service +package org.onap.ccsdk.cds.blueprintsprocessor.designer.api.handler import kotlinx.coroutines.runBlocking import org.junit.Assert @@ -22,25 +22,25 @@ import org.junit.FixMethodOrder import org.junit.Test import org.junit.runner.RunWith import org.junit.runners.MethodSorters -import org.onap.ccsdk.cds.controllerblueprints.TestApplication +import org.onap.ccsdk.cds.blueprintsprocessor.core.BluePrintProperties +import org.onap.ccsdk.cds.blueprintsprocessor.core.BlueprintPropertyConfiguration +import org.onap.ccsdk.cds.blueprintsprocessor.db.BluePrintDBLibConfiguration +import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.DesignerApiTestConfiguration import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils import org.onap.ccsdk.cds.controllerblueprints.service.domain.ModelType -import org.onap.ccsdk.cds.controllerblueprints.service.handler.ModelTypeHandler import org.slf4j.LoggerFactory import org.springframework.beans.factory.annotation.Autowired -import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest import org.springframework.test.annotation.Commit import org.springframework.test.context.ContextConfiguration +import org.springframework.test.context.TestPropertySource import org.springframework.test.context.junit4.SpringRunner -import org.springframework.transaction.annotation.Propagation -import org.springframework.transaction.annotation.Transactional @RunWith(SpringRunner::class) -@DataJpaTest -@Transactional(propagation = Propagation.NOT_SUPPORTED) -@ContextConfiguration(classes = [TestApplication::class]) +@ContextConfiguration(classes = [DesignerApiTestConfiguration::class, + BlueprintPropertyConfiguration::class, BluePrintProperties::class, BluePrintDBLibConfiguration::class]) +@TestPropertySource(locations = ["classpath:application-test.properties"]) @FixMethodOrder(MethodSorters.NAME_ASCENDING) class ModelTypeServiceTest { @Autowired diff --git a/ms/controllerblueprints/modules/service/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/service/controller/mock/MockFilePart.kt b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/mock/MockFilePart.kt index 2fb2129ae..3165a6e2f 100644 --- a/ms/controllerblueprints/modules/service/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/service/controller/mock/MockFilePart.kt +++ b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/mock/MockFilePart.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.onap.ccsdk.cds.controllerblueprints.service.controller.mock +package org.onap.ccsdk.cds.blueprintsprocessor.designer.api.mock import org.apache.commons.io.FilenameUtils import org.slf4j.LoggerFactory diff --git a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/repository/ModelTypeReactRepositoryTest.kt b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/repository/ModelTypeReactRepositoryTest.kt new file mode 100644 index 000000000..7adc1c963 --- /dev/null +++ b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/repository/ModelTypeReactRepositoryTest.kt @@ -0,0 +1,110 @@ +/* + * Copyright © 2019 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.cds.blueprintsprocessor.designer.api.repository + +import org.junit.Assert +import org.junit.FixMethodOrder +import org.junit.Test +import org.junit.runner.RunWith +import org.junit.runners.MethodSorters +import org.onap.ccsdk.cds.blueprintsprocessor.core.BluePrintProperties +import org.onap.ccsdk.cds.blueprintsprocessor.core.BlueprintPropertyConfiguration +import org.onap.ccsdk.cds.blueprintsprocessor.db.BluePrintDBLibConfiguration +import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.DesignerApiTestConfiguration +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants +import org.onap.ccsdk.cds.controllerblueprints.core.normalizedFile +import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils +import org.onap.ccsdk.cds.controllerblueprints.service.domain.ModelType +import org.springframework.beans.factory.annotation.Autowired +import org.springframework.test.annotation.Commit +import org.springframework.test.context.ContextConfiguration +import org.springframework.test.context.TestPropertySource +import org.springframework.test.context.junit4.SpringRunner +import java.nio.charset.Charset +import java.util.* + +/** + * ModelTypeReactRepositoryTest. + * + * @author Brinda Santh + */ + +@RunWith(SpringRunner::class) +@ContextConfiguration(classes = [DesignerApiTestConfiguration::class, + BlueprintPropertyConfiguration::class, BluePrintProperties::class, BluePrintDBLibConfiguration::class]) +@TestPropertySource(locations = ["classpath:application-test.properties"]) +@FixMethodOrder(MethodSorters.NAME_ASCENDING) +class ModelTypeReactRepositoryTest { + + @Autowired + private val modelTypeReactRepository: ModelTypeReactRepository? = null + + internal var modelName = "test-datatype" + + @Test + @Commit + fun test01Save() { + val content = normalizedFile("./src/test/resources/model_type/data_type/datatype-property.json") + .readText(Charset.defaultCharset()) + val modelType = ModelType() + modelType.definitionType = BluePrintConstants.MODEL_DEFINITION_TYPE_DATA_TYPE + modelType.derivedFrom = BluePrintConstants.MODEL_TYPE_DATATYPES_ROOT + modelType.description = "Definition for Sample Datatype " + modelType.definition = JacksonUtils.jsonNode(content) + modelType.modelName = modelName + modelType.version = "1.0.0" + modelType.tags = ("test-datatype ," + BluePrintConstants.MODEL_TYPE_DATATYPES_ROOT + "," + + BluePrintConstants.MODEL_DEFINITION_TYPE_DATA_TYPE) + modelType.updatedBy = "xxxxxx@xxx.com" + + val dbModelType = modelTypeReactRepository!!.save(modelType).block() + Assert.assertNotNull("Failed to get Saved ModelType", dbModelType) + } + + @Test + fun test02Finds() { + val dbFindByModelName = modelTypeReactRepository!!.findByModelName(modelName).block() + Assert.assertNotNull("Failed to findByModelName ", dbFindByModelName) + + val dbFindByDefinitionType = modelTypeReactRepository.findByDefinitionType(BluePrintConstants.MODEL_DEFINITION_TYPE_DATA_TYPE).collectList().block() + Assert.assertNotNull("Failed to findByDefinitionType ", dbFindByDefinitionType) + Assert.assertTrue("Failed to findByDefinitionType count", dbFindByDefinitionType!!.size > 0) + + val dbFindByDerivedFrom = modelTypeReactRepository.findByDerivedFrom(BluePrintConstants.MODEL_TYPE_DATATYPES_ROOT).collectList().block() + Assert.assertNotNull("Failed to find findByDerivedFrom", dbFindByDerivedFrom) + Assert.assertTrue("Failed to find findByDerivedFrom by count", dbFindByDerivedFrom!!.size > 0) + + val dbFindByModelNameIn = modelTypeReactRepository.findByModelNameIn(Arrays.asList(modelName)).collectList().block() + Assert.assertNotNull("Failed to findByModelNameIn ", dbFindByModelNameIn) + Assert.assertTrue("Failed to findByModelNameIn by count", dbFindByModelNameIn!!.size > 0) + + val dbFindByDefinitionTypeIn = modelTypeReactRepository.findByDefinitionTypeIn(Arrays.asList(BluePrintConstants.MODEL_DEFINITION_TYPE_DATA_TYPE)).collectList().block() + Assert.assertNotNull("Failed to findByDefinitionTypeIn", dbFindByDefinitionTypeIn) + Assert.assertTrue("Failed to findByDefinitionTypeIn by count", dbFindByDefinitionTypeIn!!.size > 0) + + val dbFindByDerivedFromIn = modelTypeReactRepository.findByDerivedFromIn(Arrays.asList(BluePrintConstants.MODEL_TYPE_DATATYPES_ROOT)).collectList().block() + Assert.assertNotNull("Failed to find findByDerivedFromIn", dbFindByDerivedFromIn) + Assert.assertTrue("Failed to find findByDerivedFromIn by count", dbFindByDerivedFromIn!!.size > 0) + } + + @Test + @Commit + fun test03Delete() { + modelTypeReactRepository!!.deleteByModelName(modelName).block() + } + +} diff --git a/ms/controllerblueprints/modules/service/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/service/repository/ResourceDictionaryRepositoryTest.kt b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/repository/ResourceDictionaryRepositoryTest.kt index 3f52d9183..bbf1751c6 100644 --- a/ms/controllerblueprints/modules/service/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/service/repository/ResourceDictionaryRepositoryTest.kt +++ b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/repository/ResourceDictionaryRepositoryTest.kt @@ -14,27 +14,31 @@ * limitations under the License. */ -package org.onap.ccsdk.cds.controllerblueprints.service.repository +package org.onap.ccsdk.cds.blueprintsprocessor.designer.api.repository -import kotlinx.coroutines.runBlocking import org.junit.Assert import org.junit.FixMethodOrder import org.junit.Test import org.junit.runner.RunWith import org.junit.runners.MethodSorters -import org.onap.ccsdk.cds.controllerblueprints.TestApplication +import org.onap.ccsdk.cds.blueprintsprocessor.core.BluePrintProperties +import org.onap.ccsdk.cds.blueprintsprocessor.core.BlueprintPropertyConfiguration +import org.onap.ccsdk.cds.blueprintsprocessor.db.BluePrintDBLibConfiguration +import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.DesignerApiTestConfiguration import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResourceDefinition import org.onap.ccsdk.cds.controllerblueprints.service.domain.ResourceDictionary import org.springframework.beans.factory.annotation.Autowired -import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest import org.springframework.test.annotation.Commit import org.springframework.test.context.ContextConfiguration +import org.springframework.test.context.TestPropertySource import org.springframework.test.context.junit4.SpringRunner +import org.springframework.transaction.annotation.Transactional @RunWith(SpringRunner::class) -@DataJpaTest -@ContextConfiguration(classes = [TestApplication::class]) +@ContextConfiguration(classes = [DesignerApiTestConfiguration::class, + BlueprintPropertyConfiguration::class, BluePrintProperties::class, BluePrintDBLibConfiguration::class]) +@TestPropertySource(locations = ["classpath:application-test.properties"]) @FixMethodOrder(MethodSorters.NAME_ASCENDING) class ResourceDictionaryReactRepositoryTest { @@ -46,7 +50,9 @@ class ResourceDictionaryReactRepositoryTest { @Test @Commit fun test01Save() { - val resourceDefinition = JacksonUtils.readValueFromFile("./../../../../components/model-catalog/resource-dictionary/starter-dictionary/sample-db-source.json", ResourceDefinition::class.java) + val resourceDefinition = JacksonUtils + .readValueFromFile("./../../../../../components/model-catalog/resource-dictionary/starter-dictionary/sample-db-source.json", + ResourceDefinition::class.java) Assert.assertNotNull("Failed to get resourceDefinition from content", resourceDefinition) resourceDefinition!!.name = sourceName @@ -74,11 +80,10 @@ class ResourceDictionaryReactRepositoryTest { } @Test + @Transactional @Commit fun test05Delete() { - runBlocking { - resourceDictionaryRepository.deleteByName(sourceName) - } + resourceDictionaryRepository.deleteByName(sourceName) } private fun transformResourceDictionary(resourceDefinition: ResourceDefinition): ResourceDictionary { diff --git a/ms/controllerblueprints/modules/service/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/service/utils/BluePrintEnhancerUtilsTest.kt b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/utils/BluePrintEnhancerUtilsTest.kt index 100c3adeb..e34238eb9 100644 --- a/ms/controllerblueprints/modules/service/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/service/utils/BluePrintEnhancerUtilsTest.kt +++ b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/utils/BluePrintEnhancerUtilsTest.kt @@ -14,14 +14,14 @@ * limitations under the License. */ -package org.onap.ccsdk.cds.controllerblueprints.service.utils +package org.onap.ccsdk.cds.blueprintsprocessor.designer.api.utils import kotlinx.coroutines.runBlocking import org.junit.After import org.junit.Before import org.junit.Test +import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.mock.MockFilePart import org.onap.ccsdk.cds.controllerblueprints.core.* -import org.onap.ccsdk.cds.controllerblueprints.service.controller.mock.MockFilePart import java.nio.file.Paths import java.util.* import kotlin.test.assertTrue diff --git a/ms/controllerblueprints/modules/service/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/service/validator/ModelTypeValidatorTest.kt b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/utils/ModelTypeValidatorTest.kt index 728f431a7..1869acec3 100644 --- a/ms/controllerblueprints/modules/service/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/service/validator/ModelTypeValidatorTest.kt +++ b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/utils/ModelTypeValidatorTest.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.onap.ccsdk.cds.controllerblueprints.service.validator +package org.onap.ccsdk.cds.blueprintsprocessor.designer.api.utils import com.fasterxml.jackson.databind.JsonNode import org.junit.Test diff --git a/ms/controllerblueprints/modules/service/src/test/resources/enhance/enhance-resource-assignment.json b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/resources/enhance/enhance-resource-assignment.json index 631b9d901..fdf76ab44 100644 --- a/ms/controllerblueprints/modules/service/src/test/resources/enhance/enhance-resource-assignment.json +++ b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/resources/enhance/enhance-resource-assignment.json @@ -1,62 +1,62 @@ -[
- {
- "name": "rs-db-source",
- "input-param": true,
- "property": {
- "type": "string",
- "required": true
- },
- "dictionary-name": "sample-db-source",
- "dictionary-source": "processor-db",
- "dependencies": [
- "input-source"
- ]
- },
- {
- "name": "ra-default-source",
- "input-param": true,
- "property": {
- "type": "string",
- "required": true
- },
- "dictionary-name": "sample-default-source",
- "dictionary-source": "default",
- "dependencies": []
- },
- {
- "name": "ra-input-source",
- "input-param": true,
- "property": {
- "type": "string",
- "required": true
- },
- "dictionary-name": "sample-input-source",
- "dictionary-source": "input",
- "dependencies": []
- },
- {
- "name": "ra-list-input-source",
- "input-param": true,
- "property": {
- "type": "list",
- "required": true,
- "entry_schema": {
- "type": "string"
- }
- },
- "dictionary-name": "ra-list-input-source",
- "dictionary-source": "input",
- "dependencies": []
- },
- {
- "name": "ra-complex-input-source",
- "input-param": true,
- "property": {
- "type": "dt-v4-aggregate",
- "required": true
- },
- "dictionary-name": "sample-mdsal-source",
- "dictionary-source": "sdnc",
- "dependencies": []
- }
-]
+[ + { + "name": "rs-db-source", + "input-param": true, + "property": { + "type": "string", + "required": true + }, + "dictionary-name": "sample-db-source", + "dictionary-source": "processor-db", + "dependencies": [ + "input-source" + ] + }, + { + "name": "ra-default-source", + "input-param": true, + "property": { + "type": "string", + "required": true + }, + "dictionary-name": "sample-default-source", + "dictionary-source": "default", + "dependencies": [] + }, + { + "name": "ra-input-source", + "input-param": true, + "property": { + "type": "string", + "required": true + }, + "dictionary-name": "sample-input-source", + "dictionary-source": "input", + "dependencies": [] + }, + { + "name": "ra-list-input-source", + "input-param": true, + "property": { + "type": "list", + "required": true, + "entry_schema": { + "type": "string" + } + }, + "dictionary-name": "ra-list-input-source", + "dictionary-source": "input", + "dependencies": [] + }, + { + "name": "ra-complex-input-source", + "input-param": true, + "property": { + "type": "dt-v4-aggregate", + "required": true + }, + "dictionary-name": "sample-mdsal-source", + "dictionary-source": "sdnc", + "dependencies": [] + } +] diff --git a/ms/controllerblueprints/modules/service/src/test/resources/enhance/enhance-template.json b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/resources/enhance/enhance-template.json index f551b248f..3692b7dcd 100644 --- a/ms/controllerblueprints/modules/service/src/test/resources/enhance/enhance-template.json +++ b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/resources/enhance/enhance-template.json @@ -1,351 +1,351 @@ -{
- "metadata": {
- "template_author": "Brinda Santh",
- "template_name": "enhance-template",
- "template_version": "1.0.0",
- "template_tags": "brinda, VPE",
- "service-type": "Sample Service",
- "release": "1806",
- "vnf-type": "VPE"
- },
- "topology_template": {
- "inputs": {
- "request-id": {
- "required": true,
- "type": "string"
- },
- "service-instance-id": {
- "required": true,
- "type": "string"
- },
- "scope-type": {
- "required": true,
- "type": "string"
- },
- "action-name": {
- "required": true,
- "type": "string"
- },
- "hostname": {
- "required": true,
- "type": "string"
- }
- },
- "node_templates": {
- "vpe-netconf-device": {
- "capabilities": {
- "netconf": {
- "properties": {
- "login-key": "sdnc",
- "login-account": "sndc-local",
- "source": "local",
- "target-ip-address": {
- "get_attribute": [
- "SELF",
- "lo0-local-ipv4-address"
- ]
- },
- "port-number": 22,
- "connection-time-out": 30
- }
- }
- },
- "type": "vnf-netconf-device"
- },
- "activate-netconf-component": {
- "capabilities": {
- "component-node": {}
- },
- "requirements": {
- "netconf-connection": {
- "capability": "netconf",
- "node": "vpe-netconf-device",
- "relationship": "tosca.relationships.ConnectsTo"
- }
- },
- "interfaces": {
- "NetconfExecutorComponent": {
- "operations": {
- "process": {
- "inputs": {
- "action-name": {
- "get_input": "action-name"
- },
- "template-name": {
- "get_input": "template_name"
- },
- "template-version": {
- "get_input": "template_version"
- },
- "resource-type": "vnf-type",
- "request-id": {
- "get_input": "request-id"
- },
- "resource-id": {
- "get_input": "hostname"
- },
- "execution-script": "execution-script"
- },
- "outputs": {
- "response-data": {
- "get_attribute": [
- "SELF",
- "netconf-executor-baseconfig.response-data"
- ]
- },
- "status": {
- "get_attribute": [
- "SELF",
- "netconf-executor-baseconfig.status"
- ]
- }
- },
- "implementation": {
- "primary": "file://netconf_adaptor/DefaultBaseLicenceConfig.py"
- }
- }
- }
- }
- },
- "type": "component-netconf-executor"
- },
- "resource-assignment-ra-component": {
- "capabilities": {
- "component-node": {}
- },
- "interfaces": {
- "ResourceAssignmentComponent": {
- "operations": {
- "process": {
- "inputs": {
- "template-names": [
- "base-config-template",
- "licence-template"
- ],
- "action-name": {
- "get_input": "action-name"
- },
- "template-name": {
- "get_input": "template_name"
- },
- "template-version": {
- "get_input": "template-version"
- },
- "resource-type": "vnf-type",
- "request-id": {
- "get_input": "request-id"
- },
- "resource-id": {
- "get_input": "hostname"
- }
- },
- "outputs": {
- "resource-assignment-params": "success",
- "status": "status"
- }
- }
- }
- }
- },
- "type": "component-resource-assignment"
- },
- "resource-assignment-action": {
- "properties": {
- "mode": "sync",
- "version": "LATEST",
- "is-start-flow": false
- },
- "requirements": {
- "component-dependency": {
- "capability": "component-node",
- "node": "resource-assignment-ra-component",
- "relationship": "tosca.relationships.DependsOn"
- }
- },
- "capabilities": {
- "dg-node": {}
- },
- "interfaces": {
- "CONFIG": {
- "operations": {
- "ResourceAssignment": {
- "inputs": {
- "params": []
- }
- }
- }
- }
- },
- "type": "dg-resource-assignment"
- },
- "activate-action": {
- "properties": {
- "mode": "sync",
- "version": "LATEST",
- "is-start-flow": false
- },
- "requirements": {
- "component-dependency": {
- "capability": "component-node",
- "node": "activate-netconf-component",
- "relationship": "tosca.relationships.DependsOn"
- }
- },
- "capabilities": {
- "dg-node": {}
- },
- "interfaces": {
- "CONFIG": {
- "operations": {
- "ActivateNetconf": {
- "inputs": {
- "params": []
- }
- }
- }
- }
- },
- "type": "dg-activate-netconf"
- },
- "base-config-template": {
- "capabilities": {
- "content": {
- "properties": {
- "content": "db://base-config-template"
- }
- },
- "mapping": {
- "properties": {
- "mapping": [
- {
- "name": "rs-db-source",
- "property": {
- "required": true,
- "type": "string"
- },
- "input-param": false,
- "dictionary-name": "sample-db-source",
- "dictionary-source": "processor-db",
- "dependencies": [
- "hostname"
- ],
- "version": 0
- },
- {
- "name": "mdsal-source",
- "property": {
- "description": "",
- "required": true,
- "type": "list",
- "entry_schema": {
- "type": "dt-v4-aggregate"
- }
- },
- "input-param": false,
- "dictionary-name": "sample-mdsal-source",
- "dictionary-source": "sdnc",
- "dependencies": [
- "service-instance-id"
- ],
- "version": 0
- },
- {
- "name": "hostname",
- "property": {
- "required": true,
- "type": "string"
- },
- "dictionary-name": "hostname",
- "dictionary-source": "input",
- "version": 0,
- "input-param": false
- },
- {
- "name": "service",
- "property": {
- "required": true,
- "type": "string"
- },
- "dictionary-name": "service",
- "dictionary-source": "input",
- "version": 0,
- "input-param": false
- },
- {
- "name": "service-instance-id",
- "property": {
- "required": true,
- "type": "string"
- },
- "dictionary-name": "service-instance-id",
- "dictionary-source": "input",
- "version": 0,
- "input-param": false
- }
- ]
- }
- }
- },
- "properties": {
- "action-names": [
- "resource-assignment-action"
- ]
- },
- "type": "artifact-config-template"
- },
- "licence-template": {
- "capabilities": {
- "content": {
- "properties": {
- "content": "db://licence-template"
- }
- },
- "mapping": {
- "properties": {
- "mapping": [
- {
- "name": "licenses",
- "property": {
- "required": true,
- "type": "list",
- "entry_schema": {
- "type": "dt-license-key"
- }
- },
- "input-param": false,
- "dictionary-name": "sample-licenses",
- "dictionary-source": "sdnc",
- "dependencies": [
- "service-instance-id"
- ],
- "version": 0
- },
- {
- "name": "service-instance-id",
- "property": {
- "required": true,
- "type": "string"
- },
- "dictionary-name": "service-instance-id",
- "dictionary-source": "input",
- "version": 0,
- "input-param": false
- }
- ]
- }
- }
- },
- "properties": {
- "action-names": [
- "resource-assignment-action"
- ]
- },
- "type": "artifact-config-template"
- }
- }
- },
- "node_types": {
- },
- "data_types": {
- }
-}
+{ + "metadata": { + "template_author": "Brinda Santh", + "template_name": "enhance-template", + "template_version": "1.0.0", + "template_tags": "brinda, VPE", + "service-type": "Sample Service", + "release": "1806", + "vnf-type": "VPE" + }, + "topology_template": { + "inputs": { + "request-id": { + "required": true, + "type": "string" + }, + "service-instance-id": { + "required": true, + "type": "string" + }, + "scope-type": { + "required": true, + "type": "string" + }, + "action-name": { + "required": true, + "type": "string" + }, + "hostname": { + "required": true, + "type": "string" + } + }, + "node_templates": { + "vpe-netconf-device": { + "capabilities": { + "netconf": { + "properties": { + "login-key": "sdnc", + "login-account": "sndc-local", + "source": "local", + "target-ip-address": { + "get_attribute": [ + "SELF", + "lo0-local-ipv4-address" + ] + }, + "port-number": 22, + "connection-time-out": 30 + } + } + }, + "type": "vnf-netconf-device" + }, + "activate-netconf-component": { + "capabilities": { + "component-node": {} + }, + "requirements": { + "netconf-connection": { + "capability": "netconf", + "node": "vpe-netconf-device", + "relationship": "tosca.relationships.ConnectsTo" + } + }, + "interfaces": { + "NetconfExecutorComponent": { + "operations": { + "process": { + "inputs": { + "action-name": { + "get_input": "action-name" + }, + "template-name": { + "get_input": "template_name" + }, + "template-version": { + "get_input": "template_version" + }, + "resource-type": "vnf-type", + "request-id": { + "get_input": "request-id" + }, + "resource-id": { + "get_input": "hostname" + }, + "execution-script": "execution-script" + }, + "outputs": { + "response-data": { + "get_attribute": [ + "SELF", + "netconf-executor-baseconfig.response-data" + ] + }, + "status": { + "get_attribute": [ + "SELF", + "netconf-executor-baseconfig.status" + ] + } + }, + "implementation": { + "primary": "file://netconf_adaptor/DefaultBaseLicenceConfig.py" + } + } + } + } + }, + "type": "component-netconf-executor" + }, + "resource-assignment-ra-component": { + "capabilities": { + "component-node": {} + }, + "interfaces": { + "ResourceAssignmentComponent": { + "operations": { + "process": { + "inputs": { + "template-names": [ + "base-config-template", + "licence-template" + ], + "action-name": { + "get_input": "action-name" + }, + "template-name": { + "get_input": "template_name" + }, + "template-version": { + "get_input": "template-version" + }, + "resource-type": "vnf-type", + "request-id": { + "get_input": "request-id" + }, + "resource-id": { + "get_input": "hostname" + } + }, + "outputs": { + "resource-assignment-params": "success", + "status": "status" + } + } + } + } + }, + "type": "component-resource-assignment" + }, + "resource-assignment-action": { + "properties": { + "mode": "sync", + "version": "LATEST", + "is-start-flow": false + }, + "requirements": { + "component-dependency": { + "capability": "component-node", + "node": "resource-assignment-ra-component", + "relationship": "tosca.relationships.DependsOn" + } + }, + "capabilities": { + "dg-node": {} + }, + "interfaces": { + "CONFIG": { + "operations": { + "ResourceAssignment": { + "inputs": { + "params": [] + } + } + } + } + }, + "type": "dg-resource-assignment" + }, + "activate-action": { + "properties": { + "mode": "sync", + "version": "LATEST", + "is-start-flow": false + }, + "requirements": { + "component-dependency": { + "capability": "component-node", + "node": "activate-netconf-component", + "relationship": "tosca.relationships.DependsOn" + } + }, + "capabilities": { + "dg-node": {} + }, + "interfaces": { + "CONFIG": { + "operations": { + "ActivateNetconf": { + "inputs": { + "params": [] + } + } + } + } + }, + "type": "dg-activate-netconf" + }, + "base-config-template": { + "capabilities": { + "content": { + "properties": { + "content": "db://base-config-template" + } + }, + "mapping": { + "properties": { + "mapping": [ + { + "name": "rs-db-source", + "property": { + "required": true, + "type": "string" + }, + "input-param": false, + "dictionary-name": "sample-db-source", + "dictionary-source": "processor-db", + "dependencies": [ + "hostname" + ], + "version": 0 + }, + { + "name": "mdsal-source", + "property": { + "description": "", + "required": true, + "type": "list", + "entry_schema": { + "type": "dt-v4-aggregate" + } + }, + "input-param": false, + "dictionary-name": "sample-mdsal-source", + "dictionary-source": "sdnc", + "dependencies": [ + "service-instance-id" + ], + "version": 0 + }, + { + "name": "hostname", + "property": { + "required": true, + "type": "string" + }, + "dictionary-name": "hostname", + "dictionary-source": "input", + "version": 0, + "input-param": false + }, + { + "name": "service", + "property": { + "required": true, + "type": "string" + }, + "dictionary-name": "service", + "dictionary-source": "input", + "version": 0, + "input-param": false + }, + { + "name": "service-instance-id", + "property": { + "required": true, + "type": "string" + }, + "dictionary-name": "service-instance-id", + "dictionary-source": "input", + "version": 0, + "input-param": false + } + ] + } + } + }, + "properties": { + "action-names": [ + "resource-assignment-action" + ] + }, + "type": "artifact-config-template" + }, + "licence-template": { + "capabilities": { + "content": { + "properties": { + "content": "db://licence-template" + } + }, + "mapping": { + "properties": { + "mapping": [ + { + "name": "licenses", + "property": { + "required": true, + "type": "list", + "entry_schema": { + "type": "dt-license-key" + } + }, + "input-param": false, + "dictionary-name": "sample-licenses", + "dictionary-source": "sdnc", + "dependencies": [ + "service-instance-id" + ], + "version": 0 + }, + { + "name": "service-instance-id", + "property": { + "required": true, + "type": "string" + }, + "dictionary-name": "service-instance-id", + "dictionary-source": "input", + "version": 0, + "input-param": false + } + ] + } + } + }, + "properties": { + "action-names": [ + "resource-assignment-action" + ] + }, + "type": "artifact-config-template" + } + } + }, + "node_types": { + }, + "data_types": { + } +} diff --git a/ms/controllerblueprints/modules/service/src/test/resources/enhance/enhanced-template.json b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/resources/enhance/enhanced-template.json index d71293259..d71293259 100644 --- a/ms/controllerblueprints/modules/service/src/test/resources/enhance/enhanced-template.json +++ b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/resources/enhance/enhanced-template.json diff --git a/ms/controllerblueprints/modules/service/src/test/resources/model_type/data_type/datatype-property.json b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/resources/model_type/data_type/datatype-property.json index 5584b10ea..d3ecffd17 100644 --- a/ms/controllerblueprints/modules/service/src/test/resources/model_type/data_type/datatype-property.json +++ b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/resources/model_type/data_type/datatype-property.json @@ -1,27 +1,27 @@ -{
- "version": "1.0.0",
- "description": "This is Entry point Input Data Type, which is dynamic datatype, The parameter names will be populated during the Design time for each inputs",
- "properties": {
- "type": {
- "required": true,
- "type": "string"
- },
- "description": {
- "required": false,
- "type": "string"
- },
- "required": {
- "required": false,
- "type": "boolean"
- },
- "default": {
- "required": false,
- "type": "string"
- },
- "entry_schema": {
- "required": false,
- "type": "string"
- }
- },
- "derived_from": "tosca.datatypes.Root"
+{ + "version": "1.0.0", + "description": "This is Entry point Input Data Type, which is dynamic datatype, The parameter names will be populated during the Design time for each inputs", + "properties": { + "type": { + "required": true, + "type": "string" + }, + "description": { + "required": false, + "type": "string" + }, + "required": { + "required": false, + "type": "boolean" + }, + "default": { + "required": false, + "type": "string" + }, + "entry_schema": { + "required": false, + "type": "string" + } + }, + "derived_from": "tosca.datatypes.Root" }
\ No newline at end of file diff --git a/ms/controllerblueprints/modules/service/src/test/resources/resourcedictionary/automap.json b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/resources/resourcedictionary/automap.json index c6dd7948b..820c59804 100644 --- a/ms/controllerblueprints/modules/service/src/test/resources/resourcedictionary/automap.json +++ b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/resources/resourcedictionary/automap.json @@ -1,14 +1,14 @@ -[
- {
- "name": "sample-input-source"
- },
- {
- "name": "sample-default-source"
- },
- {
- "name": "sample-db-source"
- },
- {
- "name": "sample-mdsal-source"
- }
+[ + { + "name": "sample-input-source" + }, + { + "name": "sample-default-source" + }, + { + "name": "sample-db-source" + }, + { + "name": "sample-mdsal-source" + } ]
\ No newline at end of file diff --git a/ms/controllerblueprints/modules/service/src/test/resources/resourcedictionary/default_definition.json b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/resources/resourcedictionary/default_definition.json index 334fb24e8..d2fa29918 100644 --- a/ms/controllerblueprints/modules/service/src/test/resources/resourcedictionary/default_definition.json +++ b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/resources/resourcedictionary/default_definition.json @@ -1,17 +1,17 @@ -{
- "name": "ipaddress",
- "property": {
- "description": "name of the ",
- "type": "list",
- "entry_schema": {
- "type": "dt-v4-aggregate"
- }
- },
- "updated-by": "Brinda Santh (bs2796)",
- "tags": "ipaddress",
- "sources": {
- "input": {
- "type": "source-input"
- }
- }
+{ + "name": "ipaddress", + "property": { + "description": "name of the ", + "type": "list", + "entry_schema": { + "type": "dt-v4-aggregate" + } + }, + "updated-by": "Brinda Santh (bs2796)", + "tags": "ipaddress", + "sources": { + "input": { + "type": "source-input" + } + } }
\ No newline at end of file diff --git a/ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/cds/controllerblueprints/service/repository/ModelTypeReactRepositoryTest.java b/ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/cds/controllerblueprints/service/repository/ModelTypeReactRepositoryTest.java deleted file mode 100644 index 26b162494..000000000 --- a/ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/cds/controllerblueprints/service/repository/ModelTypeReactRepositoryTest.java +++ /dev/null @@ -1,110 +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.cds.controllerblueprints.service.repository; - -import org.junit.Assert; -import org.junit.FixMethodOrder; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.MethodSorters; -import org.onap.ccsdk.cds.controllerblueprints.TestApplication; -import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants; -import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils; -import org.onap.ccsdk.cds.controllerblueprints.service.domain.ModelType; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; -import org.springframework.test.annotation.Commit; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringRunner; - -import java.util.Arrays; -import java.util.List; - -/** - * ModelTypeReactRepositoryTest. - * - * @author Brinda Santh - */ - -@RunWith(SpringRunner.class) -@DataJpaTest -@ContextConfiguration(classes = {TestApplication.class}) -@FixMethodOrder(MethodSorters.NAME_ASCENDING) -public class ModelTypeReactRepositoryTest { - - @Autowired - private ModelTypeReactRepository modelTypeReactRepository; - - String modelName = "test-datatype"; - - @Test - @Commit - public void test01Save() { - String content = JacksonUtils.Companion.getClassPathFileContent("model_type/data_type/datatype-property.json"); - ModelType modelType = new ModelType(); - modelType.setDefinitionType(BluePrintConstants.MODEL_DEFINITION_TYPE_DATA_TYPE); - modelType.setDerivedFrom(BluePrintConstants.MODEL_TYPE_DATATYPES_ROOT); - modelType.setDescription("Definition for Sample Datatype "); - modelType.setDefinition(JacksonUtils.Companion.jsonNode(content)); - modelType.setModelName(modelName); - modelType.setVersion("1.0.0"); - modelType.setTags("test-datatype ," + BluePrintConstants.MODEL_TYPE_DATATYPES_ROOT + "," - + BluePrintConstants.MODEL_DEFINITION_TYPE_DATA_TYPE); - modelType.setUpdatedBy("xxxxxx@xxx.com"); - - ModelType dbModelType = modelTypeReactRepository.save(modelType).block(); - Assert.assertNotNull("Failed to get Saved ModelType", dbModelType); - } - - @Test - public void test02Finds() { - ModelType dbFindByModelName = modelTypeReactRepository.findByModelName(modelName).block(); - Assert.assertNotNull("Failed to findByModelName ", dbFindByModelName); - - List<ModelType> dbFindByDefinitionType = - modelTypeReactRepository.findByDefinitionType(BluePrintConstants.MODEL_DEFINITION_TYPE_DATA_TYPE).collectList().block(); - Assert.assertNotNull("Failed to findByDefinitionType ", dbFindByDefinitionType); - Assert.assertTrue("Failed to findByDefinitionType count", dbFindByDefinitionType.size() > 0); - - List<ModelType> dbFindByDerivedFrom = - modelTypeReactRepository.findByDerivedFrom(BluePrintConstants.MODEL_TYPE_DATATYPES_ROOT).collectList().block(); - Assert.assertNotNull("Failed to find findByDerivedFrom", dbFindByDerivedFrom); - Assert.assertTrue("Failed to find findByDerivedFrom by count", dbFindByDerivedFrom.size() > 0); - - List<ModelType> dbFindByModelNameIn = - modelTypeReactRepository.findByModelNameIn(Arrays.asList(modelName)).collectList().block(); - Assert.assertNotNull("Failed to findByModelNameIn ", dbFindByModelNameIn); - Assert.assertTrue("Failed to findByModelNameIn by count", dbFindByModelNameIn.size() > 0); - - List<ModelType> dbFindByDefinitionTypeIn = - modelTypeReactRepository.findByDefinitionTypeIn(Arrays.asList(BluePrintConstants.MODEL_DEFINITION_TYPE_DATA_TYPE)).collectList().block(); - Assert.assertNotNull("Failed to findByDefinitionTypeIn", dbFindByDefinitionTypeIn); - Assert.assertTrue("Failed to findByDefinitionTypeIn by count", dbFindByDefinitionTypeIn.size() > 0); - - List<ModelType> dbFindByDerivedFromIn = - modelTypeReactRepository.findByDerivedFromIn(Arrays.asList(BluePrintConstants.MODEL_TYPE_DATATYPES_ROOT)).collectList().block(); - Assert.assertNotNull("Failed to find findByDerivedFromIn", dbFindByDerivedFromIn); - Assert.assertTrue("Failed to find findByDerivedFromIn by count", dbFindByDerivedFromIn.size() > 0); - } - - @Test - @Commit - public void test03Delete() { - modelTypeReactRepository.deleteByModelName(modelName).block(); - } - -} |