aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrank Kimmlingen <frank.kimmlingen@telekom.de>2023-09-26 14:49:21 +0200
committerFrank Kimmlingen <frank.kimmlingen@telekom.de>2023-09-27 08:53:32 +0000
commit3916f0f92c1f8e053e57af376d3ad440ee201aa0 (patch)
tree498a976ab033c47ba1ce2ba0d70cc0793ee000da
parented019b8170306ffa623c8661d4df3e0c32d3be09 (diff)
Make UatServices.verify working for bigger cba's1.5.3
use awaitSingle to synchronize creation of the temp zip file and the access to this file. Issue-ID: CCSDK-3934 Signed-off-by: Frank Kimmlingen <frank.kimmlingen@telekom.de> Change-Id: I908a251be76e4abfee5986729ae84b7f27057280 (cherry picked from commit 52be297aa8167cc8f5ba519b6d387682f4c5d06b)
-rw-r--r--ms/blueprintsprocessor/application/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/uat/utils/UatServices.kt9
1 files changed, 4 insertions, 5 deletions
diff --git a/ms/blueprintsprocessor/application/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/uat/utils/UatServices.kt b/ms/blueprintsprocessor/application/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/uat/utils/UatServices.kt
index d233b8be3..0c5105ec9 100644
--- a/ms/blueprintsprocessor/application/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/uat/utils/UatServices.kt
+++ b/ms/blueprintsprocessor/application/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/uat/utils/UatServices.kt
@@ -58,11 +58,10 @@ open class UatServices(private val uatExecutor: UatExecutor, private val mapper:
val tempFile = createTempFile()
try {
cbaFile.transferTo(tempFile)
- .doOnSuccess {
- val uatSpec = readZipEntryAsText(tempFile, UAT_SPECIFICATION_FILE)
- val cbaBytes = tempFile.readBytes()
- uatExecutor.execute(uatSpec, cbaBytes)
- }.subscribe()
+ cbaFile.transferTo(tempFile).thenReturn(tempFile).awaitSingle()
+ val uatSpec = readZipEntryAsText(tempFile, UAT_SPECIFICATION_FILE)
+ val cbaBytes = tempFile.readBytes()
+ uatExecutor.execute(uatSpec, cbaBytes)
} catch (e: AssertionError) {
throw ResponseStatusException(HttpStatus.BAD_REQUEST, e.message)
} catch (t: Throwable) {