Spring Boot 3.5.14 결제 서비스 최소 구현 #1

Open
forge-bot wants to merge 7 commits from forge/BAIS-REVIEW-1783807356-attempt-1 into main
Showing only changes of commit c7aca21178 - Show all commits

View file

@ -1,25 +1,24 @@
package com.klaro.bais;
import static org.junit.jupiter.api.Assertions.*;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;
public class PaymentServiceTest {
class PaymentServiceTest {
private final PaymentService paymentService = new PaymentService();
@Test
public void testApprovePositiveAmount() {
PaymentService service = new PaymentService();
assertTrue(service.approve(100)); // Positive amount should be approved
void testApprovePositiveAmount() {
assertTrue(paymentService.approve(100)); // 100 should be approved
}
@Test
public void testApproveZeroAmount() {
PaymentService service = new PaymentService();
assertFalse(service.approve(0)); // Zero amount should be rejected
void testApproveZeroAmount() {
assertFalse(paymentService.approve(0)); // 0 should not be approved
}
@Test
public void testApproveNegativeAmount() {
PaymentService service = new PaymentService();
assertFalse(service.approve(-50)); // Negative amount should be rejected
void testApproveNegativeAmount() {
assertFalse(paymentService.approve(-100)); // Negative should not be approved
}
}
}