Skip to content

Commit

Permalink
added unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
xuelianhan007 committed Dec 17, 2024
1 parent 1fd0204 commit 900dc0c
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,11 @@ spec:
title: "MEFEndOfTermAction"
source: "@{{productOrderItem[0].requestedItemTerm.endOfTermAction}}"
sourceLocation: BODY
sourceType: discreteStr
sourceType: enum
sourceValues:
- roll
- autoDisconnect
- autoRenew
target: "roll"
targetLocation: BODY
requiredMapping: true
Expand All @@ -75,7 +79,16 @@ spec:
title: " quote item Term roll unit"
source: "@{{productOrderItem[0].requestedItemTerm.rollInterval.units}}"
sourceLocation: BODY
sourceType: discreteStr
sourceType: enum
sourceValues:
- calendarYears
- calendarMonths
- calendarDays
- calendarHours
- calendarMinutes
- businessDays
- businessHours
- businessMinutes
target: ""
targetLocation: BODY
requiredMapping: false
Expand Down Expand Up @@ -151,23 +164,23 @@ spec:
targetLocation: BODY
requiredMapping: true
- name: mapper.order.eline.add.product.productConfiguration.type
title: "connection type"
title: "customized product type"
source: "@{{productOrderItem[0].product.productConfiguration.type}}"
sourceLocation: BODY
sourceType: discreteStr
target: "@{{type}}"
targetLocation: BODY
requiredMapping: false
- name: mapper.order.eline.add.product.productConfiguration.destUNIMetroId
title: "connection destUNIMetroId"
title: "The metro id of the destination UNI"
source: "@{{productOrderItem[0].product.productConfiguration.destUNIMetroId}}"
sourceLocation: BODY
sourceType: discreteStr
target: "@{{destMetroId}}"
targetLocation: BODY
requiredMapping: false
- name: mapper.order.eline.add.product.productConfiguration.buyerCompanyId
title: "connection buyerCompanyId"
title: "The Id of buyer Company"
source: "@{{productOrderItem[0].product.productConfiguration.buyerCompanyId}}"
sourceLocation: BODY
sourceType: discreteStr
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,15 +216,20 @@ public static List<Pair<PathCheck, Object>> buildIllegalPathCheckList() {
new PathCheck(
"expect6", "user", ExpectTypeEnum.EXPECTED_NOT_BLANK, null, "error", 422, null);

PathCheck pathCheck7 =
new PathCheck(
"expect7", "user", ExpectTypeEnum.EXPECTED_TRUE, "${param.id}", "error", 400, "String");

Pair<PathCheck, Object> pair1 = Pair.of(pathCheck1, "user1");
Pair<PathCheck, Object> pair2 = Pair.of(pathCheck2, "user1");
Pair<PathCheck, Object> pair3A = Pair.of(pathCheck3, null);
Pair<PathCheck, Object> pair3B = Pair.of(pathCheck3, 123);
Pair<PathCheck, Object> pair4 = Pair.of(pathCheck4, "123");
Pair<PathCheck, Object> pair5 = Pair.of(pathCheck5, "123");
Pair<PathCheck, Object> pair6 = Pair.of(pathCheck6, "");
Pair<PathCheck, Object> pair7 = Pair.of(pathCheck7, Map.of("id", 123));

return List.of(pair1, pair2, pair3A, pair3B, pair4, pair5, pair6);
return List.of(pair1, pair2, pair3A, pair3B, pair4, pair5, pair6, pair7);
}

@ParameterizedTest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,11 @@ spec:
title: "MEFEndOfTermAction"
source: "@{{productOrderItem[0].requestedItemTerm.endOfTermAction}}"
sourceLocation: BODY
sourceType: discreteStr
sourceType: enum
sourceValues:
- roll
- autoDisconnect
- autoRenew
target: ""
targetLocation: BODY
requiredMapping: true
Expand All @@ -75,7 +79,16 @@ spec:
title: " quote item Term roll unit"
source: "@{{productOrderItem[0].requestedItemTerm.rollInterval.units}}"
sourceLocation: BODY
sourceType: discreteStr
sourceType: enum
sourceValues:
- calendarYears
- calendarMonths
- calendarDays
- calendarHours
- calendarMinutes
- businessDays
- businessHours
- businessMinutes
target: ""
targetLocation: BODY
requiredMapping: false
Expand All @@ -97,8 +110,6 @@ spec:
sourceLocation: BODY
sourceType: discreteInt
sourceValues:
- 1000
- 10000
target: ""
targetLocation: BODY
requiredMapping: true
Expand Down Expand Up @@ -126,6 +137,30 @@ spec:
target: ""
targetLocation: BODY
requiredMapping: false
- name: mapper.order.eline.add.product.productConfiguration.buyerCompanyId
title: "The Id of buyer Company"
source: "@{{productOrderItem[0].product.productConfiguration.buyerCompanyId}}"
sourceLocation: BODY
sourceType: discreteStr
target: ""
targetLocation: BODY
requiredMapping: false
- name: mapper.order.eline.add.product.productConfiguration.destUNIMetroId
title: "The metro id of the destination UNI"
source: "@{{productOrderItem[0].product.productConfiguration.destUNIMetroId}}"
sourceLocation: BODY
sourceType: discreteStr
target: ""
targetLocation: BODY
requiredMapping: false
- name: mapper.order.eline.add.product.productConfiguration.type
title: "customized product type"
source: "@{{productOrderItem[0].product.productConfiguration.type}}"
sourceLocation: BODY
sourceType: discreteStr
target: ""
targetLocation: BODY
requiredMapping: false
- name: mapper.order.eline.add.srcUNI
title: "source UNI or ENNI id"
source: "@{{productOrderItem[0].product.productRelationship[0].id}}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,16 @@ spec:
title: " quote item Term roll unit"
source: "@{{productOrderItem[0].requestedItemTerm.rollInterval.units}}"
sourceLocation: BODY
sourceType: discreteStr
sourceType: enum
sourceValues:
- calendarYears
- calendarMonths
- calendarDays
- calendarHours
- calendarMinutes
- businessDays
- businessHours
- businessMinutes
target: ""
targetLocation: BODY
requiredMapping: false
Expand All @@ -90,6 +99,15 @@ spec:
target: ''
targetLocation: BODY
requiredMapping: false
- name: mapper.order.uni.add.place.name
title: the keyName of the place where the products' installation must be done.
description: ''
source: '@{{productOrderItem[0].product.place[0].keyName}}'
sourceLocation: BODY
sourceType: discreteStr
target: ''
targetLocation: BODY
requiredMapping: false
- name: mapper.order.uni.add.bandwidthUnit
title: "The unit of bandwidth"
source: "@{{productOrderItem[0].product.productConfiguration.bandwidthUnit}}"
Expand All @@ -107,8 +125,6 @@ spec:
sourceLocation: BODY
sourceType: discreteInt
sourceValues:
- 1000
- 10000
target: ""
targetLocation: BODY
requiredMapping: true
Expand Down

0 comments on commit 900dc0c

Please sign in to comment.