본문 바로가기
Spring/series

[spring 12편] spring boot 통합 test 실행 중 mybatis mapper not found 문제 정리

by 무대포 개발자 2022. 8. 29.
728x90
반응형

source 는 Github 에 있습니다.

목차는 spring series 목차 에 있습니다.

[spring 12편] spring boot 통합 test 실행 중 mybatis mapper not found 문제 정리

에러 로그

  • spring boot 통합 test 환경 에서 mybatis 를 사용하는 도중 아래와 같은 에러가 발생했습니다.

로그

No qualifying bean of type 'TestMapper' available

원인 및 해결방안

  • Bean 을 못찾는 문제였으며, 다음과 같이 해결했습니다.

  • 아래와 같이 TestConfig 라는 테스트 환경 전용을 담당하는 클래스를 만들어줘서 MapperScan 을 통해 해결했습니다.

댓글