Make UatServices.verify working for bigger cba's
[ccsdk/cds.git] / ms / blueprintsprocessor / application / src / main / kotlin / org / onap / ccsdk / cds / blueprintsprocessor / uat / utils / UatServices.kt
index d233b8b..0c5105e 100644 (file)
@@ -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) {