PaymentService 정책 기반 전환 (BAIS-POLICY-1783705261)
All checks were successful
ci / test (pull_request) Successful in 1m20s

This commit is contained in:
forge-bot 2026-07-10 18:02:28 +00:00
parent 1d34b48888
commit 861121ef3b

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);
});
}
}