diff --git a/.forge/BAIS-E2E-MIG-001-attempt-2.md b/.forge/BAIS-E2E-MIG-001-attempt-2.md new file mode 100644 index 0000000..d5a8da7 --- /dev/null +++ b/.forge/BAIS-E2E-MIG-001-attempt-2.md @@ -0,0 +1,3 @@ +# BAIS-E2E-MIG-001-attempt-2 + +Forge 이슈 작업 브랜치 `forge/BAIS-E2E-MIG-001-attempt-2`. diff --git a/.forge/BAIS-NATIVE-1783698057-attempt-1.md b/.forge/BAIS-NATIVE-1783698057-attempt-1.md deleted file mode 100644 index ff1dd68..0000000 --- a/.forge/BAIS-NATIVE-1783698057-attempt-1.md +++ /dev/null @@ -1,3 +0,0 @@ -# BAIS-NATIVE-1783698057-attempt-1 - -Forge 이슈 작업 브랜치 `forge/BAIS-NATIVE-1783698057-attempt-1`. diff --git a/.forge/BAIS-SOURCE-1783702539-attempt-1.md b/.forge/BAIS-SOURCE-1783702539-attempt-1.md deleted file mode 100644 index b15de76..0000000 --- a/.forge/BAIS-SOURCE-1783702539-attempt-1.md +++ /dev/null @@ -1,3 +0,0 @@ -# BAIS-SOURCE-1783702539-attempt-1 - -Forge 이슈 작업 브랜치 `forge/BAIS-SOURCE-1783702539-attempt-1`. diff --git a/.forgejo/workflows/ci.yml b/.forgejo/workflows/ci.yml index 6622513..b7d7378 100644 --- a/.forgejo/workflows/ci.yml +++ b/.forgejo/workflows/ci.yml @@ -1,5 +1,5 @@ name: ci -on: [pull_request] +on: [push, pull_request] jobs: test: runs-on: ubuntu-latest diff --git a/pom.xml b/pom.xml index 38f992a..eb18513 100644 --- a/pom.xml +++ b/pom.xml @@ -1,18 +1,14 @@ - + 4.0.0 + com.example - bais-gate-e2e + bais-authorization-service 1.0-SNAPSHOT jar - - org.springframework.boot - spring-boot-starter-parent - 3.2.0 - - - 17 @@ -32,9 +28,19 @@ - org.springframework.boot - spring-boot-maven-plugin + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + ${java.version} + ${java.version} + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.22.2 - + \ No newline at end of file diff --git a/src/main/java/com/example/AuthorizationService.java b/src/main/java/com/example/AuthorizationService.java new file mode 100644 index 0000000..eac120a --- /dev/null +++ b/src/main/java/com/example/AuthorizationService.java @@ -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를 반환 + } +} \ No newline at end of file diff --git a/src/main/java/com/example/baisgate/BaisGateApplication.java b/src/main/java/com/example/baisgate/BaisGateApplication.java deleted file mode 100644 index 451a245..0000000 --- a/src/main/java/com/example/baisgate/BaisGateApplication.java +++ /dev/null @@ -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); - } -} \ No newline at end of file diff --git a/src/main/java/com/example/baisgate/PaymentService.java b/src/main/java/com/example/baisgate/PaymentService.java deleted file mode 100644 index 489d52a..0000000 --- a/src/main/java/com/example/baisgate/PaymentService.java +++ /dev/null @@ -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; - } -} \ No newline at end of file diff --git a/src/test/java/com/example/AuthorizationServiceTest.java b/src/test/java/com/example/AuthorizationServiceTest.java new file mode 100644 index 0000000..9315ee4 --- /dev/null +++ b/src/test/java/com/example/AuthorizationServiceTest.java @@ -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")); + } +} \ No newline at end of file diff --git a/src/test/java/com/example/baisgate/BaisGateApplicationTests.java b/src/test/java/com/example/baisgate/BaisGateApplicationTests.java deleted file mode 100644 index 1a8f4c5..0000000 --- a/src/test/java/com/example/baisgate/BaisGateApplicationTests.java +++ /dev/null @@ -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() { - } -} \ No newline at end of file diff --git a/src/test/java/com/example/baisgate/PaymentServiceTest.java b/src/test/java/com/example/baisgate/PaymentServiceTest.java deleted file mode 100644 index 1caa7a9..0000000 --- a/src/test/java/com/example/baisgate/PaymentServiceTest.java +++ /dev/null @@ -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()); - } -} \ No newline at end of file