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

[BE] 페어룸에 깃허브 ID로 페어 추가 API #810

Open
wants to merge 7 commits into
base: BE/dev
Choose a base branch
from

Conversation

reddevilmidzy
Copy link
Member

연관된 이슈

구현한 기능

  • 회원가입된 유저의 깃허브 id를 추가했을 때 해당 유저의 나의 페어룸 조회 목록에서도 확인할 수 있는 기능을 구현하였습니다.
  • 문서화
  • 테스트

상세 설명

@reddevilmidzy reddevilmidzy added the 🧑‍💻 feat 신규 기능 개발 label Oct 16, 2024
@reddevilmidzy reddevilmidzy self-assigned this Oct 16, 2024
Comment on lines +190 to +208
@Test
@DisplayName("user id로 페어를 등록한다.")
void add_pair() {
//given
final String userId = "redddy";
final Member member = Member.builder()
.userId(userId)
.accessToken("access")
.loginId("login")
.username("username")
.profileImage("some image")
.build();

final String loginToken = jwtProvider.sign(member.getUserId());
memberRepository.save(member);

final PairRoomCreateRequest pairRoomCreateRequest = new PairRoomCreateRequest("레디", "프람", 1000L, 100L,
"https://missionUrl.xxx");

Copy link
Member Author

Choose a reason for hiding this comment

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

테스트의 사이즈가 굉장히 커졌는데 고민입니다...

Copy link
Contributor

Choose a reason for hiding this comment

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

멤버 만들기나 페어룸 만들기 같은 부분이라도 private으로 빼는게 최선일까요

Copy link
Contributor

Choose a reason for hiding this comment

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

저도 잉크가 말한 것처럼 자주 사용되는

        final PairRoomCreateResponse createPairRoomResponse = RestAssured
                .given()
                .cookie(SIGN_IN_COOKIE_NAME, pairRoomCreatorToken)
                .contentType(MediaType.APPLICATION_JSON_VALUE)
                .accept(MediaType.APPLICATION_JSON_VALUE)
                .body(pairRoomCreateRequest)

                .when()
                .post("/api/pair-room")

                .then()
                .extract()
                .as(PairRoomCreateResponse.class);

요런 친구들을 private 메서드로 분리해서 사용하는 방법이 떠오르네요!


@Schema(description = "페어 추가 요청 바디")
public record PairUpdateRequest(

Copy link
Contributor

Choose a reason for hiding this comment

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

레코드는 빈줄 없어도 될듯합니다

Comment on lines +190 to +208
@Test
@DisplayName("user id로 페어를 등록한다.")
void add_pair() {
//given
final String userId = "redddy";
final Member member = Member.builder()
.userId(userId)
.accessToken("access")
.loginId("login")
.username("username")
.profileImage("some image")
.build();

final String loginToken = jwtProvider.sign(member.getUserId());
memberRepository.save(member);

final PairRoomCreateRequest pairRoomCreateRequest = new PairRoomCreateRequest("레디", "프람", 1000L, 100L,
"https://missionUrl.xxx");

Copy link
Contributor

Choose a reason for hiding this comment

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

멤버 만들기나 페어룸 만들기 같은 부분이라도 private으로 빼는게 최선일까요

Copy link
Contributor

@JiHyeonL JiHyeonL left a comment

Choose a reason for hiding this comment

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

좋습니다👍👍
레디 수고하셨어요!

Comment on lines +190 to +208
@Test
@DisplayName("user id로 페어를 등록한다.")
void add_pair() {
//given
final String userId = "redddy";
final Member member = Member.builder()
.userId(userId)
.accessToken("access")
.loginId("login")
.username("username")
.profileImage("some image")
.build();

final String loginToken = jwtProvider.sign(member.getUserId());
memberRepository.save(member);

final PairRoomCreateRequest pairRoomCreateRequest = new PairRoomCreateRequest("레디", "프람", 1000L, 100L,
"https://missionUrl.xxx");

Copy link
Contributor

Choose a reason for hiding this comment

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

저도 잉크가 말한 것처럼 자주 사용되는

        final PairRoomCreateResponse createPairRoomResponse = RestAssured
                .given()
                .cookie(SIGN_IN_COOKIE_NAME, pairRoomCreatorToken)
                .contentType(MediaType.APPLICATION_JSON_VALUE)
                .accept(MediaType.APPLICATION_JSON_VALUE)
                .body(pairRoomCreateRequest)

                .when()
                .post("/api/pair-room")

                .then()
                .extract()
                .as(PairRoomCreateResponse.class);

요런 친구들을 private 메서드로 분리해서 사용하는 방법이 떠오르네요!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🧑‍💻 feat 신규 기능 개발
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants