Compare commits
No commits in common. "64570f0082a50a06b981d9b11bb374984f09e756" and "f25350d6265b832d2ea05abe4676d9bb6e18c44e" have entirely different histories.
64570f0082
...
f25350d626
4 changed files with 0 additions and 77 deletions
|
|
@ -1,3 +0,0 @@
|
||||||
# BAIS-POLICY-1783705261-attempt-3
|
|
||||||
|
|
||||||
Forge 이슈 작업 브랜치 `forge/BAIS-POLICY-1783705261-attempt-3`.
|
|
||||||
39
pom.xml
39
pom.xml
|
|
@ -1,39 +0,0 @@
|
||||||
<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>
|
|
||||||
<groupId>com.example.baispolicy</groupId>
|
|
||||||
<artifactId>bais-policy</artifactId>
|
|
||||||
<version>1.0-SNAPSHOT</version>
|
|
||||||
<packaging>jar</packaging>
|
|
||||||
|
|
||||||
<parent>
|
|
||||||
<groupId>org.springframework.boot</groupId>
|
|
||||||
<artifactId>spring-boot-starter-parent</artifactId>
|
|
||||||
<version>3.5.14</version>
|
|
||||||
<relativePath/> <!-- lookup parent from repository -->
|
|
||||||
</parent>
|
|
||||||
|
|
||||||
<properties>
|
|
||||||
<java.version>17</java.version>
|
|
||||||
</properties>
|
|
||||||
|
|
||||||
<dependencies>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.boot</groupId>
|
|
||||||
<artifactId>spring-boot-starter</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.boot</groupId>
|
|
||||||
<artifactId>spring-boot-starter-test</artifactId>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
|
||||||
|
|
||||||
<build>
|
|
||||||
<plugins>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.springframework.boot</groupId>
|
|
||||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
|
||||||
</build>
|
|
||||||
</project>
|
|
||||||
|
|
@ -1,10 +0,0 @@
|
||||||
package com.example.baispolicy;
|
|
||||||
|
|
||||||
public class PaymentService {
|
|
||||||
public String approve(String transactionId) {
|
|
||||||
if (transactionId == null || transactionId.isBlank()) {
|
|
||||||
throw new IllegalArgumentException("Transaction ID must not be blank.");
|
|
||||||
}
|
|
||||||
return "APPROVED:" + transactionId;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,25 +0,0 @@
|
||||||
package com.example.baispolicy;
|
|
||||||
|
|
||||||
import org.junit.jupiter.api.Test;
|
|
||||||
import static org.junit.jupiter.api.Assertions.*;
|
|
||||||
|
|
||||||
class PaymentServiceTest {
|
|
||||||
private final PaymentService paymentService = new PaymentService();
|
|
||||||
|
|
||||||
@Test
|
|
||||||
void testApprove_WithValidTransactionId_ShouldReturnApprovedMessage() {
|
|
||||||
String transactionId = "12345";
|
|
||||||
String result = paymentService.approve(transactionId);
|
|
||||||
assertEquals("APPROVED:12345", result);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
void testApprove_WithBlankTransactionId_ShouldThrowException() {
|
|
||||||
assertThrows(IllegalArgumentException.class, () -> {
|
|
||||||
paymentService.approve("");
|
|
||||||
});
|
|
||||||
assertThrows(IllegalArgumentException.class, () -> {
|
|
||||||
paymentService.approve(null);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue