Controller, MariaDBRepository, Websocket용 Base class 추가#82
Merged
Conversation
init.sql은 테이블 정의, data.sql은 데이터 삽입, delete.sql은 테이블 초기화를 담당합니다.
testcontainers를 사용하여, MariaDB 기반의 TestExtension을 정의했습니다. MariaDBAdapterTest는 이 Extension을 포함하여, MariaDB 통합테스트에 필요한 공통 코드들을 포함합니다.
MariaDBAdapterTest 클래스를 활용하여 Repository에 대한 샘플 테스트코드를 추가했습니다. 실제로는 save, find, custom query에 대해 테스트가 이루어져야 합니다.
누락되었던 testcontainers library들을 추가했습니다
userId와 name을 Annotation에 전달하면 해당 userId와 name을 가진 Authentication 객체가 자동으로 mockmvc 요청에 포함됩니다.
performGet, performPost 메서드는 mockmvc 요청시 기본적인 설정만 포함한 메서드라 선택적으로 사용하시면 됩니다. convertAs 메서드를 사용하면, mockMVC의 응답으로 반환된 jsonString을 특정 ResponseDto 객체로 변환 가능합니다. 이 때, 변환 대상인 ResponseDto 객체의 class를 인자로 전달해주셔야 합니다.
ControllerTest base 테스트를 사용하는 AssetController의 샘플 테스트코드를 추가했습니다. WebMvcTest Annotation으로 테스트 대상 Controller 클래스를 명시해주셔야 하며, 서비스는 MockitoBean Annotation으로 mocking하여 기대하는 응답을 반환토록 해야 합니다.
WithCustomMockUser 사용을 위해 필요한 dependency입니다.
stomp client 테스트에 사용할 수 있는 Base Test를 추가했습니다.
it profile이더라도 h2-mem일 경우에 동작하도록 변경합니다.
구독을 했을 때, 정상적으로 stomp 메시지를 수신할 수 있는지 테스트합니다.
시간 불일치 이슈가 발생할 수 있어 해당 Config를 포함시켰습니다.
caniro
approved these changes
May 26, 2025
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.
✨ 작업내용
🐞 이슈사항