MP-174 domains.term.app.controller 테스트 코드 작성#22
Merged
Reality-out merged 9 commits intodevelopfrom May 20, 2025
Merged
Conversation
Collaborator
Reality-out
commented
May 20, 2025
- 컨트롤러에 대한 몇 가지 리팩토링을 포함함
- 예를 들어:
- 수정 메소드: PutMapping으로 변경
- 제거 메소드: 메소드 매개변수에 대한 어노테이션 변경
* 도메인 컨트롤러 스캔 어노테이션 구현 * 도메인 서비스 Mocking을 위한 포스트 프로세서 구현 * 도메인 컨트롤러 전용 맥락 구성
* 카멜 케이스, 파스칼 케이스 이름의 빈 2개가 잡히는 문제 해결
* 올바르게 동작하지 않는 기존 테스트 구성 클래스는 모두 제거 - 아마도 서비스와 리포지토리를 Mocking할 때 리포지토리의 반환 값이 서비스 매소드에서 올바르게 작동하는 데 장애가 되는 것으로 추정됨 * @SpringBootTest와 @AutoConfigureMockMvc으로 깔끔하게 구성하였으며, 이후 커밋에서 해당 어노테이션 구성을 최적화할 예정
* DomainsControllerOnlyContext에서 컨트롤러에 대한 테스트 환경 구성을 모두 수행 * 사용자 지정 BeanFactoryPostProcessor에서의 빈 이름을 파스칼 케이스에서 카멜 케이스로 수정 * 빈이 미리 Mocked된 관계로 @mocking 또한 @Autowired로 변경
* getTermByName으로 수정
* 기존에 정했던 대로 HTTP 메소드는 Post -> Put으로 수정 * 컨트롤러 안에는 예외 처리 로직이 없는 관계로 바디의 DataResponse에 대한 제네릭 타입은 ? -> TermResponse로 수정
* removeTermByUuid로 수정
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.