Developer 역할 Spring 골격 smoke #4

Showing only changes of commit 6adf912b0f - Show all commits

View file

@ -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));
}
}