@DataJpaTest
@ActiveProfiles("test") // yml 파일에 on-profile : test 기반으로 작동
//@SpringBootTest
@DataJpaTest
class ProductRepositoryTest {
private final ProductRepositoryImpl productRepositoryImpl;방법 1. @SpringBootTest로 전환 (모든 빈 등록됨)
@SpringBootTest로 전환 (모든 빈 등록됨)@SpringBootTest
@ActiveProfiles("test")
class ProductRepositoryTest {
@Autowired
private ProductRepository productRepository;
}방법 2. 인터페이스 기반 주입으로 변경
Last updated