Developer 역할 Spring 골격 smoke #4
1 changed files with 43 additions and 0 deletions
|
|
@ -0,0 +1,43 @@
|
||||||
|
package com.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.assertFalse;
|
||||||
|
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||||
|
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||||
|
|
||||||
|
@SpringBootTest
|
||||||
|
class DeveloperServiceTest {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private DeveloperService developerService;
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void contextLoads() {
|
||||||
|
assertNotNull(developerService);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void getRole_ReturnsDeveloper() {
|
||||||
|
String role = developerService.getRole();
|
||||||
|
assertNotNull(role);
|
||||||
|
assertTrue(role.contains("Developer"));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void getRoleDescription_ReturnsDescription() {
|
||||||
|
String description = developerService.getRoleDescription();
|
||||||
|
assertNotNull(description);
|
||||||
|
assertTrue(description.length() > 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void isValidRole_ValidatesCorrectly() {
|
||||||
|
assertTrue(developerService.isValidRole("Developer"));
|
||||||
|
assertFalse(developerService.isValidRole("Admin"));
|
||||||
|
assertFalse(developerService.isValidRole(""));
|
||||||
|
assertFalse(developerService.isValidRole(null));
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue