Spring Boot 3.5.14 결제 서비스 최소 구현 (1/2) (BAIS-REVIEW-1783807356)
Some checks failed
ci / test (pull_request) Failing after 1m23s
Some checks failed
ci / test (pull_request) Failing after 1m23s
This commit is contained in:
parent
47fb32fc8a
commit
c7aca21178
1 changed files with 11 additions and 12 deletions
|
|
@ -1,25 +1,24 @@
|
||||||
package com.klaro.bais;
|
package com.klaro.bais;
|
||||||
|
|
||||||
import static org.junit.jupiter.api.Assertions.*;
|
|
||||||
import org.junit.jupiter.api.Test;
|
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
|
@Test
|
||||||
public void testApprovePositiveAmount() {
|
void testApprovePositiveAmount() {
|
||||||
PaymentService service = new PaymentService();
|
assertTrue(paymentService.approve(100)); // 100 should be approved
|
||||||
assertTrue(service.approve(100)); // Positive amount should be approved
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testApproveZeroAmount() {
|
void testApproveZeroAmount() {
|
||||||
PaymentService service = new PaymentService();
|
assertFalse(paymentService.approve(0)); // 0 should not be approved
|
||||||
assertFalse(service.approve(0)); // Zero amount should be rejected
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testApproveNegativeAmount() {
|
void testApproveNegativeAmount() {
|
||||||
PaymentService service = new PaymentService();
|
assertFalse(paymentService.approve(-100)); // Negative should not be approved
|
||||||
assertFalse(service.approve(-50)); // Negative amount should be rejected
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue