From adcd4f2bc695840e9ecbc05003bc52c675f22fec Mon Sep 17 00:00:00 2001 From: KAPIL SINGAL Date: Fri, 22 Jan 2021 11:49:51 -0500 Subject: Renaming Files having BluePrint to have Blueprint Replacing BluePrint with Blueprint throughout Issue-ID: CCSDK-3098 Signed-off-by: KAPIL SINGAL Change-Id: Ibee8bad07ae7d9287073db2d4f2f2cd730fa8b96 --- .../resolution/ResourceDefinitionDSLTest.kt | 10 +++--- .../ResourceResolutionComponentDSLTest.kt | 6 ++-- .../resolution/ResourceResolutionComponentTest.kt | 18 +++++------ .../resolution/ResourceResolutionServiceTest.kt | 32 +++++++++---------- .../resource/resolution/ResourceSourceDSLTest.kt | 22 ++++++------- .../resolution/TestDatabaseConfiguration.kt | 4 +-- .../IpAssignResolutionCapabilityTest.kt | 16 +++++----- .../capabilities/NamingResolutionCapabilityTest.kt | 24 +++++++-------- .../db/ResourceResolutionDBServiceTest.kt | 18 +++++------ .../resolution/db/TemplateResolutionServiceTest.kt | 14 ++++----- .../mock/MockBluePrintRestLibPropertyService.kt | 36 ---------------------- .../mock/MockBlueprintRestLibPropertyService.kt | 36 ++++++++++++++++++++++ .../resolution/mock/MockDatabaseConfiguration.kt | 18 +++++------ .../mock/MockRestResourceResolutionProcessor.kt | 20 ++++++------ .../CapabilityResourceResolutionProcessorTest.kt | 16 +++++----- .../DatabaseResourceResolutionProcessorTest.kt | 8 ++--- .../DefaultResourceResolutionProcessorTest.kt | 4 +-- .../InputResourceResolutionProcessorTest.kt | 4 +-- .../RestResourceResolutionProcessorTest.kt | 20 ++++++------ .../utils/ResourceAssignmentUtilsTest.kt | 4 +-- 20 files changed, 165 insertions(+), 165 deletions(-) delete mode 100644 ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/mock/MockBluePrintRestLibPropertyService.kt create mode 100644 ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/mock/MockBlueprintRestLibPropertyService.kt (limited to 'ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin') diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceDefinitionDSLTest.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceDefinitionDSLTest.kt index 7dcaab733..bdb47e711 100644 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceDefinitionDSLTest.kt +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceDefinitionDSLTest.kt @@ -16,7 +16,7 @@ package org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution -import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintTypes +import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintTypes import kotlin.test.Test import kotlin.test.assertEquals import kotlin.test.assertNotNull @@ -25,7 +25,7 @@ class ResourceDefinitionDSLTest { @Test fun testResourceDefinitionDSL() { - val testResourceDefinition = BluePrintTypes.resourceDefinition( + val testResourceDefinition = BlueprintTypes.resourceDefinition( "service-instance-id", "VFW Service Instance Name" ) { @@ -79,7 +79,7 @@ class ResourceDefinitionDSLTest { // println(resourceDefinition.asJsonString(true)) assertNotNull(testResourceDefinition, "failed to generate testResourceDefinition") - val testResourceDefinitions = BluePrintTypes.resourceDefinitions { + val testResourceDefinitions = BlueprintTypes.resourceDefinitions { resourceDefinition(testResourceDefinition) } assertNotNull(testResourceDefinitions, "failed to generate testResourceDefinitions") @@ -88,7 +88,7 @@ class ResourceDefinitionDSLTest { @Test fun testResourceAssignment() { - val testResourceAssignment = BluePrintTypes.resourceAssignment( + val testResourceAssignment = BlueprintTypes.resourceAssignment( "instance-name", "service-instance-name", "odl-mdsal" ) { @@ -99,7 +99,7 @@ class ResourceDefinitionDSLTest { // println(resourceAssignment.asJsonString(true)) assertNotNull(testResourceAssignment, "failed to generate resourceAssignment") - val testResourceAssignments = BluePrintTypes.resourceAssignments { + val testResourceAssignments = BlueprintTypes.resourceAssignments { resourceAssignment(testResourceAssignment) resourceAssignment( "instance-name1", diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionComponentDSLTest.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionComponentDSLTest.kt index f7c41bdac..09eef46d4 100644 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionComponentDSLTest.kt +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionComponentDSLTest.kt @@ -16,7 +16,7 @@ package org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution -import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintTypes +import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintTypes import org.onap.ccsdk.cds.controllerblueprints.core.dsl.getAttribute import kotlin.test.Test import kotlin.test.assertNotNull @@ -25,14 +25,14 @@ class ResourceResolutionComponentDSLTest { @Test fun testNodeTypeComponentResourceResolution() { - val nodeType = BluePrintTypes.nodeTypeComponentResourceResolution() + val nodeType = BlueprintTypes.nodeTypeComponentResourceResolution() // println(nodeType.asJsonString(true)) assertNotNull(nodeType, "failed to generate nodeTypeComponentResourceResolution") } @Test fun testNodeTemplateComponentResourceResolution() { - val nodeTemplate = BluePrintTypes.nodeTemplateComponentResourceResolution("resource-resolve", "") { + val nodeTemplate = BlueprintTypes.nodeTemplateComponentResourceResolution("resource-resolve", "") { definedOperation("Resolve resources") { inputs { actionName("resolve") diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionComponentTest.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionComponentTest.kt index ab1efcdc8..80ba8315b 100644 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionComponentTest.kt +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionComponentTest.kt @@ -26,10 +26,10 @@ import kotlinx.coroutines.runBlocking import org.junit.Before import org.junit.Test import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceInput -import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintError -import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException +import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintError +import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintProcessorException import org.onap.ccsdk.cds.controllerblueprints.core.asJsonPrimitive -import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintRuntimeService +import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintRuntimeService import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils import kotlin.test.assertEquals import kotlin.test.fail @@ -44,7 +44,7 @@ class ResourceResolutionComponentTest { private val resourceType = "ServiceInstance" private val occurrence = 1 private val props = mutableMapOf() - private val bluePrintRuntimeService = mockk>() + private val bluePrintRuntimeService = mockk>() private val artifactNames = listOf("template") private val nodeTemplateName = "nodeTemplateName" @@ -79,7 +79,7 @@ class ResourceResolutionComponentTest { runBlocking { try { resourceResolutionComponent.processNB(executionRequest) - } catch (e: BluePrintProcessorException) { + } catch (e: BlueprintProcessorException) { assertEquals( "Can't proceed with the resolution: either provide resolution-key OR combination of resource-id and resource-type.", e.message @@ -98,7 +98,7 @@ class ResourceResolutionComponentTest { runBlocking { try { resourceResolutionComponent.processNB(executionRequest) - } catch (e: BluePrintProcessorException) { + } catch (e: BlueprintProcessorException) { assertEquals( "Can't proceed with the resolution: both resource-id and resource-type should be provided, one of them is missing.", e.message @@ -118,7 +118,7 @@ class ResourceResolutionComponentTest { runBlocking { try { resourceResolutionComponent.processNB(executionRequest) - } catch (e: BluePrintProcessorException) { + } catch (e: BlueprintProcessorException) { assertEquals( "Can't proceed with the resolution: can't persist resolution without a correlation key. " + "Either provide a resolution-key OR combination of resource-id and resource-type OR set `storeResult` to false.", @@ -163,9 +163,9 @@ class ResourceResolutionComponentTest { @Test fun testRecover() { runBlocking { - val blueprintError = BluePrintError() + val blueprintError = BlueprintError() val exception = RuntimeException("message") - every { bluePrintRuntimeService.getBluePrintError() } returns blueprintError + every { bluePrintRuntimeService.getBlueprintError() } returns blueprintError resourceResolutionComponent.recoverNB(exception, executionRequest) assertEquals(1, blueprintError.errors.size) diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionServiceTest.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionServiceTest.kt index db8ca4801..00fb39515 100644 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionServiceTest.kt +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionServiceTest.kt @@ -30,11 +30,11 @@ import org.onap.ccsdk.cds.blueprintsprocessor.core.utils.PayloadUtils import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.processor.MockCapabilityScriptRA import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.utils.ResourceAssignmentUtils import org.onap.ccsdk.cds.controllerblueprints.core.asJsonPrimitive -import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants -import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintError -import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintTypes -import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintContext -import org.onap.ccsdk.cds.controllerblueprints.core.utils.BluePrintMetadataUtils +import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants +import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintError +import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintTypes +import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintContext +import org.onap.ccsdk.cds.controllerblueprints.core.utils.BlueprintMetadataUtils import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResolutionSummary import org.slf4j.LoggerFactory @@ -106,7 +106,7 @@ class ResourceResolutionServiceTest { Assert.assertNotNull("failed to create ResourceResolutionService", resourceResolutionService) - val bluePrintRuntimeService = BluePrintMetadataUtils.getBluePrintRuntime( + val bluePrintRuntimeService = BlueprintMetadataUtils.getBlueprintRuntime( "1234", "./../../../../components/model-catalog/blueprint-model/test-blueprint/baseconfiguration" ) @@ -160,7 +160,7 @@ class ResourceResolutionServiceTest { runBlocking { Assert.assertNotNull("failed to create ResourceResolutionService", resourceResolutionService) - val bluePrintRuntimeService = BluePrintMetadataUtils.getBluePrintRuntime( + val bluePrintRuntimeService = BlueprintMetadataUtils.getBlueprintRuntime( "1234", "./../../../../components/model-catalog/blueprint-model/test-blueprint/baseconfiguration" ) @@ -199,7 +199,7 @@ class ResourceResolutionServiceTest { runBlocking { Assert.assertNotNull("failed to create ResourceResolutionService", resourceResolutionService) - val bluePrintRuntimeService = BluePrintMetadataUtils.getBluePrintRuntime( + val bluePrintRuntimeService = BlueprintMetadataUtils.getBlueprintRuntime( "1234", "./../../../../components/model-catalog/blueprint-model/test-blueprint/baseconfiguration" ) @@ -244,7 +244,7 @@ class ResourceResolutionServiceTest { props[ResourceResolutionConstants.RESOURCE_RESOLUTION_INPUT_RESOLUTION_SUMMARY] = true Assert.assertNotNull("failed to create ResourceResolutionService", resourceResolutionService) - val bluePrintRuntimeService = BluePrintMetadataUtils.getBluePrintRuntime( + val bluePrintRuntimeService = BlueprintMetadataUtils.getBlueprintRuntime( "1234", "./../../../../components/model-catalog/blueprint-model/test-blueprint/baseconfiguration" ) @@ -290,7 +290,7 @@ class ResourceResolutionServiceTest { runBlocking { Assert.assertNotNull("failed to create ResourceResolutionService", resourceResolutionService) - val bluePrintRuntimeService = BluePrintMetadataUtils.getBluePrintRuntime( + val bluePrintRuntimeService = BlueprintMetadataUtils.getBlueprintRuntime( "1234", "./../../../../components/model-catalog/blueprint-model/test-blueprint/baseconfiguration" ) @@ -343,7 +343,7 @@ class ResourceResolutionServiceTest { runBlocking { Assert.assertNotNull("failed to create ResourceResolutionService", resourceResolutionService) - val bluePrintRuntimeService = BluePrintMetadataUtils.getBluePrintRuntime( + val bluePrintRuntimeService = BlueprintMetadataUtils.getBlueprintRuntime( "1234", "./../../../../components/model-catalog/blueprint-model/test-blueprint/baseconfiguration" ) @@ -383,13 +383,13 @@ class ResourceResolutionServiceTest { @Test fun testResourceResolutionForDefinition() { - val resourceDefinitions = BluePrintTypes.resourceDefinitions { + val resourceDefinitions = BlueprintTypes.resourceDefinitions { resourceDefinition(name = "port-speed", description = "Port Speed") { property(type = "string", required = true) sources { sourceCapability(id = "sdno", description = "SDNO Source") { definedProperties { - type(BluePrintConstants.SCRIPT_KOTLIN) + type(BlueprintConstants.SCRIPT_KOTLIN) scriptClassReference(MockCapabilityScriptRA::class.qualifiedName!!) keyDependencies(arrayListOf("device-id")) } @@ -416,9 +416,9 @@ class ResourceResolutionServiceTest { } runBlocking { val raRuntimeService = mockk() - every { raRuntimeService.bluePrintContext() } returns mockk() - every { raRuntimeService.getBluePrintError() } returns BluePrintError() - every { raRuntimeService.setBluePrintError(any()) } returns Unit + every { raRuntimeService.bluePrintContext() } returns mockk() + every { raRuntimeService.getBlueprintError() } returns BlueprintError() + every { raRuntimeService.setBlueprintError(any()) } returns Unit every { raRuntimeService.getInputValue("device-id") } returns "123456".asJsonPrimitive() every { raRuntimeService.putResolutionStore(any(), any()) } returns Unit diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceSourceDSLTest.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceSourceDSLTest.kt index 2e9dc9e2a..1dff814ac 100644 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceSourceDSLTest.kt +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceSourceDSLTest.kt @@ -16,7 +16,7 @@ package org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution -import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintTypes +import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintTypes import kotlin.test.Test import kotlin.test.assertNotNull @@ -24,42 +24,42 @@ class ResourceSourceDSLTest { @Test fun testNodeTypeSourceInput() { - val nodeType = BluePrintTypes.nodeTypeSourceInput() + val nodeType = BlueprintTypes.nodeTypeSourceInput() // println(nodeType.asJsonString(true)) assertNotNull(nodeType, "failed to generate nodeTypeSourceInput") } @Test fun testNodeTypeSourceDefault() { - val nodeType = BluePrintTypes.nodeTypeSourceDefault() + val nodeType = BlueprintTypes.nodeTypeSourceDefault() // println(nodeType.asJsonString(true)) assertNotNull(nodeType, "failed to generate nodeTypeSourceDefault") } @Test fun testNodeTypeSourceDb() { - val nodeType = BluePrintTypes.nodeTypeSourceDb() + val nodeType = BlueprintTypes.nodeTypeSourceDb() // println(nodeType.asJsonString(true)) assertNotNull(nodeType, "failed to generate nodeTypeSourceDb") } @Test fun testNodeTypeSourceRest() { - val nodeType = BluePrintTypes.nodeTypeSourceRest() + val nodeType = BlueprintTypes.nodeTypeSourceRest() // println(nodeType.asJsonString(true)) assertNotNull(nodeType, "failed to generate nodeTypeSourceRest") } @Test fun testNodeTypeSourceCapability() { - val nodeType = BluePrintTypes.nodeTypeSourceCapability() + val nodeType = BlueprintTypes.nodeTypeSourceCapability() // println(nodeType.asJsonString(true)) assertNotNull(nodeType, "failed to generate nodeTypeSourceCapability") } @Test fun testNodeTemplateSourceInput() { - val nodeTemplate = BluePrintTypes.nodeTemplateSourceInput("InputSystem", "") { + val nodeTemplate = BlueprintTypes.nodeTemplateSourceInput("InputSystem", "") { } // println(nodeTemplate.asJsonString(true)) assertNotNull(nodeTemplate, "failed to generate nodeTemplateSourceInput") @@ -67,7 +67,7 @@ class ResourceSourceDSLTest { @Test fun testNodeTemplateSourceDefault() { - val nodeTemplate = BluePrintTypes.nodeTemplateSourceDefault("DefaultSystem", "") { + val nodeTemplate = BlueprintTypes.nodeTemplateSourceDefault("DefaultSystem", "") { } // println(nodeTemplate.asJsonString(true)) assertNotNull(nodeTemplate, "failed to generate nodeTemplateSourceDefault") @@ -75,7 +75,7 @@ class ResourceSourceDSLTest { @Test fun testNodeTemplateSourceDb() { - val nodeTemplate = BluePrintTypes.nodeTemplateSourceDb("DbSystem", "") { + val nodeTemplate = BlueprintTypes.nodeTemplateSourceDb("DbSystem", "") { definedProperties { type("SQL") query("SELECT * FROM DB WHERE name = \$name") @@ -95,7 +95,7 @@ class ResourceSourceDSLTest { @Test fun testNodeTemplateSourceRest() { - val nodeTemplate = BluePrintTypes.nodeTemplateSourceRest("restSystem", "") { + val nodeTemplate = BlueprintTypes.nodeTemplateSourceRest("restSystem", "") { definedProperties { type("JSON") endpointSelector("rest-source-endpoint") @@ -119,7 +119,7 @@ class ResourceSourceDSLTest { @Test fun testNodeTemplateSourceCapability() { - val nodeTemplate = BluePrintTypes.nodeTemplateSourceCapability("capabiltySystem", "") { + val nodeTemplate = BlueprintTypes.nodeTemplateSourceCapability("capabiltySystem", "") { definedProperties { type("kotlin") scriptClassReference("Scripts/Sample.kt") diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/TestDatabaseConfiguration.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/TestDatabaseConfiguration.kt index 096d7ff27..d720bd836 100644 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/TestDatabaseConfiguration.kt +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/TestDatabaseConfiguration.kt @@ -16,7 +16,7 @@ package org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution -import org.onap.ccsdk.cds.blueprintsprocessor.db.BluePrintDBLibConfiguration +import org.onap.ccsdk.cds.blueprintsprocessor.db.BlueprintDBLibConfiguration import org.onap.ccsdk.cds.blueprintsprocessor.db.PrimaryDataSourceProperties import org.onap.ccsdk.cds.blueprintsprocessor.db.primary.PrimaryDatabaseConfiguration import org.springframework.context.annotation.Bean @@ -29,7 +29,7 @@ import org.springframework.transaction.PlatformTransactionManager import javax.sql.DataSource @Configuration -@Import(BluePrintDBLibConfiguration::class) +@Import(BlueprintDBLibConfiguration::class) @EnableJpaRepositories( basePackages = [ "org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution", diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/capabilities/IpAssignResolutionCapabilityTest.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/capabilities/IpAssignResolutionCapabilityTest.kt index 4ce5df18f..e48ac388d 100644 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/capabilities/IpAssignResolutionCapabilityTest.kt +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/capabilities/IpAssignResolutionCapabilityTest.kt @@ -29,14 +29,14 @@ import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.proc import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.resourceAssignments import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.resourceDefinitions import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.utils.ResourceAssignmentUtils -import org.onap.ccsdk.cds.blueprintsprocessor.rest.service.BluePrintRestLibPropertyService +import org.onap.ccsdk.cds.blueprintsprocessor.rest.service.BlueprintRestLibPropertyService import org.onap.ccsdk.cds.blueprintsprocessor.rest.service.BlueprintWebClientService import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.ComponentFunctionScriptingService -import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintTypes +import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintTypes import org.onap.ccsdk.cds.controllerblueprints.core.asJsonPrimitive import org.onap.ccsdk.cds.controllerblueprints.core.asJsonType import org.onap.ccsdk.cds.controllerblueprints.core.logger -import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintDependencyService +import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintDependencyService import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResolutionSummary import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResourceAssignment @@ -57,7 +57,7 @@ class IpAssignResolutionCapabilityTest { @Before fun setup() { - mockkObject(BluePrintDependencyService) + mockkObject(BlueprintDependencyService) val blueprintWebClientService = mockk() // Create mock Response @@ -72,9 +72,9 @@ class IpAssignResolutionCapabilityTest { ) every { blueprintWebClientService.exchangeResource(any(), any(), any()) } returns mockResponse - val restLibPropertyService = mockk() + val restLibPropertyService = mockk() every { restLibPropertyService.blueprintWebClientService("ipassign-ms") } returns blueprintWebClientService - every { BluePrintDependencyService.applicationContext.getBean(any()) } returns restLibPropertyService + every { BlueprintDependencyService.applicationContext.getBean(any()) } returns restLibPropertyService } @Test @@ -152,7 +152,7 @@ class IpAssignResolutionCapabilityTest { /** Test dictionaries */ private fun resourceDefinitions(): MutableMap { - return BluePrintTypes.resourceDefinitions { + return BlueprintTypes.resourceDefinitions { resourceDefinition("CloudRegionId", "Cloud Region Id Resource Definition") { tags("CloudRegionId") updatedBy("saurav.paira@att.com") @@ -230,7 +230,7 @@ class IpAssignResolutionCapabilityTest { } private fun resourceAssignments(): MutableMap { - return BluePrintTypes.resourceAssignments { + return BlueprintTypes.resourceAssignments { resourceAssignment( name = "CloudRegionId", dictionaryName = "CloudRegionId", dictionarySource = "input" diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/capabilities/NamingResolutionCapabilityTest.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/capabilities/NamingResolutionCapabilityTest.kt index 8c0aca49e..66f302f6f 100644 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/capabilities/NamingResolutionCapabilityTest.kt +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/capabilities/NamingResolutionCapabilityTest.kt @@ -29,16 +29,16 @@ import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.proc import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.resourceAssignments import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.resourceDefinitions import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.utils.ResourceAssignmentUtils -import org.onap.ccsdk.cds.blueprintsprocessor.rest.service.BluePrintRestLibPropertyService +import org.onap.ccsdk.cds.blueprintsprocessor.rest.service.BlueprintRestLibPropertyService import org.onap.ccsdk.cds.blueprintsprocessor.rest.service.BlueprintWebClientService import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.ComponentFunctionScriptingService -import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintError -import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintTypes +import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintError +import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintTypes import org.onap.ccsdk.cds.controllerblueprints.core.asJsonPrimitive import org.onap.ccsdk.cds.controllerblueprints.core.asJsonType 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.BluePrintDependencyService +import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintContext +import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintDependencyService import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResolutionSummary import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResourceAssignment @@ -60,7 +60,7 @@ class NamingResolutionCapabilityTest { @Before fun setup() { - mockkObject(BluePrintDependencyService) + mockkObject(BlueprintDependencyService) val blueprintWebClientService = mockk() // Create mock Response @@ -74,9 +74,9 @@ class NamingResolutionCapabilityTest { ) every { blueprintWebClientService.exchangeResource(any(), any(), any()) } returns mockResponse - val restLibPropertyService = mockk() + val restLibPropertyService = mockk() every { restLibPropertyService.blueprintWebClientService("naming-ms") } returns blueprintWebClientService - every { BluePrintDependencyService.applicationContext.getBean(any()) } returns restLibPropertyService + every { BlueprintDependencyService.applicationContext.getBean(any()) } returns restLibPropertyService } @Test @@ -89,8 +89,8 @@ class NamingResolutionCapabilityTest { } returns NamingResolutionCapability() val raRuntimeService = mockk() - every { raRuntimeService.getBluePrintError() } returns BluePrintError() - every { raRuntimeService.bluePrintContext() } returns mockk() + every { raRuntimeService.getBlueprintError() } returns BlueprintError() + every { raRuntimeService.bluePrintContext() } returns mockk() every { raRuntimeService.getInputValue("vf-module-name") } returns NullNode.getInstance() every { raRuntimeService.getInputValue("vnfc-name") } returns NullNode.getInstance() @@ -154,7 +154,7 @@ class NamingResolutionCapabilityTest { /** Test dictionaries */ private fun resourceDefinitions(): MutableMap { - return BluePrintTypes.resourceDefinitions { + return BlueprintTypes.resourceDefinitions { resourceDefinition("naming-code", "naming-code Resource Definition") { tags("naming-code") updatedBy("brindasanth@onap.com") @@ -274,7 +274,7 @@ class NamingResolutionCapabilityTest { } private fun resourceAssignments(): MutableMap { - return BluePrintTypes.resourceAssignments { + return BlueprintTypes.resourceAssignments { resourceAssignment( name = "naming-code", dictionaryName = "naming-code", dictionarySource = "input" diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/db/ResourceResolutionDBServiceTest.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/db/ResourceResolutionDBServiceTest.kt index fa59876a9..51825a5f9 100644 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/db/ResourceResolutionDBServiceTest.kt +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/db/ResourceResolutionDBServiceTest.kt @@ -23,10 +23,10 @@ import kotlinx.coroutines.runBlocking import org.junit.Before import org.junit.Test import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.ResourceResolutionConstants -import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants +import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants import org.onap.ccsdk.cds.controllerblueprints.core.asJsonPrimitive -import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintContext -import org.onap.ccsdk.cds.controllerblueprints.core.service.DefaultBluePrintRuntimeService +import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintContext +import org.onap.ccsdk.cds.controllerblueprints.core.service.DefaultBlueprintRuntimeService import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResourceAssignment import org.springframework.dao.EmptyResultDataAccessException import kotlin.test.assertEquals @@ -46,13 +46,13 @@ open class ResourceResolutionDBServiceTest { private val blueprintVersion = "1.0.0" private val metadata = hashMapOf() private val props = hashMapOf() - private val bluePrintContext = mockk() - private val bluePrintRuntimeService = mockk() + private val bluePrintContext = mockk() + private val bluePrintRuntimeService = mockk() @Before fun setup() { - metadata[BluePrintConstants.METADATA_TEMPLATE_VERSION] = blueprintVersion - metadata[BluePrintConstants.METADATA_TEMPLATE_NAME] = blueprintName + metadata[BlueprintConstants.METADATA_TEMPLATE_VERSION] = blueprintVersion + metadata[BlueprintConstants.METADATA_TEMPLATE_NAME] = blueprintName props[ResourceResolutionConstants.RESOURCE_RESOLUTION_INPUT_RESOLUTION_KEY] = resolutionKey props[ResourceResolutionConstants.RESOURCE_RESOLUTION_INPUT_RESOURCE_ID] = resourceId @@ -206,7 +206,7 @@ open class ResourceResolutionDBServiceTest { fun writeTest() { val resourceResolution = ResourceResolution() val resourceAssignment = ResourceAssignment() - resourceAssignment.property?.status = BluePrintConstants.STATUS_SUCCESS + resourceAssignment.property?.status = BlueprintConstants.STATUS_SUCCESS resourceAssignment.property?.value = "result".asJsonPrimitive() resourceAssignment.dictionarySource = "ddSource" resourceAssignment.dictionaryName = "ddName" @@ -229,7 +229,7 @@ open class ResourceResolutionDBServiceTest { fun writeWithNullValue() { val slot = slot() val resourceAssignment = ResourceAssignment() - resourceAssignment.status = BluePrintConstants.STATUS_SUCCESS + resourceAssignment.status = BlueprintConstants.STATUS_SUCCESS resourceAssignment.dictionarySource = "ddSource" resourceAssignment.dictionaryName = "ddName" resourceAssignment.version = 1 diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/db/TemplateResolutionServiceTest.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/db/TemplateResolutionServiceTest.kt index 71d895574..0a7722f53 100644 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/db/TemplateResolutionServiceTest.kt +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/db/TemplateResolutionServiceTest.kt @@ -7,9 +7,9 @@ import kotlinx.coroutines.runBlocking import org.junit.Before import org.junit.Test import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.ResourceResolutionConstants -import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants -import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintContext -import org.onap.ccsdk.cds.controllerblueprints.core.service.DefaultBluePrintRuntimeService +import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants +import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintContext +import org.onap.ccsdk.cds.controllerblueprints.core.service.DefaultBlueprintRuntimeService import org.springframework.dao.EmptyResultDataAccessException import kotlin.test.assertEquals @@ -29,13 +29,13 @@ class TemplateResolutionServiceTest { private val result = "result" private val metadata = hashMapOf() private val props = hashMapOf() - private val bluePrintContext = mockk() - private val bluePrintRuntimeService = mockk() + private val bluePrintContext = mockk() + private val bluePrintRuntimeService = mockk() @Before fun setup() { - metadata[BluePrintConstants.METADATA_TEMPLATE_VERSION] = blueprintVersion - metadata[BluePrintConstants.METADATA_TEMPLATE_NAME] = blueprintName + metadata[BlueprintConstants.METADATA_TEMPLATE_VERSION] = blueprintVersion + metadata[BlueprintConstants.METADATA_TEMPLATE_NAME] = blueprintName props[ResourceResolutionConstants.RESOURCE_RESOLUTION_INPUT_RESOLUTION_KEY] = resolutionKey props[ResourceResolutionConstants.RESOURCE_RESOLUTION_INPUT_RESOURCE_ID] = resourceId diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/mock/MockBluePrintRestLibPropertyService.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/mock/MockBluePrintRestLibPropertyService.kt deleted file mode 100644 index a2ec75d02..000000000 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/mock/MockBluePrintRestLibPropertyService.kt +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright © 2019 IBM, Bell Canada. - * - * 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.functions.resource.resolution.mock - -import org.onap.ccsdk.cds.blueprintsprocessor.core.BluePrintPropertiesService -import org.onap.ccsdk.cds.blueprintsprocessor.rest.RestClientProperties -import org.onap.ccsdk.cds.blueprintsprocessor.rest.service.BluePrintRestLibPropertyService - -class MockBluePrintRestLibPropertyService(bluePrintProperties: BluePrintPropertiesService) : - BluePrintRestLibPropertyService(bluePrintProperties) { - - fun mockBlueprintWebClientService(selector: String): - MockBlueprintWebClientService { - val prefix = "blueprintsprocessor.restclient.$selector" - val restClientProperties = restClientProperties(prefix) - return mockBlueprintWebClientService(restClientProperties) - } - - private fun mockBlueprintWebClientService(restClientProperties: RestClientProperties): - MockBlueprintWebClientService { - return MockBlueprintWebClientService(restClientProperties) - } -} diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/mock/MockBlueprintRestLibPropertyService.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/mock/MockBlueprintRestLibPropertyService.kt new file mode 100644 index 000000000..b6c20cd5a --- /dev/null +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/mock/MockBlueprintRestLibPropertyService.kt @@ -0,0 +1,36 @@ +/* + * Copyright © 2019 IBM, Bell Canada. + * + * 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.functions.resource.resolution.mock + +import org.onap.ccsdk.cds.blueprintsprocessor.core.BlueprintPropertiesService +import org.onap.ccsdk.cds.blueprintsprocessor.rest.RestClientProperties +import org.onap.ccsdk.cds.blueprintsprocessor.rest.service.BlueprintRestLibPropertyService + +class MockBlueprintRestLibPropertyService(bluePrintProperties: BlueprintPropertiesService) : + BlueprintRestLibPropertyService(bluePrintProperties) { + + fun mockBlueprintWebClientService(selector: String): + MockBlueprintWebClientService { + val prefix = "blueprintsprocessor.restclient.$selector" + val restClientProperties = restClientProperties(prefix) + return mockBlueprintWebClientService(restClientProperties) + } + + private fun mockBlueprintWebClientService(restClientProperties: RestClientProperties): + MockBlueprintWebClientService { + return MockBlueprintWebClientService(restClientProperties) + } +} diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/mock/MockDatabaseConfiguration.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/mock/MockDatabaseConfiguration.kt index 2219f2348..653a2c1f4 100644 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/mock/MockDatabaseConfiguration.kt +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/mock/MockDatabaseConfiguration.kt @@ -17,9 +17,9 @@ package org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.moc import io.mockk.coEvery import io.mockk.mockk -import org.onap.ccsdk.cds.blueprintsprocessor.db.BluePrintDBLibGenericService -import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintValidatorService -import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintRuntimeService +import org.onap.ccsdk.cds.blueprintsprocessor.db.BlueprintDBLibGenericService +import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintValidatorService +import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintRuntimeService import org.springframework.context.annotation.Bean import org.springframework.context.annotation.Configuration @@ -27,8 +27,8 @@ import org.springframework.context.annotation.Configuration open class MockDBLibGenericService { @Bean(name = ["MariaDatabaseConfiguration", "MySqlDatabaseConfiguration"]) - open fun createDatabaseConfiguration(): BluePrintDBLibGenericService { - return mockk() + open fun createDatabaseConfiguration(): BlueprintDBLibGenericService { + return mockk() } } @@ -36,10 +36,10 @@ open class MockDBLibGenericService { open class MockBlueprintProcessorCatalogServiceImpl { @Bean(name = ["bluePrintRuntimeValidatorService"]) - open fun bluePrintRuntimeValidatorService(): BluePrintValidatorService { - val bluePrintValidatorService = mockk() - coEvery { bluePrintValidatorService.validateBluePrints(any()) } returns true - coEvery { bluePrintValidatorService.validateBluePrints(any>()) } returns true + open fun bluePrintRuntimeValidatorService(): BlueprintValidatorService { + val bluePrintValidatorService = mockk() + coEvery { bluePrintValidatorService.validateBlueprints(any()) } returns true + coEvery { bluePrintValidatorService.validateBlueprints(any>()) } returns true return bluePrintValidatorService } } diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/mock/MockRestResourceResolutionProcessor.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/mock/MockRestResourceResolutionProcessor.kt index 0312126b7..de46fe6f3 100644 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/mock/MockRestResourceResolutionProcessor.kt +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/mock/MockRestResourceResolutionProcessor.kt @@ -22,8 +22,8 @@ import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.Reso import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.RestResourceSource import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.processor.ResourceAssignmentProcessor import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.utils.ResourceAssignmentUtils -import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException -import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintTypes +import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintProcessorException +import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintTypes import org.onap.ccsdk.cds.controllerblueprints.core.asJsonPrimitive import org.onap.ccsdk.cds.controllerblueprints.core.nullToEmpty import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils @@ -33,7 +33,7 @@ import java.util.HashMap class MockRestResourceResolutionProcessor( private val blueprintRestLibPropertyService: - MockBluePrintRestLibPropertyService + MockBlueprintRestLibPropertyService ) : ResourceAssignmentProcessor() { private val logger = LoggerFactory.getLogger(MockRestResourceResolutionProcessor::class.java) @@ -97,12 +97,12 @@ class MockRestResourceResolutionProcessor( val errMsg = "Failed to get $dSource result for dictionary name ($dName) using urlPath ($urlPath) response_code: ($responseStatusCode)" logger.warn(errMsg) - throw BluePrintProcessorException(errMsg) + throw BlueprintProcessorException(errMsg) } } } catch (e: Exception) { ResourceAssignmentUtils.setFailedResourceDataValue(executionRequest, e.message) - throw BluePrintProcessorException( + throw BlueprintProcessorException( "Failed in template resolutionKey ($executionRequest) assignments with: ${e.message}", e ) @@ -110,14 +110,14 @@ class MockRestResourceResolutionProcessor( } override suspend fun recoverNB(runtimeException: RuntimeException, executionRequest: ResourceAssignment) { - raRuntimeService.getBluePrintError().addError(runtimeException.message!!) + raRuntimeService.getBlueprintError().addError(runtimeException.message!!) } private fun blueprintWebClientService(resourceAssignment: ResourceAssignment): MockBlueprintWebClientService { return blueprintRestLibPropertyService.mockBlueprintWebClientService(resourceAssignment.dictionarySource!!) } - @Throws(BluePrintProcessorException::class) + @Throws(BlueprintProcessorException::class) private fun populateResource( resourceAssignment: ResourceAssignment, sourceProperties: RestResourceSource, @@ -132,15 +132,15 @@ class MockRestResourceResolutionProcessor( val responseNode = JacksonUtils.jsonNode(restResponse).at(path) when (type) { - in BluePrintTypes.validPrimitiveTypes() -> { + in BlueprintTypes.validPrimitiveTypes() -> { ResourceAssignmentUtils.setResourceDataValue(resourceAssignment, raRuntimeService, responseNode) } - in BluePrintTypes.validCollectionTypes() -> { + in BlueprintTypes.validCollectionTypes() -> { // Array Types entrySchemaType = resourceAssignment.property!!.entrySchema!!.type val arrayNode = responseNode as ArrayNode - if (entrySchemaType !in BluePrintTypes.validPrimitiveTypes()) { + if (entrySchemaType !in BlueprintTypes.validPrimitiveTypes()) { val responseArrayNode = responseNode.toList() for (responseSingleJsonNode in responseArrayNode) { diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/CapabilityResourceResolutionProcessorTest.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/CapabilityResourceResolutionProcessorTest.kt index 1b0058b90..b289cfe3e 100644 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/CapabilityResourceResolutionProcessorTest.kt +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/CapabilityResourceResolutionProcessorTest.kt @@ -27,13 +27,13 @@ import org.junit.Test import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.ResourceAssignmentRuntimeService import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.resourceAssignment import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.ComponentFunctionScriptingService -import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants -import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintTypes +import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants +import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintTypes import org.onap.ccsdk.cds.controllerblueprints.core.asJsonPrimitive import org.onap.ccsdk.cds.controllerblueprints.core.data.PropertyDefinition import org.onap.ccsdk.cds.controllerblueprints.core.logger -import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintContext -import org.onap.ccsdk.cds.controllerblueprints.core.utils.BluePrintMetadataUtils +import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintContext +import org.onap.ccsdk.cds.controllerblueprints.core.utils.BlueprintMetadataUtils import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResourceAssignment import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResourceDefinition @@ -53,14 +53,14 @@ class CapabilityResourceResolutionProcessorTest { } returns MockCapabilityScriptRA() val raRuntimeService = mockk() - every { raRuntimeService.bluePrintContext() } returns mockk() + every { raRuntimeService.bluePrintContext() } returns mockk() every { raRuntimeService.getInputValue("test-property") } returns NullNode.getInstance() val capabilityResourceResolutionProcessor = CapabilityResourceResolutionProcessor(componentFunctionScriptingService) capabilityResourceResolutionProcessor.raRuntimeService = raRuntimeService - val resourceAssignment = BluePrintTypes.resourceAssignment( + val resourceAssignment = BlueprintTypes.resourceAssignment( name = "test-property", dictionaryName = "ra-dict-name", dictionarySource = "capability" ) { @@ -86,14 +86,14 @@ class CapabilityResourceResolutionProcessorTest { fun `test jython capability`() { runBlocking { - val bluePrintContext = BluePrintMetadataUtils.getBluePrintContext( + val bluePrintContext = BlueprintMetadataUtils.getBlueprintContext( "./../../../../components/model-catalog/blueprint-model/test-blueprint/capability_python" ) val componentFunctionScriptingService = mockk() coEvery { componentFunctionScriptingService - .scriptInstance(any(), BluePrintConstants.SCRIPT_JYTHON, any()) + .scriptInstance(any(), BlueprintConstants.SCRIPT_JYTHON, any()) } returns MockCapabilityScriptRA() val resourceAssignmentRuntimeService = ResourceAssignmentRuntimeService("1234", bluePrintContext) diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/DatabaseResourceResolutionProcessorTest.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/DatabaseResourceResolutionProcessorTest.kt index 0c8ec7d95..6689aff81 100644 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/DatabaseResourceResolutionProcessorTest.kt +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/DatabaseResourceResolutionProcessorTest.kt @@ -19,14 +19,14 @@ import kotlinx.coroutines.runBlocking import org.junit.Test import org.junit.runner.RunWith import org.onap.ccsdk.cds.blueprintsprocessor.db.PrimaryDBLibGenericService -import org.onap.ccsdk.cds.blueprintsprocessor.db.primary.BluePrintDBLibPropertyService +import org.onap.ccsdk.cds.blueprintsprocessor.db.primary.BlueprintDBLibPropertyService import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.ResourceAssignmentRuntimeService import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.TestDatabaseConfiguration import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.mock.MockBlueprintProcessorCatalogServiceImpl import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.mock.MockDBLibGenericService import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.utils.ResourceAssignmentUtils import org.onap.ccsdk.cds.controllerblueprints.core.data.PropertyDefinition -import org.onap.ccsdk.cds.controllerblueprints.core.utils.BluePrintMetadataUtils +import org.onap.ccsdk.cds.controllerblueprints.core.utils.BlueprintMetadataUtils import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResourceAssignment import org.springframework.beans.factory.annotation.Autowired import org.springframework.test.context.ContextConfiguration @@ -38,7 +38,7 @@ import kotlin.test.assertNotNull @ContextConfiguration( classes = [ TestDatabaseConfiguration::class, - PrimaryDBLibGenericService::class, BluePrintDBLibPropertyService::class, + PrimaryDBLibGenericService::class, BlueprintDBLibPropertyService::class, DatabaseResourceAssignmentProcessor::class, MockDBLibGenericService::class, MockBlueprintProcessorCatalogServiceImpl::class ] @@ -52,7 +52,7 @@ class DatabaseResourceResolutionProcessorTest { @Test fun `test database resource resolution processor db`() { runBlocking { - val bluePrintContext = BluePrintMetadataUtils.getBluePrintContext( + val bluePrintContext = BlueprintMetadataUtils.getBlueprintContext( "./../../../../components/model-catalog/blueprint-model/test-blueprint/baseconfiguration" ) diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/DefaultResourceResolutionProcessorTest.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/DefaultResourceResolutionProcessorTest.kt index a109131fe..7cec75950 100644 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/DefaultResourceResolutionProcessorTest.kt +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/DefaultResourceResolutionProcessorTest.kt @@ -20,7 +20,7 @@ import org.junit.Test import org.junit.runner.RunWith import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.ResourceAssignmentRuntimeService import org.onap.ccsdk.cds.controllerblueprints.core.data.PropertyDefinition -import org.onap.ccsdk.cds.controllerblueprints.core.utils.BluePrintMetadataUtils +import org.onap.ccsdk.cds.controllerblueprints.core.utils.BlueprintMetadataUtils import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResourceAssignment import org.springframework.beans.factory.annotation.Autowired import org.springframework.test.context.ContextConfiguration @@ -39,7 +39,7 @@ class DefaultResourceResolutionProcessorTest { @Test fun `test default resource resolution`() { runBlocking { - val bluePrintContext = BluePrintMetadataUtils.getBluePrintContext( + val bluePrintContext = BlueprintMetadataUtils.getBlueprintContext( "./../../../../components/model-catalog/blueprint-model/test-blueprint/baseconfiguration" ) diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/InputResourceResolutionProcessorTest.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/InputResourceResolutionProcessorTest.kt index cf8dc0c59..aae35f4d3 100644 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/InputResourceResolutionProcessorTest.kt +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/InputResourceResolutionProcessorTest.kt @@ -25,7 +25,7 @@ import org.junit.runner.RunWith import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.ResourceAssignmentRuntimeService import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.utils.ResourceAssignmentUtils import org.onap.ccsdk.cds.controllerblueprints.core.data.PropertyDefinition -import org.onap.ccsdk.cds.controllerblueprints.core.utils.BluePrintMetadataUtils +import org.onap.ccsdk.cds.controllerblueprints.core.utils.BlueprintMetadataUtils import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResourceAssignment import org.springframework.beans.factory.annotation.Autowired import org.springframework.test.context.ContextConfiguration @@ -45,7 +45,7 @@ class InputResourceResolutionProcessorTest { fun `InputResourceResolutionProcessor should be able to resolve a value for an input parameter`() { runBlocking { - val bluePrintContext = BluePrintMetadataUtils.getBluePrintContext( + val bluePrintContext = BlueprintMetadataUtils.getBlueprintContext( "./../../../../components/model-catalog/blueprint-model/test-blueprint/baseconfiguration" ) diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/RestResourceResolutionProcessorTest.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/RestResourceResolutionProcessorTest.kt index cb7214123..9fabf5dbd 100644 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/RestResourceResolutionProcessorTest.kt +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/RestResourceResolutionProcessorTest.kt @@ -18,15 +18,15 @@ package org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.pro import kotlinx.coroutines.runBlocking import org.junit.Test import org.junit.runner.RunWith -import org.onap.ccsdk.cds.blueprintsprocessor.core.BluePrintPropertiesService -import org.onap.ccsdk.cds.blueprintsprocessor.core.BluePrintPropertyConfiguration +import org.onap.ccsdk.cds.blueprintsprocessor.core.BlueprintPropertiesService +import org.onap.ccsdk.cds.blueprintsprocessor.core.BlueprintPropertyConfiguration import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.ResourceAssignmentRuntimeService -import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.mock.MockBluePrintRestLibPropertyService +import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.mock.MockBlueprintRestLibPropertyService import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.mock.MockRestResourceResolutionProcessor import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.utils.ResourceAssignmentUtils import org.onap.ccsdk.cds.blueprintsprocessor.rest.RestClientProperties import org.onap.ccsdk.cds.controllerblueprints.core.data.PropertyDefinition -import org.onap.ccsdk.cds.controllerblueprints.core.utils.BluePrintMetadataUtils +import org.onap.ccsdk.cds.controllerblueprints.core.utils.BlueprintMetadataUtils import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResourceAssignment import org.springframework.beans.factory.annotation.Autowired import org.springframework.test.context.ContextConfiguration @@ -38,15 +38,15 @@ import kotlin.test.assertNotNull @RunWith(SpringRunner::class) @ContextConfiguration( classes = [ - MockRestResourceResolutionProcessor::class, MockBluePrintRestLibPropertyService::class, - BluePrintPropertyConfiguration::class, BluePrintPropertiesService::class, RestClientProperties::class + MockRestResourceResolutionProcessor::class, MockBlueprintRestLibPropertyService::class, + BlueprintPropertyConfiguration::class, BlueprintPropertiesService::class, RestClientProperties::class ] ) @TestPropertySource(locations = ["classpath:application-test.properties"]) class RestResourceResolutionProcessorTest { @Autowired - lateinit var bluePrintRestLibPropertyService: MockBluePrintRestLibPropertyService + lateinit var bluePrintRestLibPropertyService: MockBlueprintRestLibPropertyService private lateinit var restResourceResolutionProcessor: MockRestResourceResolutionProcessor @@ -58,7 +58,7 @@ class RestResourceResolutionProcessorTest { @Test fun `test rest resource resolution`() { runBlocking { - val bluePrintContext = BluePrintMetadataUtils.getBluePrintContext( + val bluePrintContext = BlueprintMetadataUtils.getBlueprintContext( "./../../../../components/model-catalog/blueprint-model/test-blueprint/baseconfiguration" ) @@ -92,7 +92,7 @@ class RestResourceResolutionProcessorTest { @Test fun `test rest aai get resource resolution`() { runBlocking { - val bluePrintContext = BluePrintMetadataUtils.getBluePrintContext( + val bluePrintContext = BlueprintMetadataUtils.getBlueprintContext( "./../../../../components/model-catalog/blueprint-model/test-blueprint/baseconfiguration" ) @@ -126,7 +126,7 @@ class RestResourceResolutionProcessorTest { @Test fun `test rest aai put resource resolution`() { runBlocking { - val bluePrintContext = BluePrintMetadataUtils.getBluePrintContext( + val bluePrintContext = BlueprintMetadataUtils.getBlueprintContext( "./../../../../components/model-catalog/blueprint-model/test-blueprint/baseconfiguration" ) diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/utils/ResourceAssignmentUtilsTest.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/utils/ResourceAssignmentUtilsTest.kt index 2f07e3b9a..d9e93150c 100644 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/utils/ResourceAssignmentUtilsTest.kt +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/utils/ResourceAssignmentUtilsTest.kt @@ -36,7 +36,7 @@ import org.onap.ccsdk.cds.controllerblueprints.core.data.DataType import org.onap.ccsdk.cds.controllerblueprints.core.data.EntrySchema import org.onap.ccsdk.cds.controllerblueprints.core.data.NodeTemplate import org.onap.ccsdk.cds.controllerblueprints.core.data.PropertyDefinition -import org.onap.ccsdk.cds.controllerblueprints.core.utils.BluePrintMetadataUtils +import org.onap.ccsdk.cds.controllerblueprints.core.utils.BlueprintMetadataUtils import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResourceAssignment import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResourceDefinition @@ -70,7 +70,7 @@ class ResourceAssignmentUtilsTest { fun setup() { val bluePrintContext = runBlocking { - BluePrintMetadataUtils.getBluePrintContext( + BlueprintMetadataUtils.getBlueprintContext( "./../../../../components/model-catalog/blueprint-model/test-blueprint/baseconfiguration" ) } -- cgit 1.2.3-korg