Compare commits
No commits in common. "main" and "forge/BAIS-NATIVE-1783698057-attempt-1" have entirely different histories.
main
...
forge/BAIS
4 changed files with 7 additions and 50 deletions
|
|
@ -1,3 +0,0 @@
|
||||||
# BAIS-SOURCE-1783702539-attempt-1
|
|
||||||
|
|
||||||
Forge 이슈 작업 브랜치 `forge/BAIS-SOURCE-1783702539-attempt-1`.
|
|
||||||
12
pom.xml
12
pom.xml
|
|
@ -1,15 +1,17 @@
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<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">
|
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>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
<groupId>com.example</groupId>
|
<groupId>com.example</groupId>
|
||||||
<artifactId>bais-gate-e2e</artifactId>
|
<artifactId>bais-gate-e2e</artifactId>
|
||||||
<version>1.0-SNAPSHOT</version>
|
<version>1.0.0</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-parent</artifactId>
|
<artifactId>spring-boot-starter-parent</artifactId>
|
||||||
<version>3.2.0</version>
|
<version>2.7.5</version>
|
||||||
<relativePath/> <!-- lookup parent from repository -->
|
<relativePath/> <!-- lookup parent from repository -->
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
|
@ -20,7 +22,7 @@
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter</artifactId>
|
<artifactId>spring-boot-starter-web</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
|
@ -37,4 +39,4 @@
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
</project>
|
</project>
|
||||||
|
|
@ -1,10 +0,0 @@
|
||||||
package com.example.baisgate;
|
|
||||||
|
|
||||||
public class PaymentService {
|
|
||||||
public String approve(String transactionId) {
|
|
||||||
if (transactionId == null || transactionId.trim().isEmpty()) {
|
|
||||||
throw new IllegalArgumentException("Transaction ID cannot be blank");
|
|
||||||
}
|
|
||||||
return "APPROVED:" + transactionId;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,32 +0,0 @@
|
||||||
package com.example.baisgate;
|
|
||||||
|
|
||||||
import org.junit.jupiter.api.Test;
|
|
||||||
import static org.junit.jupiter.api.Assertions.*;
|
|
||||||
|
|
||||||
class PaymentServiceTest {
|
|
||||||
|
|
||||||
@Test
|
|
||||||
void testApprove_WithValidTransactionId_ReturnsApproved() {
|
|
||||||
PaymentService paymentService = new PaymentService();
|
|
||||||
String result = paymentService.approve("12345");
|
|
||||||
assertEquals("APPROVED:12345", result);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
void testApprove_WithBlankTransactionId_ThrowsIllegalArgumentException() {
|
|
||||||
PaymentService paymentService = new PaymentService();
|
|
||||||
Exception exception = assertThrows(IllegalArgumentException.class, () -> {
|
|
||||||
paymentService.approve("");
|
|
||||||
});
|
|
||||||
assertEquals("Transaction ID cannot be blank", exception.getMessage());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
void testApprove_WithNullTransactionId_ThrowsIllegalArgumentException() {
|
|
||||||
PaymentService paymentService = new PaymentService();
|
|
||||||
Exception exception = assertThrows(IllegalArgumentException.class, () -> {
|
|
||||||
paymentService.approve(null);
|
|
||||||
});
|
|
||||||
assertEquals("Transaction ID cannot be blank", exception.getMessage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue