BAIS payments 멀티모듈 최소 구현 #3

Open
forge-bot wants to merge 5 commits from forge/BAIS-CI-1783819034-attempt-3 into main
5 changed files with 75 additions and 0 deletions

View file

@ -0,0 +1,3 @@
# BAIS-CI-1783819034-attempt-3
Forge 이슈 작업 브랜치 `forge/BAIS-CI-1783819034-attempt-3`.

20
pom.xml Normal file
View file

@ -0,0 +1,20 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.5.14</version>
</parent>
<groupId>com.klaro.bais</groupId>
<artifactId>bais-platform</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<modules>
<module>services/payments</module>
</modules>
</project>

21
services/payments/pom.xml Normal file
View file

@ -0,0 +1,21 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.klaro.bais</groupId>
<artifactId>bais-platform</artifactId>
<version>1.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<artifactId>payments</artifactId>
<dependencies>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.18.0</version>
</dependency>
</dependencies>
</project>

View file

@ -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);
}
}

View file

@ -0,0 +1,22 @@
import static org.junit.jupiter.api.Assertions.assertEquals;
import org.junit.jupiter.api.Test;
class PaymentReferenceServiceTest {
private final PaymentReferenceService service = new PaymentReferenceService();
@Test
void testNormalize_NullString() {
assertEquals(""); // null should be normalized to empty string
}
@Test
void testNormalize_EmptyString() {
assertEquals(""); // empty string should remain empty
}
@Test
void testNormalize_ValidString() {
String input = " some text ";
assertEquals("some text", service.normalize(input)); // should trim spaces
}
}