diff options
author | Jozsef Csongvai <jozsef.csongvai@bell.ca> | 2021-07-26 12:00:59 -0400 |
---|---|---|
committer | Jozsef Csongvai <jozsef.csongvai@bell.ca> | 2021-07-28 15:44:01 -0400 |
commit | daab14bd058de198c80b71d63e108fd788b7f5ee (patch) | |
tree | 252cfdef5b2e1500e5bd152f3f5c52602b6b0deb /ms/blueprintsprocessor/modules/commons/rest-lib/src | |
parent | 82e396d6917519468376d177dd6a2710e84fa23a (diff) |
Revert "Renaming Files having BluePrint to have Blueprint"
The renaming in CCSDK-3098 caused breaking changes to the grpc api and
compile issues for kotlin scripts.
Issue-ID: CCSDK-3385
Change-Id: I0d745cb858371678eabcb2284671c1fd76a1ab6d
Signed-off-by: Jozsef Csongvai <jozsef.csongvai@bell.ca>
Diffstat (limited to 'ms/blueprintsprocessor/modules/commons/rest-lib/src')
9 files changed, 81 insertions, 81 deletions
diff --git a/ms/blueprintsprocessor/modules/commons/rest-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/BlueprintRestLibConfiguration.kt b/ms/blueprintsprocessor/modules/commons/rest-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/BluePrintRestLibConfiguration.kt index 701fd172f..6e9e4b554 100644 --- a/ms/blueprintsprocessor/modules/commons/rest-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/BlueprintRestLibConfiguration.kt +++ b/ms/blueprintsprocessor/modules/commons/rest-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/BluePrintRestLibConfiguration.kt @@ -19,9 +19,9 @@ package org.onap.ccsdk.cds.blueprintsprocessor.rest import com.fasterxml.jackson.databind.JsonNode -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.controllerblueprints.core.service.BlueprintDependencyService +import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintDependencyService import org.springframework.boot.context.properties.EnableConfigurationProperties import org.springframework.context.annotation.ComponentScan import org.springframework.context.annotation.Configuration @@ -29,19 +29,19 @@ import org.springframework.context.annotation.Configuration @Configuration @ComponentScan @EnableConfigurationProperties -open class BlueprintRestLibConfiguration +open class BluePrintRestLibConfiguration /** * Exposed Dependency Service by this Rest Lib Module */ -fun BlueprintDependencyService.restLibPropertyService(): BlueprintRestLibPropertyService = +fun BluePrintDependencyService.restLibPropertyService(): BluePrintRestLibPropertyService = instance(RestLibConstants.SERVICE_BLUEPRINT_REST_LIB_PROPERTY) -fun BlueprintDependencyService.restClientService(selector: String): BlueprintWebClientService { +fun BluePrintDependencyService.restClientService(selector: String): BlueprintWebClientService { return restLibPropertyService().blueprintWebClientService(selector) } -fun BlueprintDependencyService.restClientService(jsonNode: JsonNode): BlueprintWebClientService { +fun BluePrintDependencyService.restClientService(jsonNode: JsonNode): BlueprintWebClientService { return restLibPropertyService().blueprintWebClientService(jsonNode) } diff --git a/ms/blueprintsprocessor/modules/commons/rest-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/BlueprintRestLibData.kt b/ms/blueprintsprocessor/modules/commons/rest-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/BluePrintRestLibData.kt index 01011cc83..01011cc83 100644 --- a/ms/blueprintsprocessor/modules/commons/rest-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/BlueprintRestLibData.kt +++ b/ms/blueprintsprocessor/modules/commons/rest-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/BluePrintRestLibData.kt diff --git a/ms/blueprintsprocessor/modules/commons/rest-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/RestClientPropertiesDSL.kt b/ms/blueprintsprocessor/modules/commons/rest-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/RestClientPropertiesDSL.kt index b1692d93a..25107edea 100644 --- a/ms/blueprintsprocessor/modules/commons/rest-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/RestClientPropertiesDSL.kt +++ b/ms/blueprintsprocessor/modules/commons/rest-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/RestClientPropertiesDSL.kt @@ -17,8 +17,8 @@ package org.onap.ccsdk.cds.blueprintsprocessor.rest import com.fasterxml.jackson.databind.JsonNode -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.asJsonType import org.onap.ccsdk.cds.controllerblueprints.core.data.RelationshipType @@ -30,25 +30,25 @@ import org.onap.ccsdk.cds.controllerblueprints.core.dsl.relationshipType /** Relationships Type DSL for Rest */ fun ServiceTemplateBuilder.relationshipTypeConnectsToRestClient() { - val relationshipType = BlueprintTypes.relationshipTypeConnectsToRestClient() + val relationshipType = BluePrintTypes.relationshipTypeConnectsToRestClient() if (this.relationshipTypes == null) this.relationshipTypes = hashMapOf() this.relationshipTypes!![relationshipType.id!!] = relationshipType } -fun BlueprintTypes.relationshipTypeConnectsToRestClient(): RelationshipType { +fun BluePrintTypes.relationshipTypeConnectsToRestClient(): RelationshipType { return relationshipType( - id = BlueprintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO_REST_CLIENT, - version = BlueprintConstants.DEFAULT_VERSION_NUMBER, - derivedFrom = BlueprintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO, + id = BluePrintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO_REST_CLIENT, + version = BluePrintConstants.DEFAULT_VERSION_NUMBER, + derivedFrom = BluePrintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO, description = "Relationship connects to through" ) { property( - BlueprintConstants.PROPERTY_CONNECTION_CONFIG, - BlueprintConstants.DATA_TYPE_MAP, + BluePrintConstants.PROPERTY_CONNECTION_CONFIG, + BluePrintConstants.DATA_TYPE_MAP, true, "Connection Config details." ) - validTargetTypes(arrayListOf(BlueprintConstants.MODEL_TYPE_CAPABILITY_TYPE_ENDPOINT)) + validTargetTypes(arrayListOf(BluePrintConstants.MODEL_TYPE_CAPABILITY_TYPE_ENDPOINT)) } } @@ -66,45 +66,45 @@ fun TopologyTemplateBuilder.relationshipTemplateRestClient( open class RestClientRelationshipTemplateBuilder(name: String, description: String) : RelationshipTemplateBuilder( name, - BlueprintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO_REST_CLIENT, description + BluePrintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO_REST_CLIENT, description ) { fun basicAuth(block: BasicAuthRestClientPropertiesAssignmentBuilder.() -> Unit) { - property(BlueprintConstants.PROPERTY_CONNECTION_CONFIG, BlueprintTypes.basicAuthRestClientProperties(block)) + property(BluePrintConstants.PROPERTY_CONNECTION_CONFIG, BluePrintTypes.basicAuthRestClientProperties(block)) } fun tokenAuth(block: TokenAuthRestClientPropertiesAssignmentBuilder.() -> Unit) { - property(BlueprintConstants.PROPERTY_CONNECTION_CONFIG, BlueprintTypes.tokenAuthRestClientProperties(block)) + property(BluePrintConstants.PROPERTY_CONNECTION_CONFIG, BluePrintTypes.tokenAuthRestClientProperties(block)) } fun sslBasicAuth(block: SSLBasicAuthRestClientPropertiesBuilder.() -> Unit) { - property(BlueprintConstants.PROPERTY_CONNECTION_CONFIG, BlueprintTypes.sslBasicAuthRestClientProperties(block)) + property(BluePrintConstants.PROPERTY_CONNECTION_CONFIG, BluePrintTypes.sslBasicAuthRestClientProperties(block)) } fun sslAuth(block: SslAuthRestClientPropertiesAssignmentBuilder.() -> Unit) { - property(BlueprintConstants.PROPERTY_CONNECTION_CONFIG, BlueprintTypes.sslRestClientProperties(block)) + property(BluePrintConstants.PROPERTY_CONNECTION_CONFIG, BluePrintTypes.sslRestClientProperties(block)) } } -fun BlueprintTypes.basicAuthRestClientProperties(block: BasicAuthRestClientPropertiesAssignmentBuilder.() -> Unit): JsonNode { +fun BluePrintTypes.basicAuthRestClientProperties(block: BasicAuthRestClientPropertiesAssignmentBuilder.() -> Unit): JsonNode { val assignments = BasicAuthRestClientPropertiesAssignmentBuilder().apply(block).build() assignments[RestClientProperties::type.name] = RestLibConstants.TYPE_BASIC_AUTH.asJsonPrimitive() return assignments.asJsonType() } -fun BlueprintTypes.tokenAuthRestClientProperties(block: TokenAuthRestClientPropertiesAssignmentBuilder.() -> Unit): JsonNode { +fun BluePrintTypes.tokenAuthRestClientProperties(block: TokenAuthRestClientPropertiesAssignmentBuilder.() -> Unit): JsonNode { val assignments = TokenAuthRestClientPropertiesAssignmentBuilder().apply(block).build() assignments[RestClientProperties::type.name] = RestLibConstants.TYPE_TOKEN_AUTH.asJsonPrimitive() return assignments.asJsonType() } -fun BlueprintTypes.sslBasicAuthRestClientProperties(block: SSLBasicAuthRestClientPropertiesBuilder.() -> Unit): JsonNode { +fun BluePrintTypes.sslBasicAuthRestClientProperties(block: SSLBasicAuthRestClientPropertiesBuilder.() -> Unit): JsonNode { val assignments = SSLBasicAuthRestClientPropertiesBuilder().apply(block).build() assignments[RestClientProperties::type.name] = RestLibConstants.TYPE_SSL_BASIC_AUTH.asJsonPrimitive() return assignments.asJsonType() } -fun BlueprintTypes.sslRestClientProperties(block: SslAuthRestClientPropertiesAssignmentBuilder.() -> Unit): JsonNode { +fun BluePrintTypes.sslRestClientProperties(block: SslAuthRestClientPropertiesAssignmentBuilder.() -> Unit): JsonNode { val assignments = SslAuthRestClientPropertiesAssignmentBuilder().apply(block).build() assignments[RestClientProperties::type.name] = RestLibConstants.TYPE_SSL_NO_AUTH.asJsonPrimitive() return assignments.asJsonType() diff --git a/ms/blueprintsprocessor/modules/commons/rest-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/service/BlueprintRestLibPropertyService.kt b/ms/blueprintsprocessor/modules/commons/rest-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/service/BluePrintRestLibPropertyService.kt index c6d2ed905..4f91e547b 100644 --- a/ms/blueprintsprocessor/modules/commons/rest-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/service/BlueprintRestLibPropertyService.kt +++ b/ms/blueprintsprocessor/modules/commons/rest-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/service/BluePrintRestLibPropertyService.kt @@ -19,7 +19,7 @@ package org.onap.ccsdk.cds.blueprintsprocessor.rest.service import com.fasterxml.jackson.databind.JsonNode -import org.onap.ccsdk.cds.blueprintsprocessor.core.BlueprintPropertiesService +import org.onap.ccsdk.cds.blueprintsprocessor.core.BluePrintPropertiesService import org.onap.ccsdk.cds.blueprintsprocessor.rest.BasicAuthRestClientProperties import org.onap.ccsdk.cds.blueprintsprocessor.rest.PolicyManagerRestClientProperties import org.onap.ccsdk.cds.blueprintsprocessor.rest.RestClientProperties @@ -28,12 +28,12 @@ import org.onap.ccsdk.cds.blueprintsprocessor.rest.SSLBasicAuthRestClientPropert import org.onap.ccsdk.cds.blueprintsprocessor.rest.SSLRestClientProperties import org.onap.ccsdk.cds.blueprintsprocessor.rest.SSLTokenAuthRestClientProperties import org.onap.ccsdk.cds.blueprintsprocessor.rest.TokenAuthRestClientProperties -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintProcessorException +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils import org.springframework.stereotype.Service @Service(RestLibConstants.SERVICE_BLUEPRINT_REST_LIB_PROPERTY) -open class BlueprintRestLibPropertyService(private var bluePrintPropertiesService: BlueprintPropertiesService) { +open class BluePrintRestLibPropertyService(private var bluePrintPropertiesService: BluePrintPropertiesService) { private var preInterceptor: PreInterceptor? = null private var postInterceptor: PostInterceptor? = null @@ -88,7 +88,7 @@ open class BlueprintRestLibPropertyService(private var bluePrintPropertiesServic policyManagerRestClientProperties(prefix) } else -> { - throw BlueprintProcessorException( + throw BluePrintProcessorException( "Rest adaptor($type) is" + " not supported" ) @@ -120,7 +120,7 @@ open class BlueprintRestLibPropertyService(private var bluePrintPropertiesServic JacksonUtils.readValue(jsonNode, SSLRestClientProperties::class.java)!! } else -> { - throw BlueprintProcessorException( + throw BluePrintProcessorException( "Rest adaptor($type) is not supported" ) } @@ -141,7 +141,7 @@ open class BlueprintRestLibPropertyService(private var bluePrintPropertiesServic return BasicAuthRestClientService(restClientProperties) } else -> { - throw BlueprintProcessorException("couldn't get rest service for type:${restClientProperties.type} uri: ${restClientProperties.url}") + throw BluePrintProcessorException("couldn't get rest service for type:${restClientProperties.type} uri: ${restClientProperties.url}") } } } diff --git a/ms/blueprintsprocessor/modules/commons/rest-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/service/BlueprintWebClientService.kt b/ms/blueprintsprocessor/modules/commons/rest-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/service/BlueprintWebClientService.kt index 43dbcbeb2..945d29850 100644 --- a/ms/blueprintsprocessor/modules/commons/rest-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/service/BlueprintWebClientService.kt +++ b/ms/blueprintsprocessor/modules/commons/rest-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/service/BlueprintWebClientService.kt @@ -36,9 +36,9 @@ import org.apache.http.message.BasicHeader import org.onap.ccsdk.cds.blueprintsprocessor.rest.RestClientProperties import org.onap.ccsdk.cds.blueprintsprocessor.rest.RestLibConstants import org.onap.ccsdk.cds.blueprintsprocessor.rest.utils.WebClientUtils -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintProcessorException -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintRetryException -import org.onap.ccsdk.cds.controllerblueprints.core.utils.BlueprintIOUtils +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintRetryException +import org.onap.ccsdk.cds.controllerblueprints.core.utils.BluePrintIOUtils import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils import org.springframework.http.HttpHeaders import org.springframework.http.HttpMethod @@ -59,7 +59,7 @@ interface BlueprintWebClientService { .build() } - /** High performance non blocking Retry function, If execution block [block] throws BlueprintRetryException + /** High performance non blocking Retry function, If execution block [block] throws BluePrintRetryException * exception then this will perform wait and retrigger accoring to times [times] with delay [delay] */ suspend fun <T> retry( @@ -69,11 +69,11 @@ interface BlueprintWebClientService { block: suspend (Int) -> T ): T { val exceptionBlock = { e: Exception -> - if (e !is BlueprintRetryException) { + if (e !is BluePrintRetryException) { throw e } } - return BlueprintIOUtils.retry(times, initialDelay, delay, block, exceptionBlock) + return BluePrintIOUtils.retry(times, initialDelay, delay, block, exceptionBlock) } fun exchangeResource(methodType: String, path: String, request: String): WebClientResponse<String> { @@ -98,7 +98,7 @@ interface BlueprintWebClientService { HttpMethod.POST -> post(path, request, convertedHeaders, String::class.java) HttpMethod.PUT -> put(path, request, convertedHeaders, String::class.java) HttpMethod.PATCH -> patch(path, request, convertedHeaders, String::class.java) - else -> throw BlueprintProcessorException( + else -> throw BluePrintProcessorException( "Unsupported methodType($methodType) attempted on path($path)" ) } @@ -270,7 +270,7 @@ interface BlueprintWebClientService { HttpMethod.DELETE -> deleteNB(path, convertedHeaders, responseType) HttpMethod.PUT -> putNB(path, request, convertedHeaders, responseType) HttpMethod.PATCH -> patchNB(path, request, convertedHeaders, responseType) - else -> throw BlueprintProcessorException("Unsupported methodType($methodType)") + else -> throw BluePrintProcessorException("Unsupported methodType($methodType)") } } @@ -323,7 +323,7 @@ interface BlueprintWebClientService { " User-supplied \"additionalHeaders\" cannot contain AUTHORIZATION header with" + " auth-type \"${RestLibConstants.TYPE_BASIC_AUTH}\"" WebClientUtils.log.error(errMsg) - throw BlueprintProcessorException(errMsg) + throw BluePrintProcessorException(errMsg) } else { customHeaders.putAll(it) } diff --git a/ms/blueprintsprocessor/modules/commons/rest-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/service/RestLoggerService.kt b/ms/blueprintsprocessor/modules/commons/rest-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/service/RestLoggerService.kt index 8c7ba6573..611c0855d 100644 --- a/ms/blueprintsprocessor/modules/commons/rest-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/service/RestLoggerService.kt +++ b/ms/blueprintsprocessor/modules/commons/rest-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/service/RestLoggerService.kt @@ -29,12 +29,12 @@ import kotlinx.coroutines.reactor.ReactorContext import kotlinx.coroutines.reactor.asCoroutineContext import kotlinx.coroutines.withContext import org.apache.http.message.BasicHeader -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants.ONAP_INVOCATION_ID -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants.ONAP_ORIGINATOR_ID -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants.ONAP_PARTNER_NAME -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants.ONAP_REQUEST_ID -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants.ONAP_SUBREQUEST_ID +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants.ONAP_INVOCATION_ID +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants.ONAP_ORIGINATOR_ID +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants.ONAP_PARTNER_NAME +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants.ONAP_REQUEST_ID +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants.ONAP_SUBREQUEST_ID import org.onap.ccsdk.cds.controllerblueprints.core.MDCContext import org.onap.ccsdk.cds.controllerblueprints.core.defaultToEmpty import org.onap.ccsdk.cds.controllerblueprints.core.defaultToUUID @@ -65,7 +65,7 @@ class RestLoggerService { fun httpInvoking(headers: Array<BasicHeader>) { headers.plusElement(BasicHeader(ONAP_REQUEST_ID, MDC.get("InvocationID").defaultToUUID())) headers.plusElement(BasicHeader(ONAP_INVOCATION_ID, UUID.randomUUID().toString())) - headers.plusElement(BasicHeader(ONAP_PARTNER_NAME, BlueprintConstants.APP_NAME)) + headers.plusElement(BasicHeader(ONAP_PARTNER_NAME, BluePrintConstants.APP_NAME)) } } @@ -98,7 +98,7 @@ class RestLoggerService { resHeaders[ONAP_SUBREQUEST_ID] = MDC.get("SubRequestID") resHeaders[ONAP_ORIGINATOR_ID] = MDC.get("OriginatorID") resHeaders[ONAP_INVOCATION_ID] = MDC.get("InvocationID") - resHeaders[ONAP_PARTNER_NAME] = BlueprintConstants.APP_NAME + resHeaders[ONAP_PARTNER_NAME] = BluePrintConstants.APP_NAME } catch (e: Exception) { log.warn("couldn't set response headers", e) } finally { diff --git a/ms/blueprintsprocessor/modules/commons/rest-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/service/BlueprintRestLibPropertyServiceTest.kt b/ms/blueprintsprocessor/modules/commons/rest-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/service/BluePrintRestLibPropertyServiceTest.kt index 8843ff71d..0d187fbc2 100644 --- a/ms/blueprintsprocessor/modules/commons/rest-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/service/BlueprintRestLibPropertyServiceTest.kt +++ b/ms/blueprintsprocessor/modules/commons/rest-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/service/BluePrintRestLibPropertyServiceTest.kt @@ -23,13 +23,13 @@ import com.fasterxml.jackson.databind.JsonNode import com.fasterxml.jackson.databind.ObjectMapper 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.rest.BlueprintRestLibConfiguration +import org.onap.ccsdk.cds.blueprintsprocessor.core.BluePrintPropertiesService +import org.onap.ccsdk.cds.blueprintsprocessor.core.BluePrintPropertyConfiguration +import org.onap.ccsdk.cds.blueprintsprocessor.rest.BluePrintRestLibConfiguration import org.onap.ccsdk.cds.blueprintsprocessor.rest.SSLBasicAuthRestClientProperties import org.onap.ccsdk.cds.blueprintsprocessor.rest.SSLRestClientProperties import org.onap.ccsdk.cds.blueprintsprocessor.rest.SSLTokenAuthRestClientProperties -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintProcessorException +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException import org.springframework.beans.factory.annotation.Autowired import org.springframework.http.HttpHeaders import org.springframework.http.MediaType @@ -43,8 +43,8 @@ import kotlin.test.assertNotNull @RunWith(SpringRunner::class) @ContextConfiguration( classes = [ - BlueprintRestLibConfiguration::class, BlueprintPropertyConfiguration::class, - BlueprintPropertiesService::class + BluePrintRestLibConfiguration::class, BluePrintPropertyConfiguration::class, + BluePrintPropertiesService::class ] ) @TestPropertySource( @@ -75,10 +75,10 @@ import kotlin.test.assertNotNull "blueprintsprocessor.restclient.ssl.sslKeyPassword=changeit" ] ) -class BlueprintRestLibPropertyServiceTest { +class BluePrintRestLibPropertyServiceTest { @Autowired - lateinit var bluePrintRestLibPropertyService: BlueprintRestLibPropertyService + lateinit var bluePrintRestLibPropertyService: BluePrintRestLibPropertyService @Test fun testRestClientProperties() { @@ -287,7 +287,7 @@ class BlueprintRestLibPropertyServiceTest { additionalHeadersChangedContentTypeToAPPLICATION_XML(endPointWithHeadersJson) } - // called from within "assertFailsWith(exceptionClass = BlueprintProcessorException::class) {" + // called from within "assertFailsWith(exceptionClass = BluePrintProcessorException::class) {" private fun attemptToPutAuthorizationHeaderIntoAdditionalHeaders(endPointWithHeadersJson: String) { val parsedObj: JsonNode = defaultMapper.readTree(endPointWithHeadersJson) val bpWebClientService = @@ -296,13 +296,13 @@ class BlueprintRestLibPropertyServiceTest { } @Test - fun `BasicAuth WebClientService throws BlueprintProcessorException if additionalHeaders contain Authorization`() { - assertFailsWith(exceptionClass = BlueprintProcessorException::class) { + fun `BasicAuth WebClientService throws BluePrintProcessorException if additionalHeaders contain Authorization`() { + assertFailsWith(exceptionClass = BluePrintProcessorException::class) { val endPointWithHeadersJson = basicAuthEndpointWithHeadersField(additionalHeadersWithAuth) attemptToPutAuthorizationHeaderIntoAdditionalHeaders(endPointWithHeadersJson) } // spec says headers are case insensitive... - assertFailsWith(exceptionClass = BlueprintProcessorException::class) { + assertFailsWith(exceptionClass = BluePrintProcessorException::class) { val endPointWithHeadersJson = basicAuthEndpointWithHeadersField(additionalHeadersWithAuthLowercased) attemptToPutAuthorizationHeaderIntoAdditionalHeaders(endPointWithHeadersJson) } @@ -335,13 +335,13 @@ class BlueprintRestLibPropertyServiceTest { } @Test - fun `TokenAuth WebClientService throws BlueprintProcessorException if additionalHeaders contain Authorization`() { - assertFailsWith(exceptionClass = BlueprintProcessorException::class) { + fun `TokenAuth WebClientService throws BluePrintProcessorException if additionalHeaders contain Authorization`() { + assertFailsWith(exceptionClass = BluePrintProcessorException::class) { val endPointWithHeadersJson = sslTokenAuthEndpointWithHeadersField(additionalHeadersWithAuth) attemptToPutAuthorizationHeaderIntoAdditionalHeaders(endPointWithHeadersJson) } // spec says headers are case insensitive... - assertFailsWith(exceptionClass = BlueprintProcessorException::class) { + assertFailsWith(exceptionClass = BluePrintProcessorException::class) { val endPointWithHeadersJson = sslTokenAuthEndpointWithHeadersField(additionalHeadersWithAuthLowercased) attemptToPutAuthorizationHeaderIntoAdditionalHeaders(endPointWithHeadersJson) } @@ -375,13 +375,13 @@ class BlueprintRestLibPropertyServiceTest { } @Test - fun `SSLBasicAuth WebClientService throws BlueprintProcessorException if additionalHeaders contain Authorization`() { - assertFailsWith(exceptionClass = BlueprintProcessorException::class) { + fun `SSLBasicAuth WebClientService throws BluePrintProcessorException if additionalHeaders contain Authorization`() { + assertFailsWith(exceptionClass = BluePrintProcessorException::class) { val endPointWithHeadersJson = sslBasicAuthEndpointWithHeadersField(additionalHeadersWithAuth) attemptToPutAuthorizationHeaderIntoAdditionalHeaders(endPointWithHeadersJson) } // spec says headers are case insensitive... - assertFailsWith(exceptionClass = BlueprintProcessorException::class) { + assertFailsWith(exceptionClass = BluePrintProcessorException::class) { val endPointWithHeadersJson = sslBasicAuthEndpointWithHeadersField(additionalHeadersWithAuthLowercased) attemptToPutAuthorizationHeaderIntoAdditionalHeaders(endPointWithHeadersJson) } @@ -415,19 +415,19 @@ class BlueprintRestLibPropertyServiceTest { } @Test - fun `SSLNoAuth WebClientService throws BlueprintProcessorException if additionalHeaders contain Authorization`() { - assertFailsWith(exceptionClass = BlueprintProcessorException::class) { + fun `SSLNoAuth WebClientService throws BluePrintProcessorException if additionalHeaders contain Authorization`() { + assertFailsWith(exceptionClass = BluePrintProcessorException::class) { val endPointWithHeadersJson = sslNoAuthEndpointWithHeadersField(additionalHeadersWithAuth) attemptToPutAuthorizationHeaderIntoAdditionalHeaders(endPointWithHeadersJson) } // spec says headers are case insensitive... - assertFailsWith(exceptionClass = BlueprintProcessorException::class) { + assertFailsWith(exceptionClass = BluePrintProcessorException::class) { val endPointWithHeadersJson = sslNoAuthEndpointWithHeadersField(additionalHeadersWithAuthLowercased) attemptToPutAuthorizationHeaderIntoAdditionalHeaders(endPointWithHeadersJson) } } - companion object BlueprintRestLibPropertyServiceTest { + companion object BluePrintRestLibPropertyServiceTest { val defaultMapper = ObjectMapper() val expectedTokenAuthDefaultHeaders = mapOf<String, String>( diff --git a/ms/blueprintsprocessor/modules/commons/rest-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/service/RestClientPropertiesDSLTest.kt b/ms/blueprintsprocessor/modules/commons/rest-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/service/RestClientPropertiesDSLTest.kt index 6b083aaad..f06f827ad 100644 --- a/ms/blueprintsprocessor/modules/commons/rest-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/service/RestClientPropertiesDSLTest.kt +++ b/ms/blueprintsprocessor/modules/commons/rest-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/service/RestClientPropertiesDSLTest.kt @@ -19,7 +19,7 @@ package org.onap.ccsdk.cds.blueprintsprocessor.rest.service import org.junit.Test import org.onap.ccsdk.cds.blueprintsprocessor.rest.relationshipTemplateRestClient import org.onap.ccsdk.cds.blueprintsprocessor.rest.relationshipTypeConnectsToRestClient -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants import org.onap.ccsdk.cds.controllerblueprints.core.dsl.relationshipTypeConnectsTo import org.onap.ccsdk.cds.controllerblueprints.core.dsl.serviceTemplate import kotlin.test.assertEquals @@ -73,12 +73,12 @@ class RestClientPropertiesDSLTest { assertNotNull(relationshipTypes, "failed to get relationship types") assertEquals(2, relationshipTypes.size, "relationshipTypes doesn't match") assertNotNull( - relationshipTypes[BlueprintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO], - "failed to get ${BlueprintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO}" + relationshipTypes[BluePrintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO], + "failed to get ${BluePrintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO}" ) assertNotNull( - relationshipTypes[BlueprintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO_REST_CLIENT], - "failed to get ${BlueprintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO_REST_CLIENT}" + relationshipTypes[BluePrintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO_REST_CLIENT], + "failed to get ${BluePrintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO_REST_CLIENT}" ) } } diff --git a/ms/blueprintsprocessor/modules/commons/rest-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/service/RestClientServiceTest.kt b/ms/blueprintsprocessor/modules/commons/rest-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/service/RestClientServiceTest.kt index e14e035a9..030996685 100644 --- a/ms/blueprintsprocessor/modules/commons/rest-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/service/RestClientServiceTest.kt +++ b/ms/blueprintsprocessor/modules/commons/rest-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/service/RestClientServiceTest.kt @@ -27,9 +27,9 @@ import org.junit.After import org.junit.Before 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.rest.BlueprintRestLibConfiguration +import org.onap.ccsdk.cds.blueprintsprocessor.core.BluePrintPropertiesService +import org.onap.ccsdk.cds.blueprintsprocessor.core.BluePrintPropertyConfiguration +import org.onap.ccsdk.cds.blueprintsprocessor.rest.BluePrintRestLibConfiguration import org.springframework.beans.factory.annotation.Autowired import org.springframework.boot.autoconfigure.EnableAutoConfiguration import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration @@ -66,9 +66,9 @@ import kotlin.test.assertNotNull @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT) @ContextConfiguration( classes = [ - BlueprintRestLibConfiguration::class, SampleController::class, + BluePrintRestLibConfiguration::class, SampleController::class, SecurityConfiguration::class, - BlueprintPropertyConfiguration::class, BlueprintPropertiesService::class + BluePrintPropertyConfiguration::class, BluePrintPropertiesService::class ] ) @TestPropertySource( @@ -96,7 +96,7 @@ import kotlin.test.assertNotNull class RestClientServiceTest { @Autowired - lateinit var bluePrintRestLibPropertyService: BlueprintRestLibPropertyService + lateinit var bluePrintRestLibPropertyService: BluePrintRestLibPropertyService @Autowired lateinit var httpHandler: HttpHandler |