Compare commits

..

No commits in common. "bc884148aba32c737fc701ba23d3769453c6c9e9" and "340c5dc537a9484429746ec08d3069c0770deba0" have entirely different histories.

5 changed files with 0 additions and 131 deletions

View file

@ -1,3 +0,0 @@
# runtime-role-matrix-live-20260714112301-v11-developer-001-attempt-1-run-9c63dd5c6aca
Forge 이슈 작업 브랜치 `forge/runtime-role-matrix-live-20260714112301-v11-developer-001-attempt-1-run-9c63dd5c6aca`.

43
pom.xml
View file

@ -1,43 +0,0 @@
<?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">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.2.5</version>
<relativePath/>
</parent>
<groupId>com.example</groupId>
<artifactId>runtime-role-matrix-live</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>jar</packaging>
<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>

View file

@ -1,12 +0,0 @@
package com.example.demo;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class DemoApplication {
public static void main(String[] args) {
SpringApplication.run(DemoApplication.class, args);
}
}

View file

@ -1,24 +0,0 @@
package com.example.demo;
import org.springframework.stereotype.Service;
@Service
public class RoleService {
public String getRoleName(String roleId) {
if (roleId == null || roleId.isBlank()) {
return "UNKNOWN";
}
return switch (roleId.toUpperCase()) {
case "ADMIN" -> "Administrator";
case "DEVELOPER" -> "Developer";
case "VIEWER" -> "Viewer";
default -> "Role: " + roleId;
};
}
public boolean isValidRole(String roleId) {
return roleId != null && !roleId.isBlank() &&
roleId.matches("^[A-Z_]+$");
}
}

View file

@ -1,49 +0,0 @@
package com.example.demo;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import static org.junit.jupiter.api.Assertions.*;
@SpringBootTest
class RoleServiceTest {
@Autowired
private RoleService roleService;
@Test
void getRoleName_returnsAdministratorForAdmin() {
assertEquals("Administrator", roleService.getRoleName("ADMIN"));
}
@Test
void getRoleName_returnsDeveloperForDeveloper() {
assertEquals("Developer", roleService.getRoleName("DEVELOPER"));
}
@Test
void getRoleName_returnsUnknownForNull() {
assertEquals("UNKNOWN", roleService.getRoleName(null));
}
@Test
void getRoleName_returnsUnknownForBlank() {
assertEquals("UNKNOWN", roleService.getRoleName(" "));
}
@Test
void isValidRole_returnsTrueForValidRoles() {
assertTrue(roleService.isValidRole("ADMIN"));
assertTrue(roleService.isValidRole("DEVELOPER"));
assertTrue(roleService.isValidRole("ROLE_VIEWER"));
}
@Test
void isValidRole_returnsFalseForInvalidRoles() {
assertFalse(roleService.isValidRole(null));
assertFalse(roleService.isValidRole(""));
assertFalse(roleService.isValidRole("admin"));
assertFalse(roleService.isValidRole("ADMIN123"));
}
}