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> <artifactId>developer-role-smoke</artifactId>
<version>1.0.0-SNAPSHOT</version> <version>1.0.0-SNAPSHOT</version>
<name>Developer Role Smoke Test</name> <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> <properties>
<java.version>17</java.version> <java.version>17</java.version>
</properties> </properties>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
@ -30,7 +28,6 @@
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
</dependencies> </dependencies>
<build> <build>
<plugins> <plugins>
<plugin> <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 class DeveloperService {
public String getRole() { public String getRole() {
return "developer"; return "DEVELOPER";
} }
public boolean isActive() { public boolean isAuthorized(String action) {
return true; return "code".equals(action) || "review".equals(action) || "deploy".equals(action);
}
public String describe() {
return "Developer role is active and operational";
} }
} }

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; package com.example.developer.service;
import org.junit.jupiter.api.Test; 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 { class DeveloperServiceTest {
private final DeveloperService service = new DeveloperService(); @Autowired
private DeveloperService developerService;
@Test
void contextLoads() {
assertNotNull(developerService);
}
@Test @Test
void getRole_returnsDeveloper() { void getRole_returnsDeveloper() {
assertThat(service.getRole()).isEqualTo("developer"); assertEquals("DEVELOPER", developerService.getRole());
} }
@Test @Test
void isActive_returnsTrue() { void isAuthorized_forCodeAction_returnsTrue() {
assertThat(service.isActive()).isTrue(); assertTrue(developerService.isAuthorized("code"));
} }
@Test @Test
void describe_returnsDescription() { void isAuthorized_forReviewAction_returnsTrue() {
String description = service.describe(); assertTrue(developerService.isAuthorized("review"));
assertThat(description).contains("Developer").contains("active"); }
@Test
void isAuthorized_forDeployAction_returnsTrue() {
assertTrue(developerService.isAuthorized("deploy"));
}
@Test
void isAuthorized_forUnknownAction_returnsFalse() {
assertFalse(developerService.isAuthorized("admin"));
} }
} }