diff options
author | Frank Kimmlingen <frank.kimmlingen@telekom.de> | 2022-08-29 17:05:59 +0200 |
---|---|---|
committer | Frank Kimmlingen <frank.kimmlingen@telekom.de> | 2022-09-06 07:41:03 +0000 |
commit | 6c23c2bc522f6ddc9f61785489a8eab4969bb819 (patch) | |
tree | eb8aca349e38906fe9496d6b4d579e6f95dbb37c /ms | |
parent | edd7b5679350130e8cf5b2de01140dc09d01a80c (diff) |
SpyPostInterceptor in UatExecutor does not collect all responses
For one mocked backend system (selector) only the last request/response
pair is collected. With this fix all request/response pairs will be
collected.
Issue-ID: CCSDK-3747
Signed-off-by: Frank Kimmlingen <frank.kimmlingen@telekom.de>
Change-Id: Iccebdb153752988e1644092a8786891bdb17d5e6
(cherry picked from commit 4899f6bd4e00fa20bd0cac4a60c04a959b8e88c7)
Diffstat (limited to 'ms')
-rw-r--r-- | ms/blueprintsprocessor/application/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/uat/utils/UatExecutor.kt | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/ms/blueprintsprocessor/application/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/uat/utils/UatExecutor.kt b/ms/blueprintsprocessor/application/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/uat/utils/UatExecutor.kt index ae9b7d35c..5adc816cc 100644 --- a/ms/blueprintsprocessor/application/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/uat/utils/UatExecutor.kt +++ b/ms/blueprintsprocessor/application/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/uat/utils/UatExecutor.kt @@ -323,11 +323,15 @@ class UatExecutor( } override fun getInstance(selector: String, service: BlueprintWebClientService): BlueprintWebClientService { - val spiedService = SpyService(mapper, selector, service) + var spiedService = spies[selector] + if (spiedService != null) + return spiedService + + spiedService = SpyService(mapper, selector, service) spies[selector] = spiedService + return spiedService } - fun getSpies(): List<SpyService> = spies.values.toList() } |