-
Notifications
You must be signed in to change notification settings - Fork 2
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
base: BE/dev
Are you sure you want to change the base?
Conversation
into BE/feature/#776-github
@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"); | ||
|
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.
멤버 만들기나 페어룸 만들기 같은 부분이라도 private으로 빼는게 최선일까요
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.
저도 잉크가 말한 것처럼 자주 사용되는
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( | ||
|
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("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"); | ||
|
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.
멤버 만들기나 페어룸 만들기 같은 부분이라도 private으로 빼는게 최선일까요
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("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"); | ||
|
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.
저도 잉크가 말한 것처럼 자주 사용되는
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 메서드로 분리해서 사용하는 방법이 떠오르네요!
연관된 이슈
구현한 기능
상세 설명