Fix: JdbcTest 와 DataJdbcTest 에서도 쿼리가 기록되게 한다 - #117
Merged
Merged
Conversation
`0.4.0` 의 슬라이스 지원이 `@DataJpaTest` 만 덮었다. DB 를 타는 슬라이스가 셋인데 하나만 넣은 상태였다. 등록 파일 넷을 더해 여섯이 됐다. 슬라이스마다 3.x 이름과 4.x 이름이 한 쌍이다. **이름은 짐작하지 않고 해당 버전의 jar 를 열어 확인했다** — 틀리면 조용히 아무것도 안 하는 종류다. `spring-boot-test-autoconfigure:3.5.0` 과 Boot 4 의 `spring-boot-jdbc-test`, `spring-boot-data-jdbc-test` 를 받아 `.imports` 목록에서 봤다. 테스트를 여섯 파일로 넓히면서 목록을 한 벌로 뒀다. 처음에 `@ValueSource` 와 별도 상수로 같은 목록을 두 벌 만들었는데, 그게 이 저장소가 싫어하는 모양이라 `@MethodSource` 로 합쳤다. 슬라이스마다 두 이름이 한 쌍인지도 검사한다. 새 슬라이스를 넣을 때 3.x 이름만 넣고 4.x 를 빠뜨리는 것이 조용히 반쪽만 도는 결과가 되므로 그것을 막는다. `@JooqTest` 는 같은 기제로 될 것으로 보이나 쓰는 사람이 없어 넣지 않았고 그 판단을 CLAUDE.md 에 적었다. `@WebMvcTest` 는 DataSource 가 없어 대상이 아니다. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request
Related Issue
Summary
0.4.0의 슬라이스 지원이@DataJpaTest만 덮고 있었다.@JdbcTest와@DataJdbcTest를 더했다.Details
DB 를 타는 슬라이스가 셋인데 하나만 넣은 상태였다. 나머지 둘에서는 여전히 DataSource 가 감싸지지 않아 기록이 0건이다.
등록 파일 넷을 더해 여섯이 됐다. 슬라이스마다 3.x 이름과 4.x 이름이 한 쌍이다.
@DataJpaTest...boot.test.autoconfigure.orm.jpa.AutoConfigureDataJpa...boot.data.jpa.test.autoconfigure.AutoConfigureDataJpa@JdbcTest...boot.test.autoconfigure.jdbc.AutoConfigureJdbc...boot.jdbc.test.autoconfigure.AutoConfigureJdbc@DataJdbcTest...boot.test.autoconfigure.data.jdbc.AutoConfigureDataJdbc...boot.data.jdbc.test.autoconfigure.AutoConfigureDataJdbc3.x 는 슬라이스 애노테이션이
boot.test.autoconfigure아래 모여 있고 4.x 는 모듈별로 흩어져 있다.이름을 짐작하지 않았다
틀리면 조용히 아무것도 안 하는 종류다. 해당 버전의 jar 를 받아
.imports목록에서 확인했다.spring-boot-test-autoconfigure:3.5.0spring-boot-jdbc-test:4.1.0,spring-boot-data-jdbc-test:4.1.0그 확인 절차를
CLAUDE.md에 적었다. 다음에 슬라이스를 더할 사람이 짐작하지 않게 하려는 것이다.테스트
여섯 파일로 넓혔다. 처음에
@ValueSource와 별도 상수로 같은 목록을 두 벌 만들었는데, 이 저장소가 싫어하는 모양이라@MethodSource로 합쳤다.슬라이스마다 두 이름이 한 쌍인지도 검사한다. 새 슬라이스를 넣을 때 3.x 만 넣고 4.x 를 빠뜨리면 반쪽만 도는데, 그것도 조용히 틀리는 종류다.
ETC
@JooqTest는 같은 기제로 될 것으로 보이나 쓰는 사람이 없어 넣지 않았다. 그 판단을CLAUDE.md에 적었다@WebMvcTest는 DataSource 가 없어 대상이 아니다@DataJpaTest는spring-petclinic으로 확인했고, 나머지 둘은 같은 기제라는 것과 파일 이름을 실물에서 확인한 것까지가 근거다