Developer 역할 Spring 골격 smoke #6
1 changed files with 44 additions and 0 deletions
|
|
@ -0,0 +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.junit.jupiter.api.Assertions.*;
|
||||||
|
|
||||||
|
@SpringBootTest
|
||||||
|
class DeveloperServiceTest {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private DeveloperService developerService;
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void contextLoads() {
|
||||||
|
assertNotNull(developerService);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void getRole_returnsDeveloper() {
|
||||||
|
assertEquals("DEVELOPER", developerService.getRole());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void isAuthorized_forCodeAction_returnsTrue() {
|
||||||
|
assertTrue(developerService.isAuthorized("code"));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
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"));
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue