org.springframework.beans.factory.BeanCreationException: Failed to execute SQL script statement #1 of file [/Users/kilhyunkim/workspace/Java/Spring/BookManager/build/resources/test/data.sql]: call next value for hibernate_sequence #2
위의 방법으로 해결됬다고 판단했으나 로그 메세지 상으로는 "Caused by: org.h2.jdbc.JdbcSQLSyntaxErrorException: Sequence "HIBERNATE_SEQUENCE" not found; SQL statement" 예외가 발생하여 재확인 중
현상: 테스트 과정에서 H2 DB에 Member 테이블과 데이터를 주입하기 위해 resource에 data.sql 파일을 생성 후 테스트를 진행했으나, "org.springframework.beans.factory.BeanCreationException" 예외 발생
원인: spring boot 2.5 버전 이후부터 data.sql 파일을 실행할 때 순서가 다음과 같이 변경되었다.
해결방법
참고자료: https://jjunii486.tistory.com/332