From 52be297aa8167cc8f5ba519b6d387682f4c5d06b Mon Sep 17 00:00:00 2001 From: Frank Kimmlingen Date: Tue, 26 Sep 2023 14:49:21 +0200 Subject: 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 Change-Id: I908a251be76e4abfee5986729ae84b7f27057280 --- .../onap/ccsdk/cds/blueprintsprocessor/uat/utils/UatServices.kt | 9 ++++----- 1 file 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) { -- cgit 1.2.3-korg