From 73745fdebf9cdb8c068b9b893e7918dc09932b87 Mon Sep 17 00:00:00 2001 From: xuelianhan007 Date: Tue, 5 Nov 2024 14:49:22 +0800 Subject: [PATCH] added codes --- .../mock/mapping-matrix/mapping.matrix.quote.eline.add.yaml | 2 +- .../mock/mapping-matrix/mapping.matrix.quote.uni.add.yaml | 2 +- .../gateway/runner/MappingMatrixCheckerActionRunner.java | 3 +-- .../gateway/runner/MappingMatrixCheckerActionRunnerTest.java | 3 ++- .../mapping-matrix/mapping.matrix.quote.uni.add.yaml | 2 +- .../mapping-matrix/mapping.matrix.quote.eline.add.yaml | 2 +- .../mapping-matrix/mapping.matrix.quote.uni.add.yaml | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/kraken-app/kraken-app-hub/src/test/resources/mock/mapping-matrix/mapping.matrix.quote.eline.add.yaml b/kraken-app/kraken-app-hub/src/test/resources/mock/mapping-matrix/mapping.matrix.quote.eline.add.yaml index 29598f09..6c22de46 100644 --- a/kraken-app/kraken-app-hub/src/test/resources/mock/mapping-matrix/mapping.matrix.quote.eline.add.yaml +++ b/kraken-app/kraken-app-hub/src/test/resources/mock/mapping-matrix/mapping.matrix.quote.eline.add.yaml @@ -13,7 +13,7 @@ spec: - name: enabled expectType: EXPECTED value: false - errorMsg: "instantSyncQuote==false" + errorMsg: "api use case is not supported : disabled : instantSyncQuote==false" - name: product_type_eline path: "$.body.quoteItem[*].product.productConfiguration.['@type']" expectType: EXPECTED diff --git a/kraken-app/kraken-app-hub/src/test/resources/mock/mapping-matrix/mapping.matrix.quote.uni.add.yaml b/kraken-app/kraken-app-hub/src/test/resources/mock/mapping-matrix/mapping.matrix.quote.uni.add.yaml index c55adb76..ba5cd132 100644 --- a/kraken-app/kraken-app-hub/src/test/resources/mock/mapping-matrix/mapping.matrix.quote.uni.add.yaml +++ b/kraken-app/kraken-app-hub/src/test/resources/mock/mapping-matrix/mapping.matrix.quote.uni.add.yaml @@ -13,7 +13,7 @@ spec: - name: enabled expectType: EXPECTED value: false - errorMsg: "instantSyncQuote==false" + errorMsg: "api use case is not supported : disabled : instantSyncQuote==false" - name: product_type_UNI path: "$.body.quoteItem[*].product.productConfiguration.['@type']" expectType: EXPECTED diff --git a/kraken-java-sdk/kraken-java-sdk-gateway/src/main/java/com/consoleconnect/kraken/operator/gateway/runner/MappingMatrixCheckerActionRunner.java b/kraken-java-sdk/kraken-java-sdk-gateway/src/main/java/com/consoleconnect/kraken/operator/gateway/runner/MappingMatrixCheckerActionRunner.java index fca74923..6e50ed0d 100644 --- a/kraken-java-sdk/kraken-java-sdk-gateway/src/main/java/com/consoleconnect/kraken/operator/gateway/runner/MappingMatrixCheckerActionRunner.java +++ b/kraken-java-sdk/kraken-java-sdk-gateway/src/main/java/com/consoleconnect/kraken/operator/gateway/runner/MappingMatrixCheckerActionRunner.java @@ -145,8 +145,7 @@ public void enableChecking(Map> facets, String targetKey if (Objects.isNull(enabledOpt.get().errorMsg)) { throw KrakenException.badRequest(MESSAGE_ALERT.formatted(":disabled")); } else { - throw KrakenException.badRequest( - MESSAGE_ALERT.formatted(":disabled " + enabledOpt.get().errorMsg)); + throw KrakenException.badRequest(enabledOpt.get().errorMsg); } } } diff --git a/kraken-java-sdk/kraken-java-sdk-gateway/src/test/java/com/consoleconnect/kraken/operator/gateway/runner/MappingMatrixCheckerActionRunnerTest.java b/kraken-java-sdk/kraken-java-sdk-gateway/src/test/java/com/consoleconnect/kraken/operator/gateway/runner/MappingMatrixCheckerActionRunnerTest.java index 969c2c3f..f6b373bc 100644 --- a/kraken-java-sdk/kraken-java-sdk-gateway/src/test/java/com/consoleconnect/kraken/operator/gateway/runner/MappingMatrixCheckerActionRunnerTest.java +++ b/kraken-java-sdk/kraken-java-sdk-gateway/src/test/java/com/consoleconnect/kraken/operator/gateway/runner/MappingMatrixCheckerActionRunnerTest.java @@ -142,7 +142,8 @@ void givenPayloadMissMappingParam_whenOnCheck_thenReturnError() { @Order(4) @SneakyThrows void givenErrorMsgInMatrixItem_whenChecking_thenThrowsExceptionMessageAsExpected() { - validateQuoteRequest("/mockData/quoteWithInstantSyncFalse.json", "instantSyncQuote==false"); + String expected = "api use case is not supported : disabled : instantSyncQuote==false"; + validateQuoteRequest("/mockData/quoteWithInstantSyncFalse.json", expected); } private void validateOrderRequest(String request, String matchedMsg) throws IOException { diff --git a/kraken-java-sdk/kraken-java-sdk-gateway/src/test/resources/deployment-config/components/mapping-matrix/mapping.matrix.quote.uni.add.yaml b/kraken-java-sdk/kraken-java-sdk-gateway/src/test/resources/deployment-config/components/mapping-matrix/mapping.matrix.quote.uni.add.yaml index c55adb76..ba5cd132 100644 --- a/kraken-java-sdk/kraken-java-sdk-gateway/src/test/resources/deployment-config/components/mapping-matrix/mapping.matrix.quote.uni.add.yaml +++ b/kraken-java-sdk/kraken-java-sdk-gateway/src/test/resources/deployment-config/components/mapping-matrix/mapping.matrix.quote.uni.add.yaml @@ -13,7 +13,7 @@ spec: - name: enabled expectType: EXPECTED value: false - errorMsg: "instantSyncQuote==false" + errorMsg: "api use case is not supported : disabled : instantSyncQuote==false" - name: product_type_UNI path: "$.body.quoteItem[*].product.productConfiguration.['@type']" expectType: EXPECTED diff --git a/kraken-java-sdk/kraken-java-sdk-mef/src/main/resources/mef-sonata/mapping-matrix/mapping.matrix.quote.eline.add.yaml b/kraken-java-sdk/kraken-java-sdk-mef/src/main/resources/mef-sonata/mapping-matrix/mapping.matrix.quote.eline.add.yaml index 29598f09..6c22de46 100644 --- a/kraken-java-sdk/kraken-java-sdk-mef/src/main/resources/mef-sonata/mapping-matrix/mapping.matrix.quote.eline.add.yaml +++ b/kraken-java-sdk/kraken-java-sdk-mef/src/main/resources/mef-sonata/mapping-matrix/mapping.matrix.quote.eline.add.yaml @@ -13,7 +13,7 @@ spec: - name: enabled expectType: EXPECTED value: false - errorMsg: "instantSyncQuote==false" + errorMsg: "api use case is not supported : disabled : instantSyncQuote==false" - name: product_type_eline path: "$.body.quoteItem[*].product.productConfiguration.['@type']" expectType: EXPECTED diff --git a/kraken-java-sdk/kraken-java-sdk-mef/src/main/resources/mef-sonata/mapping-matrix/mapping.matrix.quote.uni.add.yaml b/kraken-java-sdk/kraken-java-sdk-mef/src/main/resources/mef-sonata/mapping-matrix/mapping.matrix.quote.uni.add.yaml index c55adb76..ba5cd132 100644 --- a/kraken-java-sdk/kraken-java-sdk-mef/src/main/resources/mef-sonata/mapping-matrix/mapping.matrix.quote.uni.add.yaml +++ b/kraken-java-sdk/kraken-java-sdk-mef/src/main/resources/mef-sonata/mapping-matrix/mapping.matrix.quote.uni.add.yaml @@ -13,7 +13,7 @@ spec: - name: enabled expectType: EXPECTED value: false - errorMsg: "instantSyncQuote==false" + errorMsg: "api use case is not supported : disabled : instantSyncQuote==false" - name: product_type_UNI path: "$.body.quoteItem[*].product.productConfiguration.['@type']" expectType: EXPECTED