diff --git a/.forge/BAIS-REVIEW-1783808744-attempt-1.md b/.forge/BAIS-REVIEW-1783808744-attempt-1.md new file mode 100644 index 0000000..6549b79 --- /dev/null +++ b/.forge/BAIS-REVIEW-1783808744-attempt-1.md @@ -0,0 +1,3 @@ +# BAIS-REVIEW-1783808744-attempt-1 + +Forge 이슈 작업 브랜치 `forge/BAIS-REVIEW-1783808744-attempt-1`. diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..1da23fc --- /dev/null +++ b/pom.xml @@ -0,0 +1,42 @@ + + + 4.0.0 + + com.klaro.bais + payment-service + 1.0-SNAPSHOT + jar + + + org.springframework.boot + spring-boot-starter-parent + 3.5.14 + + + + 17 + + + + + org.springframework.boot + spring-boot-starter + + + org.springframework.boot + spring-boot-starter-test + test + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + \ No newline at end of file diff --git a/src/main/java/com/klaro/bais/PaymentService.java b/src/main/java/com/klaro/bais/PaymentService.java new file mode 100644 index 0000000..fe0ba41 --- /dev/null +++ b/src/main/java/com/klaro/bais/PaymentService.java @@ -0,0 +1,7 @@ +package com.klaro.bais; + +public class PaymentService { + public boolean approve(long amount) { + return amount > 0; + } +} \ No newline at end of file diff --git a/src/test/java/com/klaro/bais/PaymentServiceTest.java b/src/test/java/com/klaro/bais/PaymentServiceTest.java new file mode 100644 index 0000000..0d4599d --- /dev/null +++ b/src/test/java/com/klaro/bais/PaymentServiceTest.java @@ -0,0 +1,24 @@ +package com.klaro.bais; + +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.*; + +class PaymentServiceTest { + + private final PaymentService paymentService = new PaymentService(); + + @Test + void testApprovePositiveAmount() { + assertTrue(paymentService.approve(100)); + } + + @Test + void testApproveZeroAmount() { + assertFalse(paymentService.approve(0)); + } + + @Test + void testApproveNegativeAmount() { + assertFalse(paymentService.approve(-100)); + } +} \ No newline at end of file