Spring Boot 3.5.14 결제 서비스 최소 구현 (BAIS-REVIEW-1783807356)
Some checks failed
ci / test (pull_request) Failing after 1m16s
Some checks failed
ci / test (pull_request) Failing after 1m16s
This commit is contained in:
parent
020789d729
commit
527a8e1599
1 changed files with 25 additions and 0 deletions
25
src/test/java/com/klaro/bais/PaymentServiceTest.java
Normal file
25
src/test/java/com/klaro/bais/PaymentServiceTest.java
Normal file
|
|
@ -0,0 +1,25 @@
|
||||||
|
package com.klaro.bais;
|
||||||
|
|
||||||
|
import static org.junit.jupiter.api.Assertions.*;
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
|
public class PaymentServiceTest {
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testApprovePositiveAmount() {
|
||||||
|
PaymentService service = new PaymentService();
|
||||||
|
assertTrue(service.approve(100)); // Positive amount should be approved
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testApproveZeroAmount() {
|
||||||
|
PaymentService service = new PaymentService();
|
||||||
|
assertFalse(service.approve(0)); // Zero amount should be rejected
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testApproveNegativeAmount() {
|
||||||
|
PaymentService service = new PaymentService();
|
||||||
|
assertFalse(service.approve(-50)); // Negative amount should be rejected
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue