mise à jour pour correspondre avec le fait que la date désiré de début d'abonnement doit être le jour même ou plus tard

This commit is contained in:
2026-06-13 22:41:47 +02:00
parent 5d5945b48b
commit 2a6db59950
2 changed files with 14 additions and 14 deletions
@@ -25,9 +25,9 @@ public class SubscriptionConverterTest {
void shouldConvertSubscriptionInfoToDomain() {
// Given
PaymentMethodInfo paymentMethodInfo = new PaymentMethodInfo(PaymentType.CB.name(), "Maxime Lebreton");
LocalDate desiredStartDate = LocalDate.of(2026, 3, 24);
LocalDate desiredStartDate = LocalDate.of(2026, 6, 24);
SubscriptionInfo subscriptionInfo = new SubscriptionInfo(SubscriptionDurationDesired.THREE.getValue(), desiredStartDate);
LocalDate estimateEndDate = LocalDate.of(2026, 6, 24);
LocalDate estimateEndDate = LocalDate.of(2026, 9, 24);
// When
Subscription result = SubscriptionConverter.toDomain(subscriptionInfo, paymentMethodInfo);
@@ -55,8 +55,8 @@ public class SubscriptionConverterTest {
.paymentType(PaymentType.CB.name())
.details("Maxime Lebreton")
.build();
LocalDate desiredStartDate = LocalDate.of(2026, 3, 24);
LocalDate estimateEndDate = LocalDate.of(2026, 6, 24);
LocalDate desiredStartDate = LocalDate.of(2026, 6, 24);
LocalDate estimateEndDate = LocalDate.of(2026, 9, 24);
Subscription subscription = Subscription.builder()
.subscriptionId(UUID.randomUUID())
.customerId(UUID.randomUUID())
@@ -90,8 +90,8 @@ public class SubscriptionConverterTest {
.paymentType(PaymentType.CB.name())
.details(null)
.build();
LocalDate desiredStartDate = LocalDate.of(2026, 3, 24);
LocalDate estimateEndDate = LocalDate.of(2026, 6, 24);
LocalDate desiredStartDate = LocalDate.of(2026, 6, 24);
LocalDate estimateEndDate = LocalDate.of(2026, 9, 24);
Subscription subscription = Subscription.builder()
.subscriptionId(UUID.randomUUID())
.customerId(UUID.randomUUID())
@@ -114,7 +114,7 @@ public class SubscriptionConverterTest {
@DisplayName("Should preserve empty string values during conversion")
void shouldPreserveEmptyStrings() {
PaymentMethodInfo paymentMethodInfo = new PaymentMethodInfo(PaymentType.CB.name(), "");
LocalDate desiredStartDate = LocalDate.of(2026, 3, 24);
LocalDate desiredStartDate = LocalDate.of(2026, 6, 24);
SubscriptionInfo subscriptionInfo = new SubscriptionInfo(SubscriptionDurationDesired.THREE.getValue(), desiredStartDate);
Subscription domainResult = SubscriptionConverter.toDomain(subscriptionInfo, paymentMethodInfo);
@@ -22,9 +22,9 @@ public class SubscriptionTest {
String paymentType = PaymentType.CB.name();
Object details = new Object();
details = "Maxime Lebreton";
LocalDate desiredStartDate = LocalDate.of(2026, 3, 24);
LocalDate desiredStartDate = LocalDate.of(2026, 6, 24);
LocalDate startDate = desiredStartDate;
LocalDate estimateEndDate = LocalDate.of(2026, 6, 24);
LocalDate estimateEndDate = LocalDate.of(2026, 9, 24);
double monthlyAmount = 17.99;
PaymentMethod paymentMethod = PaymentMethod.builder()
@@ -80,7 +80,7 @@ public class SubscriptionTest {
@Test
@DisplayName("setStartDate should instantiate StartDate as the same value as the variable desiredStartDate")
void testSetStartDate() {
LocalDate desiredStartDate = LocalDate.of(2026, 3, 24);
LocalDate desiredStartDate = LocalDate.of(2026, 6, 24);
Subscription subscription = Subscription.builder()
.desiredStartDate(desiredStartDate)
.build();
@@ -94,8 +94,8 @@ public class SubscriptionTest {
@Test
@DisplayName("setEndDate should instantiate EndDate as the same value as the variable desiredStartDate + subscriptionDurationDesired")
void testSetEndDate() {
LocalDate desiredStartDate = LocalDate.of(2026, 3, 24);
LocalDate estimateEndDate = LocalDate.of(2026, 6, 24);
LocalDate desiredStartDate = LocalDate.of(2026, 6, 24);
LocalDate estimateEndDate = LocalDate.of(2026, 9, 24);
Subscription subscription = Subscription.builder()
.subscriptionDurationDesired(SubscriptionDurationDesired.THREE.getValue())
.desiredStartDate(desiredStartDate)
@@ -110,8 +110,8 @@ public class SubscriptionTest {
@Test
@DisplayName("setDateSubscription should instantiate StartDate and EndDate ")
void testSetDateSubscription() {
LocalDate desiredStartDate = LocalDate.of(2026, 3, 24);
LocalDate estimateEndDate = LocalDate.of(2026, 6, 24);
LocalDate desiredStartDate = LocalDate.of(2026, 6, 24);
LocalDate estimateEndDate = LocalDate.of(2026, 9, 24);
Subscription subscription = Subscription.builder()
.subscriptionDurationDesired(SubscriptionDurationDesired.THREE.getValue())
.desiredStartDate(desiredStartDate)