Skip to content

Commit

Permalink
Fix FilterPlansSpec test
Browse files Browse the repository at this point in the history
  • Loading branch information
rupertbates committed Sep 25, 2024
1 parent 9a93a48 commit 9c580ca
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
"serviceActivationDate": "2016-04-26",
"customerAcceptanceDate": "2016-11-21",
"subscriptionStartDate": "2016-08-14",
"subscriptionEndDate": "2024-09-23",
"subscriptionEndDate": "2099-09-23",
"lastBookingDate": "2024-04-04",
"termStartDate": "2023-09-23",
"termEndDate": "2024-09-23",
"termEndDate": "2099-09-23",
"initialTerm": 12,
"initialTermPeriodType": "Month",
"currentTerm": 12,
Expand Down Expand Up @@ -693,9 +693,9 @@
"usageRecordRatingOption": null,
"segment": 1,
"effectiveStartDate": "2024-02-23",
"effectiveEndDate": "2024-09-23",
"effectiveEndDate": "2099-09-23",
"processedThroughDate": "2024-07-23",
"chargedThroughDate": "2024-08-23",
"chargedThroughDate": "2099-08-23",
"done": false,
"triggerDate": null,
"triggerEvent": "CustomerAcceptance",
Expand Down Expand Up @@ -762,9 +762,9 @@
"usageRecordRatingOption": null,
"segment": 1,
"effectiveStartDate": "2024-02-23",
"effectiveEndDate": "2024-09-23",
"effectiveEndDate": "2099-09-23",
"processedThroughDate": "2024-07-23",
"chargedThroughDate": "2024-08-23",
"chargedThroughDate": "2099-08-23",
"done": false,
"triggerDate": null,
"triggerEvent": "CustomerAcceptance",
Expand Down Expand Up @@ -831,9 +831,9 @@
"usageRecordRatingOption": null,
"segment": 1,
"effectiveStartDate": "2024-02-23",
"effectiveEndDate": "2024-09-23",
"effectiveEndDate": "2099-09-23",
"processedThroughDate": "2024-07-23",
"chargedThroughDate": "2024-08-23",
"chargedThroughDate": "2099-08-23",
"done": false,
"triggerDate": null,
"triggerEvent": "CustomerAcceptance",
Expand Down Expand Up @@ -900,9 +900,9 @@
"usageRecordRatingOption": null,
"segment": 1,
"effectiveStartDate": "2024-02-23",
"effectiveEndDate": "2024-09-23",
"effectiveEndDate": "2099-09-23",
"processedThroughDate": "2024-07-23",
"chargedThroughDate": "2024-08-23",
"chargedThroughDate": "2099-08-23",
"done": false,
"triggerDate": null,
"triggerEvent": "CustomerAcceptance",
Expand Down Expand Up @@ -969,9 +969,9 @@
"usageRecordRatingOption": null,
"segment": 1,
"effectiveStartDate": "2024-02-23",
"effectiveEndDate": "2024-09-23",
"effectiveEndDate": "2099-09-23",
"processedThroughDate": "2024-07-23",
"chargedThroughDate": "2024-08-23",
"chargedThroughDate": "2099-08-23",
"done": false,
"triggerDate": null,
"triggerEvent": "CustomerAcceptance",
Expand Down Expand Up @@ -1038,9 +1038,9 @@
"usageRecordRatingOption": null,
"segment": 1,
"effectiveStartDate": "2024-02-23",
"effectiveEndDate": "2024-09-23",
"effectiveEndDate": "2099-09-23",
"processedThroughDate": "2024-07-23",
"chargedThroughDate": "2024-08-23",
"chargedThroughDate": "2099-08-23",
"done": false,
"triggerDate": null,
"triggerEvent": "CustomerAcceptance",
Expand Down Expand Up @@ -1107,9 +1107,9 @@
"usageRecordRatingOption": null,
"segment": 1,
"effectiveStartDate": "2024-02-23",
"effectiveEndDate": "2024-09-23",
"effectiveEndDate": "2099-09-23",
"processedThroughDate": "2024-07-23",
"chargedThroughDate": "2024-08-23",
"chargedThroughDate": "2099-08-23",
"done": false,
"triggerDate": null,
"triggerEvent": "CustomerAcceptance",
Expand Down Expand Up @@ -1176,9 +1176,9 @@
"usageRecordRatingOption": null,
"segment": 1,
"effectiveStartDate": "2024-02-23",
"effectiveEndDate": "2024-09-23",
"effectiveEndDate": "2099-09-23",
"processedThroughDate": "2024-07-23",
"chargedThroughDate": "2024-08-23",
"chargedThroughDate": "2099-08-23",
"done": false,
"triggerDate": null,
"triggerEvent": "CustomerAcceptance",
Expand Down Expand Up @@ -2391,9 +2391,9 @@
"usageRecordRatingOption": null,
"segment": 1,
"effectiveStartDate": "2017-08-23",
"effectiveEndDate": "2024-09-23",
"effectiveEndDate": "2099-09-23",
"processedThroughDate": "2024-07-23",
"chargedThroughDate": "2024-08-23",
"chargedThroughDate": "2099-08-23",
"done": false,
"triggerDate": null,
"triggerEvent": "CustomerAcceptance",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,18 @@ class SubReadsTest extends Specification {
// there are 5 active Quarterly which won't be readable
val actualSubscription = Resource.getJson("rest/plans/EchoLegacy.json").validate[Subscription](subscriptionReads).get

actualSubscription.name.get mustEqual ("A-S00ECHO")
actualSubscription.name.get mustEqual "A-S00ECHO"
actualSubscription.plan(catalogProd).product(catalogProd) mustEqual Product.Delivery
actualSubscription.plan(catalogProd).billingPeriod.toEither mustEqual Right(Month)
actualSubscription.plan(catalogProd).billingPeriod.toEither must beRight(Month)
}

"read a voucher subscription with a fixed recurring discount" in {

val actualSubscription = Resource.getJson("rest/plans/WithRecurringFixedDiscount.json").validate[Subscription](subscriptionReads).get

actualSubscription.name.get mustEqual ("A-S00FIXEDDISC")
actualSubscription.name.get mustEqual "A-S00FIXEDDISC"
actualSubscription.plan(catalogProd).product(catalogProd) mustEqual Product.Voucher
actualSubscription.plan(catalogProd).billingPeriod.toEither mustEqual Right(Month)
actualSubscription.plan(catalogProd).billingPeriod.toEither must beRight(Month)
actualSubscription.ratePlans.filter(_.end.isAfter(LocalDate.parse("2024-07-24"))) must containTheSameElementsAs(
List(FixedDiscountRecurringTestData.mainPlan, FixedDiscountRecurringTestData.discount),
)
Expand All @@ -96,7 +96,7 @@ object FixedDiscountRecurringTestData {
"Newspaper Voucher",
Some("Add"),
List(),
Some(LocalDate.parse("2024-08-23")),
Some(LocalDate.parse("2099-08-23")),
NonEmptyList(
RatePlanCharge(
SubscriptionRatePlanChargeId("withdiscountrateplanchargeid1"),
Expand Down Expand Up @@ -180,7 +180,7 @@ object FixedDiscountRecurringTestData {
),
),
LocalDate.parse("2024-02-23"),
LocalDate.parse("2024-09-23"),
LocalDate.parse("2099-09-23"),
)

val discount = RatePlan(
Expand All @@ -189,7 +189,7 @@ object FixedDiscountRecurringTestData {
"Discounts",
Some("Add"),
List(),
Some(LocalDate.parse("2024-08-23")),
Some(LocalDate.parse("2099-08-23")),
NonEmptyList(
RatePlanCharge(
SubscriptionRatePlanChargeId("withdiscountrateplanchargeid1"),
Expand All @@ -203,7 +203,7 @@ object FixedDiscountRecurringTestData {
),
),
LocalDate.parse("2017-08-23"),
LocalDate.parse("2024-09-23"),
LocalDate.parse("2099-09-23"),
)

}
Expand Down

0 comments on commit 9c580ca

Please sign in to comment.