PaymentService 정책 기반 전환 #1

Merged
forge-bot merged 4 commits from forge/BAIS-POLICY-1783705261-attempt-3 into main 2026-07-10 18:04:57 +00:00
Showing only changes of commit 861121ef3b - Show all commits

View file

@ -0,0 +1,25 @@
package com.example.baispolicy;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;
class PaymentServiceTest {
private final PaymentService paymentService = new PaymentService();
@Test
void testApprove_WithValidTransactionId_ShouldReturnApprovedMessage() {
String transactionId = "12345";
String result = paymentService.approve(transactionId);
assertEquals("APPROVED:12345", result);
}
@Test
void testApprove_WithBlankTransactionId_ShouldThrowException() {
assertThrows(IllegalArgumentException.class, () -> {
paymentService.approve("");
});
assertThrows(IllegalArgumentException.class, () -> {
paymentService.approve(null);
});
}
}