Skip to content

Commit

Permalink
fix unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
xuelianhan007 committed Nov 20, 2024
1 parent 0c8dadb commit 02c37c9
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,12 @@ void testResponseMapper() {
"/mock/api-targets-mappers/api-target-mapper.quote.uni.read.sync.yaml");
validate(expected10, input10);

String expected11 = readCompactedFile("expected/expected-11-quote.eline.add.sync.json");
String input11 =
getTarget(
"/mock/api-targets/api-target.quote.eline.add.sync.yaml",
"/mock/api-targets-mappers/api-target-mapper.quote.eline.add.sync.yaml");
validate(expected9, input11);
validate(expected11, input11);

String input12 =
getTarget(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"id": "${entity.id}",
"buyerRequestedQuoteLevel": "${mefRequestBody.buyerRequestedQuoteLevel}",
"relatedContactInformation": "${T(com.consoleconnect.kraken.operator.gateway.func.SpelFunc).appendSellerInformation('sellerContactInformation',env.seller.name,env.seller.emailAddress,env.seller.number,mefRequestBody[relatedContactInformation]?:'')}",
"quoteItem": [
{
"requestedQuoteItemTerm": "${mefRequestBody.quoteItem[0].requestedQuoteItemTerm}",
"product": "${mefRequestBody.quoteItem[0].product}",
"action": "add",
"id": "${mefRequestBody.quoteItem[0].id}",
"state": "(((mefResponseBody.quoteItem[0].quoteItemPrice[0].price.dutyFreeAmount.value=='')or(T(java.lang.Double).parseDouble(mefResponseBody.quoteItem[0].quoteItemPrice[0].price.dutyFreeAmount.value)<0)?'unableToProvide':'approved.orderable'))",
"quoteItemTerm": "${T(java.util.Arrays).asList(mefRequestBody.quoteItem[0].requestedQuoteItemTerm)}",
"quoteItemPrice": [
{
"unitOfMeasure": "Gb",
"price": {
"dutyFreeAmount": {
"unit": "USD",
"value": "${responseBody.results[0].price}"
},
"taxRate": "16",
"taxIncludedAmount": {
"unit": "USD",
"value": "100"
}
},
"name": "name-here",
"priceType": "recurring",
"description": "",
"recurringChargePeriod": "${responseBody.results[0].entity.duration.unit}"
}
]
}
],
"quoteDate": "${T(com.consoleconnect.kraken.operator.core.toolkit.DateTime).nowInUTCFormatted()}",
"externalId": "${mefRequestBody[externalId]?:''}",
"instantSyncQuote": "${mefRequestBody[instantSyncQuote]?:''}",
"requestedQuoteCompletionDate": "${mefRequestBody[requestedQuoteCompletionDate]?:''}",
"quoteLevel": "${mefRequestBody.buyerRequestedQuoteLevel}",
"state": "(((mefResponseBody.quoteItem[0].quoteItemPrice[0].price.dutyFreeAmount.value=='')or(T(java.lang.Double).parseDouble(mefResponseBody.quoteItem[0].quoteItemPrice[0].price.dutyFreeAmount.value)<0)?'unableToProvide':'approved.orderable'))"
}

0 comments on commit 02c37c9

Please sign in to comment.