...

[JAVA/Spring] 단위테스트 상 Repository에서 NullPointerException이 발생할 때 본문

이것저것/오류 해결

[JAVA/Spring] 단위테스트 상 Repository에서 NullPointerException이 발생할 때

gi2 2022. 5. 25. 17:08

[ 확인해 보아야 할 것 ]

1. EntityManager가 final로 선언되어 있으며, em을 할당할 Constructor가 존재하는가?

 

2. RunWith(SpringRunner)가 선언되어 의존성 주입을 올바르게 받았는가?

3. Repository 앞에 @Autowired 어노테이션이 붙어있는가?

Comments