에러메세지
Could not detect default configuration classes for test class [org.synergym.backend.AuthServiceTest]:
AuthServiceTest does not declare any static, non-private, non-final, nested classes annotated with @Configuration.
SecurityConfig 를 명시적으로 포함시키기 위해 AuthServiceTest에 @Import(SecurityConfig.class) 어노테이션 추가PasswordEncoder 직접 주입받도록 함// AuthServiceTest.java
@SpringBootTest
@Slf4j
@Transactional
@Import(AuthServiceTest.TestConfig.class) // 테스트 구성 import
class AuthServiceTest {
// ...
@Autowired
private PasswordEncoder passwordEncoder; // PasswordEncoder 주입
// ...
}
이 과정을 통해 AuthServiceTest가 Spring Security 설정을 올바르게 인지하고, 필요한 빈들을 제대로 주입받아 테스트를 실행할 수 있도록 함