Compare commits

..

No commits in common. "forge/role-developer-live-v2-001-attempt-1-run-53f9c6cb3b6d" and "main" have entirely different histories.

7 changed files with 30 additions and 54 deletions

View file

@ -1,3 +0,0 @@
# role-developer-live-v2-001-attempt-1-run-53f9c6cb3b6d
Forge 이슈 작업 브랜치 `forge/role-developer-live-v2-001-attempt-1-run-53f9c6cb3b6d`.

View file

@ -13,12 +13,10 @@
<artifactId>developer-role-smoke</artifactId>
<version>1.0.0-SNAPSHOT</version>
<name>Developer Role Smoke Test</name>
<description>Spring Boot skeleton for developer role smoke test</description>
<description>Spring Boot skeleton for Developer role smoke test</description>
<properties>
<java.version>17</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
@ -30,7 +28,6 @@
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>

View file

@ -1,12 +0,0 @@
package com.example.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);
}
}

View file

@ -6,14 +6,10 @@ import org.springframework.stereotype.Service;
public class DeveloperService {
public String getRole() {
return "developer";
return "DEVELOPER";
}
public boolean isActive() {
return true;
}
public String describe() {
return "Developer role is active and operational";
public boolean isAuthorized(String action) {
return "code".equals(action) || "review".equals(action) || "deploy".equals(action);
}
}

View file

@ -1 +0,0 @@
spring.application.name=developer-role-smoke

View file

@ -1,19 +0,0 @@
package com.example.developer;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import static org.assertj.core.api.Assertions.assertThat;
@SpringBootTest
class DeveloperApplicationTests {
@Autowired
private DeveloperApplication application;
@Test
void contextLoads() {
assertThat(application).isNotNull();
}
}

View file

@ -1,26 +1,44 @@
package com.example.developer.service;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.jupiter.api.Assertions.*;
@SpringBootTest
class DeveloperServiceTest {
private final DeveloperService service = new DeveloperService();
@Autowired
private DeveloperService developerService;
@Test
void contextLoads() {
assertNotNull(developerService);
}
@Test
void getRole_returnsDeveloper() {
assertThat(service.getRole()).isEqualTo("developer");
assertEquals("DEVELOPER", developerService.getRole());
}
@Test
void isActive_returnsTrue() {
assertThat(service.isActive()).isTrue();
void isAuthorized_forCodeAction_returnsTrue() {
assertTrue(developerService.isAuthorized("code"));
}
@Test
void describe_returnsDescription() {
String description = service.describe();
assertThat(description).contains("Developer").contains("active");
void isAuthorized_forReviewAction_returnsTrue() {
assertTrue(developerService.isAuthorized("review"));
}
@Test
void isAuthorized_forDeployAction_returnsTrue() {
assertTrue(developerService.isAuthorized("deploy"));
}
@Test
void isAuthorized_forUnknownAction_returnsFalse() {
assertFalse(developerService.isAuthorized("admin"));
}
}