test(sample): 등록 테스트가 없는 URL로 요청해 실패하는 문제 수정 - #72
Merged
eGovFrameSupport merged 1 commit intoSep 7, 2026
Conversation
컨트롤러 매핑은 /addSample.do 인데 테스트는 /sample/add 로 POST 해 삽입이 일어나지 않았다.
Contributor
|
[2026년 전자정부 표준프레임워크 컨트리뷰션 기념품 발송 안내] ※응답기한 ~9월30일까지 @EricSeokgon 님, 안녕하세요. ↓응답 작성하기(Google 설문지)↓ ❒ 컨트리뷰션 종료 후, 시상 관련하여 연락 갈 예정이오니, 꼭 통화 가능한 본인 번호를 기재해 주시기 바랍니다. 감사합니다. |
eGovFrameSupport
approved these changes
Sep 7, 2026
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.
문제
mvn test를 돌리면EgovSampleControllerTestAddTest가 실패합니다.테스트가
post("/sample/add")로 요청하는데, 컨트롤러의 실제 매핑은@PostMapping("/addSample.do")입니다. 존재하지 않는 URL 이라 등록이 일어나지 않고, 뒤에서 조회한 목록이 비어 있어resultList.get(0)에서 터집니다. 요청 뒤에.andDo(print())만 있고 상태 검증이 없어서 404 가 그대로 지나갑니다.같은 패키지의 다른 테스트들은 실제 매핑을 쓰고 있습니다 —
EgovSampleControllerTestDeleteTest는/deleteSample.do,EgovSampleControllerTestSelectListTest는/egovSampleList.do.변경
테스트 URL 만 실제 매핑에 맞췄습니다. 본문 코드는 건드리지 않았습니다.
검증 (실측)
Tests run: 54, Failures: 0, Errors: 1— BUILD FAILURETests run: 54, Failures: 0, Errors: 0— BUILD SUCCESS전체 스위트가 통과합니다.
참고
원본 파일 끝에 개행이 없어 GitHub 웹 편집기가 저장하면서 EOF 개행 1줄을 자동으로 추가했습니다(diff 의 두 번째 hunk). 코드 변경은 아닙니다.