Skip to content
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

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open

Add : 아이디 중복 여부 E2E Test #52

wants to merge 2 commits into from

Conversation

cousim46
Copy link
Member

PR 체크리스트

PR을 올렸다면 아래 사항은 반드시 지켜주세요.

  • Jira에 맞는 적절한 브랜치를 생성했습니다
  • PR 우측 Labels에서 적절한 라벨을 부착하였습니다.
  • Commit 메세지 규칙에 맞게 작성했습니다.
  • 제가 의도한 파일들과 수정 사항들만 커밋이 된 것을 확인 하였습니다.
  • git rebase와 squash를 했고 커밋 수가 하나인 것을 확인 했습니다.
  • 기능에대한 오류가 없는것을 확인했습니다
  • 테스트로 구현한 화면 혹은 기능을 확인했습니다
  • 코드 리뷰 사항을 모두 반영하였습니다.
  • 리뷰어에 1명 할당했습니다

마크다운에서 체크를 하기 위해서는 [x] 이렇게 수정하시면 됩니다. [x ], [ x ] 가 아니라 정확하게 [x]여야 합니다. 혹은 마우스 클릭으로 체크해주세요.

구현한것들 및 간단한 설명

  • 아이디 중복여부 E2E Test

@cousim46 cousim46 added the Status : peer 리뷰요청 New feature or request label Apr 30, 2022
@cousim46 cousim46 requested review from loadkrnis and syb1231 April 30, 2022 07:15
@cousim46 cousim46 self-assigned this Apr 30, 2022
@github-actions
Copy link

github-actions bot commented Apr 30, 2022

Unit Test Results

4 files  4 suites   21s ⏱️
6 tests 6 ✔️ 0 💤 0

Results for commit 33533e4.

♻️ This comment has been updated with latest results.

Copy link
Collaborator

@loadkrnis loadkrnis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생하셨습니다~!!

}

@Test
@DisplayName("회원가입 된 아이디 없으면 '사용가능한 아이디입니다'를 반환합니다.'")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

~면 ~를 반환한다. 형태는 어떠세요?
글이 괜히 길어지는 느낌이 조금 있어서요!

Copy link
Member Author

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();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.expectBody(String.class)
이거 꼭 when 절에 들어가야할까용?

Copy link
Member Author

@cousim46 cousim46 May 6, 2022

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 절에 있는게 적합할까요?

Comment on lines 48 to 50
@DisplayName("회원가입 된 아이디 있으면 message : 이미 존재하는 아이디입니다.', " +
"'status : 409'," +
"'Error : DUPLICATE_ID'를 반환합니다.")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

헉 .. 이거 한줄로 .. 하시는건 어떠실까요?
이름이 조금 긴것같은데 명쾌하게 쓸 수 있는 말도 함께 고민되면 좋을 것 같아요!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

넵 알겠습니다!

Comment on lines 62 to 64
Assertions.assertEquals("이미 존재하는 아이디입니다.",response.getMessage());
Assertions.assertEquals(409,response.getStatus());
Assertions.assertEquals("DUPLICATE_ID",response.getCode());
Copy link
Collaborator

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 라고 검색하면 좋을 것 같아요

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

넵 알겠습니다!

@loadkrnis
Copy link
Collaborator

앗 그리고 PR 이름도 수정 부탁드려요~!

Copy link
Collaborator

@loadkrnis loadkrnis left a 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);
Copy link
Collaborator

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();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

사용가능한 이이디인지 검증할 때 userSave는 필요없지 않을까요?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status : peer 리뷰요청 New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants