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-26 14:49:21 +0200
commit52be297aa8167cc8f5ba519b6d387682f4c5d06b (patch)
tree80be6582fbaada69e42a2c639bf43927e52ebdf3
parent4367f68dcaf9170e8eea09d7f7e50f646c8e17ae (diff)
Make UatServices.verify working for bigger cba's
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
-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) {