Skip to content

Commit

Permalink
Merge pull request #5 from ADPRO-C11/staging
Browse files Browse the repository at this point in the history
Modify AdminSubscriptionTest and FactoryTest
  • Loading branch information
sdikyarts authored May 8, 2024
2 parents c69f426 + 6f70de4 commit 08e1cab
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,12 @@ public AdminSubscription(String subscriptionType, String subscriberName, String

public void setUniqueCode(String subscriptionType) {
String prefix = switch (subscriptionType) {
case "Monthly" -> "MTH-";
case "Quarterly" -> "QTR-";
case "Semi-Annual" -> "SAA-";
case "MONTHLY" -> "MTH-";
case "QUARTERLY" -> "QTR-";
case "SEMI-ANNUAL" -> "SAA-";
default -> throw new IllegalArgumentException("Invalid type");
};

String randomPart = UUID.randomUUID().toString();
randomPart = randomPart.replace("-", "").toUpperCase().substring(0, 16);
this.uniqueCode = prefix + randomPart;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ void testCreateAdminSubscriptionComplete() {
AdminSubscriptionFactory adminSubscriptionFactory = new AdminSubscriptionFactory();

AdminSubscription adminSubscription = adminSubscriptionFactory.create(
"Monthly",
"MONTHLY",
"Hwang Hyunjin",
"12345678910",
"12345678910"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@ void setUp() {
this.adminSubscription.setSubscriberName("Hwang Hyunjin");
this.adminSubscription.setSubscriberId("12345678910");
this.adminSubscription.setSubscriptionId("1234567890");
this.adminSubscription.setSubscriptionType("Monthly");
this.adminSubscription.setUniqueCode("MTH-1234567890");
this.adminSubscription.setSubscriptionType("MONTHLY");
this.adminSubscription.setUniqueCode("MONTHLY");
this.adminSubscription.setSubscriptionBoxId("12345678910");

this.adminSubscription.setSubscriptionStatus(SubscriptionStatus.PENDING.getValue());
}

Expand Down

0 comments on commit 08e1cab

Please sign in to comment.