티스토리 뷰

Java

[Java - Spring] BeanCreationException 오류

hyeonii_12 2020. 1. 13. 14:49
반응형

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'testRepository': Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate []: Specified class is an interface

 

@Autowired
private TestRepository testRepository;

으로 되어있던 걸

 

@MockBean
private TestRepository testRepository;

으로 변경하면 된다.

반응형

'Java' 카테고리의 다른 글

[Java] @Autowired  (0) 2020.02.06
[Java - SpringBoot] java.lang.IllegalStateException 오류  (0) 2020.01.13
[Java] GET request timeout 설정  (0) 2019.12.27
[Java] String to Enum  (0) 2019.12.24
[Java] Java8 LocalDate  (2) 2019.12.23
댓글