diff --git a/.forge/BAIS-MULTI-1783812074-attempt-1.md b/.forge/BAIS-MULTI-1783812074-attempt-1.md new file mode 100644 index 0000000..c17c09a --- /dev/null +++ b/.forge/BAIS-MULTI-1783812074-attempt-1.md @@ -0,0 +1,3 @@ +# BAIS-MULTI-1783812074-attempt-1 + +Forge 이슈 작업 브랜치 `forge/BAIS-MULTI-1783812074-attempt-1`. diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..c907802 --- /dev/null +++ b/pom.xml @@ -0,0 +1,18 @@ + + 4.0.0 + + com.klaro.bais + bais-platform + 1.0-SNAPSHOT + pom + + + services/payments + + + + org.springframework.boot + spring-boot-starter-parent + 3.5.14 + + diff --git a/services/payments/pom.xml b/services/payments/pom.xml new file mode 100644 index 0000000..64e32c5 --- /dev/null +++ b/services/payments/pom.xml @@ -0,0 +1,21 @@ + + 4.0.0 + + + ../../pom.xml + com.klaro.bais + bais-platform + 1.0-SNAPSHOT + + + payments + 1.0-SNAPSHOT + + + + org.apache.commons + commons-lang3 + 3.18.0 + + + 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..159a78d --- /dev/null +++ b/services/payments/src/main/java/com/klaro/bais/payments/PaymentReferenceService.java @@ -0,0 +1,9 @@ +package com.klaro.bais.payments; + +import org.apache.commons.lang3.StringUtils; + +public class PaymentReferenceService { + public String normalize(String input) { + return StringUtils.trimToEmpty(input); + } +} 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..6c139a6 --- /dev/null +++ b/services/payments/src/test/java/com/klaro/bais/payments/PaymentReferenceServiceTest.java @@ -0,0 +1,25 @@ +package com.klaro.bais.payments; + +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +class PaymentReferenceServiceTest { + + private final PaymentReferenceService service = new PaymentReferenceService(); + + @Test + void testNormalizeWithNull() { + assertEquals("", service.normalize(null)); + } + + @Test + void testNormalizeWithEmptyString() { + assertEquals("", service.normalize("")); + } + + @Test + void testNormalizeWithNormalString() { + assertEquals("Hello, World!", service.normalize(" Hello, World! ")); + } +}