From 8de37f9d3035b4a41e696b967f2222806c250925 Mon Sep 17 00:00:00 2001 From: "Singal, Kapil (ks220y)" Date: Fri, 11 Sep 2020 13:58:42 -0400 Subject: Refactoring poms groupId artifactId Issue-ID: CCSDK-2787 Signed-off-by: Singal, Kapil (ks220y) Change-Id: Ica64f0c793beabb47950c7bf1eede63a0dbf3cea --- .../test-blueprint-kotlin-parent/pom.xml | 90 +++++++++++----------- 1 file changed, 44 insertions(+), 46 deletions(-) (limited to 'components/model-catalog/blueprint-model/test-blueprint-kotlin-parent') diff --git a/components/model-catalog/blueprint-model/test-blueprint-kotlin-parent/pom.xml b/components/model-catalog/blueprint-model/test-blueprint-kotlin-parent/pom.xml index d8c3d80bd..626ca9e17 100644 --- a/components/model-catalog/blueprint-model/test-blueprint-kotlin-parent/pom.xml +++ b/components/model-catalog/blueprint-model/test-blueprint-kotlin-parent/pom.xml @@ -19,7 +19,7 @@ 4.0.0 - org.onap.ccsdk.cds.cba + org.onap.ccsdk.cds.components.cba blueprint-model 1.0.0-SNAPSHOT @@ -28,12 +28,11 @@ 1.0.0-SNAPSHOT pom - CBA - Test Kotlin scripts - CBA - Test Kotlin scripts + Components Model Catalog - Blueprints Model - Test Kotlin Parent - org.onap.ccsdk.cds.blueprintsprocessor + org.onap.ccsdk.cds.blueprintsprocessor.modules execution-service @@ -62,7 +61,6 @@ kotlinx-coroutines-test test - junit junit @@ -219,9 +217,9 @@ maven-assembly-plugin - org.onap.ccsdk.cds.blueprintsprocessor + org.onap.ccsdk.cds.components.cba cba-assembly-descriptor - 1.0.0-SNAPSHOT + ${ccsdk.cds.version} * @@ -300,61 +298,61 @@ def publishEndpoint = properties['cds.publish.endpoint'] ?: 'api/v1/blueprint-model/publish' def throwIfPropMissing(prop) { - value = properties[prop] - if (!value || "".equals(value)) { - throw new RuntimeException("Property missing: $prop") - } - return value + value = properties[prop] + if (!value || "".equals(value)) { + throw new RuntimeException("Property missing: $prop") + } + return value } def buildRequest(endpoint, fileName) { - body = new MultipartBody.Builder() - .setType(MultipartBody.FORM) - .addFormDataPart("file", - fileName, - RequestBody.create(MediaType.parse('application/zip'), new File(target, fileName))) - .build() + body = new MultipartBody.Builder() + .setType(MultipartBody.FORM) + .addFormDataPart("file", + fileName, + RequestBody.create(MediaType.parse('application/zip'), new File(target, fileName))) + .build() - return new Request.Builder() - .url("$protocol://$host:$port/$endpoint") - .addHeader('Authorization', Credentials.basic(userName, password)) - .post(body) - .build() + return new Request.Builder() + .url("$protocol://$host:$port/$endpoint") + .addHeader('Authorization', Credentials.basic(userName, password)) + .post(body) + .build() } def logAndThrow(msg) { - if(response) { - log.error(response.body().string()) - } - throw new RuntimeException(msg) + if(response) { + log.error(response.body().string()) + } + throw new RuntimeException(msg) } response = null try { - def client = new OkHttpClient() + def client = new OkHttpClient() - response = client.newCall(buildRequest(enrichEndpoint, cba)).execute() - if (!response || !response.isSuccessful()) { - logAndThrow("Failed to enrich CBA") - } + response = client.newCall(buildRequest(enrichEndpoint, cba)).execute() + if (!response || !response.isSuccessful()) { + logAndThrow("Failed to enrich CBA") + } - IOUtils.copy( - response.body().byteStream(), - new FileOutputStream(new File(target, enrichedCba)) - ) - log.info("Created enriched cba: $enrichedCba") + IOUtils.copy( + response.body().byteStream(), + new FileOutputStream(new File(target, enrichedCba)) + ) + log.info("Created enriched cba: $enrichedCba") - response = client.newCall(buildRequest(publishEndpoint, enrichedCba)).execute() - if (!response || !response.isSuccessful()) { - logAndThrow("Failed to publish CBA") - } + response = client.newCall(buildRequest(publishEndpoint, enrichedCba)).execute() + if (!response || !response.isSuccessful()) { + logAndThrow("Failed to publish CBA") + } - log.info("CBA Deployed") - log.info(response.body().string()) + log.info("CBA Deployed") + log.info(response.body().string()) } finally { - if (response) { - response.close() - } + if (response) { + response.close() + } } -- cgit 1.2.3-korg