Compare commits
No commits in common. "6359a84304999d189b85da7dcc3ee892e18d3e69" and "c7f81a0cd3b67aab2f74c8e8cc67141da43c21cc" have entirely different histories.
6359a84304
...
c7f81a0cd3
5 changed files with 0 additions and 121 deletions
|
|
@ -1,3 +0,0 @@
|
|||
# role-developer-live-v5-001-attempt-1-run-d2eb89f97872
|
||||
|
||||
Forge 이슈 작업 브랜치 `forge/role-developer-live-v5-001-attempt-1-run-d2eb89f97872`.
|
||||
39
pom.xml
39
pom.xml
|
|
@ -1,39 +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.developer</groupId>
|
||||
<artifactId>runtime-role-matrix-live-202607141836-v5</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<name>runtime-role-matrix-live-202607141836-v5</name>
|
||||
<description>Developer role Spring Boot skeleton</description>
|
||||
<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,12 +0,0 @@
|
|||
package com.developer;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
@SpringBootApplication
|
||||
public class DeveloperApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(DeveloperApplication.class, args);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
package com.developer;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class DeveloperService {
|
||||
|
||||
public String getRole() {
|
||||
return "developer";
|
||||
}
|
||||
|
||||
public String greet(String name) {
|
||||
if (name == null || name.isBlank()) {
|
||||
return "Hello, Developer!";
|
||||
}
|
||||
return "Hello, " + name + "!";
|
||||
}
|
||||
|
||||
public boolean isValidRole(String role) {
|
||||
return "developer".equalsIgnoreCase(role);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,45 +0,0 @@
|
|||
package com.developer;
|
||||
|
||||
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 DeveloperServiceTest {
|
||||
|
||||
@Autowired
|
||||
private DeveloperService developerService;
|
||||
|
||||
@Test
|
||||
void getRole_returnsDeveloper() {
|
||||
assertEquals("developer", developerService.getRole());
|
||||
}
|
||||
|
||||
@Test
|
||||
void greet_withName_returnsPersonalizedGreeting() {
|
||||
assertEquals("Hello, Alice!", developerService.greet("Alice"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void greet_withNullOrBlank_returnsDefaultGreeting() {
|
||||
assertEquals("Hello, Developer!", developerService.greet(null));
|
||||
assertEquals("Hello, Developer!", developerService.greet(""));
|
||||
assertEquals("Hello, Developer!", developerService.greet(" "));
|
||||
}
|
||||
|
||||
@Test
|
||||
void isValidRole_withDeveloper_returnsTrue() {
|
||||
assertTrue(developerService.isValidRole("developer"));
|
||||
assertTrue(developerService.isValidRole("DEVELOPER"));
|
||||
assertTrue(developerService.isValidRole("Developer"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void isValidRole_withOtherRole_returnsFalse() {
|
||||
assertFalse(developerService.isValidRole("admin"));
|
||||
assertFalse(developerService.isValidRole("user"));
|
||||
assertFalse(developerService.isValidRole(null));
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue