-
Notifications
You must be signed in to change notification settings - Fork 0
[REF-146] 아이디 찾기 E2E Test #51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
loadkrnis
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
리뷰 늦어서 죄송합니다 🙏
| String userName = "정회운"; | ||
| String birthDate = "9812111"; | ||
| String email = "cousim55@gmail.com"; | ||
| //when |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
요기 한줄 띄어쓰기 부탁드려요~!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
넵 알겠습니다!
src/test/java/lossleaderproject/back/e2e/UserControllerTest.java
Outdated
Show resolved
Hide resolved
| String loginId = webTestClient.post().uri("/login/id") | ||
| .contentType(MediaType.APPLICATION_JSON_UTF8) | ||
| .bodyValue(new UserLoginIdFindRequest(userName,birthDate,email)) | ||
| .exchange().expectBody(String.class).returnResult().getResponseBody(); | ||
| JSONParser jsonParser = new JSONParser(); | ||
| JSONObject jsonObject = (JSONObject) jsonParser.parse(loginId); | ||
| String userLoginId = (String)jsonObject.get("loginId"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when 절은 한줄로 써주셔야합니당! :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
넵 알겠습니다!
src/test/java/lossleaderproject/back/e2e/UserControllerTest.java
Outdated
Show resolved
Hide resolved
| "message : 사용자 이름, 생년월일, 이메일을 잘못입력하셨습니다.', " + | ||
| "'status : 404'," + | ||
| "'Error : Not_Found'") | ||
| void 이름_이메일_주민번호_잘못작성() throws Exception { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이 이름의 테스트는 총 3개가 만들어져야할 것 같은데 어떻게 생각하실까요?
이름이 틀렸을때 ~~한다
이메일이 틀렸을때 ~~한다
생년월일이 틀렸을때 ~~한다
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이름, 이메일, 생년월일 각각 틀렸을경우 똑같은 결과값을 반환합니다.
그래서 테스트를 하나로 만들었습니다!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
지금 작성해주신 테스트는 이름이 틀렸을 때 ~~를 반환한다. 테스트라고 생각이 드는데요.
생년월일이 틀였을 때 ~~에러를 반환한다 테스트로 검증이 안된것 같아요.
테스트의 DisplayName은 분명히 세가지 중 하나라도 올바르지 않을 경우라고 적혀있는데,
실제 테스트코드는 사용자의 name만 틀린 상태로 검증하는 것 같아요.
테스트는 한 가지 목적의 검증을 수행하도록 작성되어야 할 것 같아요.
그래서 제 생각은 같은 에러메세지를 확인해도 위에서 말씀드린 세가지의 테스트가 나와야할 것 같습니다.
이유는 아래와 같은데 혹시 어떻게 생각하실까요?
- 하나의 검증이 실패하면 후속 검증은 평가되지 않으므로 전체 테스트에 대한 현황을 확인할 수 없습니다.
- 여러 가지 목적이 검증되는 테스트는 여러가지 테스트 의도를 포함하는 테스트이므로, 테스트 의도가 명확하지 않습니다.
|
@cousim46 |
PR 체크리스트
PR을 올렸다면 아래 사항은 반드시 지켜주세요.
구현한것들 및 간단한 설명