-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add : 아이디 중복 여부 E2E Test #52
base: develop
Are you sure you want to change the base?
Conversation
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.
고생하셨습니다~!!
} | ||
|
||
@Test | ||
@DisplayName("회원가입 된 아이디 없으면 '사용가능한 아이디입니다'를 반환합니다.'") |
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.
넵 알겠습니다!
//when | ||
String response = webTestClient.get().uri(uriBuilder -> uriBuilder.path("/lossleader-user/loginid") | ||
.queryParam("loginId", loginId).build()).accept(MediaType.APPLICATION_JSON_UTF8) | ||
.exchange().expectBody(String.class).returnResult().getResponseBody(); |
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.
.expectBody(String.class)
이거 꼭 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.
webTestClient.get().uri(uriBuilder -> uriBuilder.path("/lossleader-user/loginid")
.queryParam("loginId", loginId).build()).accept(MediaType.APPLICATION_JSON_UTF8)
.exchange().expectBody(String.class)
이 부분이 given 절에 있는게 적합할까요?
@DisplayName("회원가입 된 아이디 있으면 message : 이미 존재하는 아이디입니다.', " + | ||
"'status : 409'," + | ||
"'Error : DUPLICATE_ID'를 반환합니다.") |
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.
넵 알겠습니다!
Assertions.assertEquals("이미 존재하는 아이디입니다.",response.getMessage()); | ||
Assertions.assertEquals(409,response.getStatus()); | ||
Assertions.assertEquals("DUPLICATE_ID",response.getCode()); |
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.
콤마(,) 사이에 띄어쓰기 하나씩 해주세요!
Assertions.assertEquals("DUPLICATE_ID", response.getCode());
인텔리제이에서 자동으로 맞춰주는 기능이 있는데 그거 키면 좋을 것 같아요
인텔리제이 actions on save
라고 검색하면 좋을 것 같아요
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.
넵 알겠습니다!
앗 그리고 PR 이름도 수정 부탁드려요~! |
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.
대체적으로 테스트가 깔끔해졌습니다 :)
조금만 더 화이팅입니다!
.returnResult().getResponseBody(); | ||
|
||
//then | ||
Assertions.assertEquals("사용가능한 아이디 입니다.", response); |
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.
http status code 값 검증은 빠졌네요!
아마 200 일 것 같은데 그것도 검증문에 추가해주시면 좋을 것 같아요.
@DisplayName("아이디를 사용가능하면 '사용가능한 아이디입니다'를 반환합니다.'") | ||
void 사용가능_아이디() throws Exception { | ||
//given | ||
userSave(); |
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.
사용가능한 이이디인지 검증할 때 userSave
는 필요없지 않을까요?
PR 체크리스트
PR을 올렸다면 아래 사항은 반드시 지켜주세요.
구현한것들 및 간단한 설명