Compare commits
4 commits
main
...
forge/BAIS
| Author | SHA1 | Date | |
|---|---|---|---|
| 3714a80049 | |||
| 9159911f44 | |||
| f9d94d4809 | |||
| 351080a852 |
11 changed files with 46 additions and 84 deletions
3
.forge/BAIS-E2E-MIG-001-attempt-2.md
Normal file
3
.forge/BAIS-E2E-MIG-001-attempt-2.md
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
# BAIS-E2E-MIG-001-attempt-2
|
||||||
|
|
||||||
|
Forge 이슈 작업 브랜치 `forge/BAIS-E2E-MIG-001-attempt-2`.
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
# BAIS-NATIVE-1783698057-attempt-1
|
|
||||||
|
|
||||||
Forge 이슈 작업 브랜치 `forge/BAIS-NATIVE-1783698057-attempt-1`.
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
# BAIS-SOURCE-1783702539-attempt-1
|
|
||||||
|
|
||||||
Forge 이슈 작업 브랜치 `forge/BAIS-SOURCE-1783702539-attempt-1`.
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
name: ci
|
name: ci
|
||||||
on: [pull_request]
|
on: [push, pull_request]
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
|
||||||
30
pom.xml
30
pom.xml
|
|
@ -1,18 +1,14 @@
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<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-authorization-service</artifactId>
|
||||||
<version>1.0-SNAPSHOT</version>
|
<version>1.0-SNAPSHOT</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<parent>
|
|
||||||
<groupId>org.springframework.boot</groupId>
|
|
||||||
<artifactId>spring-boot-starter-parent</artifactId>
|
|
||||||
<version>3.2.0</version>
|
|
||||||
<relativePath/> <!-- lookup parent from repository -->
|
|
||||||
</parent>
|
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<java.version>17</java.version>
|
<java.version>17</java.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
@ -32,9 +28,19 @@
|
||||||
<build>
|
<build>
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
|
<version>3.8.1</version>
|
||||||
|
<configuration>
|
||||||
|
<source>${java.version}</source>
|
||||||
|
<target>${java.version}</target>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-surefire-plugin</artifactId>
|
||||||
|
<version>2.22.2</version>
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
</project>
|
</project>
|
||||||
11
src/main/java/com/example/AuthorizationService.java
Normal file
11
src/main/java/com/example/AuthorizationService.java
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
package com.example;
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class AuthorizationService {
|
||||||
|
public boolean hasAccess(String userId, String resource) {
|
||||||
|
// 권한 로직을 여기에 구현합니다.
|
||||||
|
return true; // 예시로 항상 true를 반환
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,11 +0,0 @@
|
||||||
package com.example.baisgate;
|
|
||||||
|
|
||||||
import org.springframework.boot.SpringApplication;
|
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|
||||||
|
|
||||||
@SpringBootApplication
|
|
||||||
public class BaisGateApplication {
|
|
||||||
public static void main(String[] args) {
|
|
||||||
SpringApplication.run(BaisGateApplication.class, args);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
13
src/test/java/com/example/AuthorizationServiceTest.java
Normal file
13
src/test/java/com/example/AuthorizationServiceTest.java
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
package com.example;
|
||||||
|
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||||
|
|
||||||
|
class AuthorizationServiceTest {
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void testHasAccess() {
|
||||||
|
AuthorizationService service = new AuthorizationService();
|
||||||
|
assertTrue(service.hasAccess("user1", "resource1"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,12 +0,0 @@
|
||||||
package com.example.baisgate;
|
|
||||||
|
|
||||||
import org.junit.jupiter.api.Test;
|
|
||||||
import org.springframework.boot.test.context.SpringBootTest;
|
|
||||||
|
|
||||||
@SpringBootTest
|
|
||||||
class BaisGateApplicationTests {
|
|
||||||
|
|
||||||
@Test
|
|
||||||
void contextLoads() {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -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