diff --git a/.forge/BAIS-MAVEN-1783816946-attempt-3.md b/.forge/BAIS-MAVEN-1783816946-attempt-3.md new file mode 100644 index 0000000..ab5f524 --- /dev/null +++ b/.forge/BAIS-MAVEN-1783816946-attempt-3.md @@ -0,0 +1,3 @@ +# BAIS-MAVEN-1783816946-attempt-3 + +Forge 이슈 작업 브랜치 `forge/BAIS-MAVEN-1783816946-attempt-3`. diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..12fa624 --- /dev/null +++ b/pom.xml @@ -0,0 +1,20 @@ + + 4.0.0 + + + org.springframework.boot + spring-boot-starter-parent + 3.5.14 + + + com.klaro.bais + bais-platform + 1.0-SNAPSHOT + pom + + + services/payments + + \ No newline at end of file diff --git a/services/payments/pom.xml b/services/payments/pom.xml new file mode 100644 index 0000000..8acb9ff --- /dev/null +++ b/services/payments/pom.xml @@ -0,0 +1,24 @@ + + 4.0.0 + + + com.klaro.bais + bais-platform + 1.0-SNAPSHOT + ../../pom.xml + + + com.klaro.bais + payments + 1.0-SNAPSHOT + + + + org.apache.commons + commons-lang3 + 3.18.0 + + + \ No newline at end of file diff --git a/services/payments/src/main/java/com/klaro/bais/payments/PaymentReferenceService.java b/services/payments/src/main/java/com/klaro/bais/payments/PaymentReferenceService.java new file mode 100644 index 0000000..6dc5371 --- /dev/null +++ b/services/payments/src/main/java/com/klaro/bais/payments/PaymentReferenceService.java @@ -0,0 +1,10 @@ +package com.klaro.bais.payments; + +import org.apache.commons.lang3.StringUtils; + +public class PaymentReferenceService { + + public String normalize(String input) { + return StringUtils.trimToEmpty(input); + } +} \ No newline at end of file diff --git a/services/payments/src/test/java/com/klaro/bais/payments/PaymentReferenceServiceTest.java b/services/payments/src/test/java/com/klaro/bais/payments/PaymentReferenceServiceTest.java new file mode 100644 index 0000000..6fd0cca --- /dev/null +++ b/services/payments/src/test/java/com/klaro/bais/payments/PaymentReferenceServiceTest.java @@ -0,0 +1,24 @@ +package com.klaro.bais.payments; + +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.*; + +class PaymentReferenceServiceTest { + + private final PaymentReferenceService service = new PaymentReferenceService(); + + @Test + void testNormalizeWithNull() { + assertEquals(""); // normalize(null) should return an empty string + } + + @Test + void testNormalizeWithWhitespace() { + assertEquals(""); // normalize(" ") should return an empty string + } + + @Test + void testNormalizeWithNormalString() { + assertEquals("test", service.normalize(" test ")); // Should trim and return "test" + } +} \ No newline at end of file