Skip to content

Commit

Permalink
RAC-341 test : 변경사항 테스트 코드 반영
Browse files Browse the repository at this point in the history
  • Loading branch information
ywj9811 committed Apr 13, 2024
1 parent cc336b2 commit cc396af
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -119,14 +119,30 @@ void getSeniorMyPageProfile() {
}

@Test
@DisplayName("선배 자신의 마이페이지 프로필 예외 테스트")
@DisplayName("선배 자신의 마이페이지 프로필 작성 이전 Info조회 테스트")
void getSeniorMyPageProfileWithNull() {
Senior nullSenior = new Senior(-2L, user, "asd", APPROVE, 1, info, null, LocalDateTime.now(), null);
given(seniorGetService.byUser(user))
.willReturn(nullSenior);

assertThatThrownBy(() -> seniorMyPageUseCase.getSeniorMyPageProfile(user))
.isInstanceOf(NoneProfileException.class);
SeniorMyPageProfileResponse myPageProfile = seniorMyPageUseCase.getSeniorMyPageProfile(user);

assertThat(myPageProfile.lab())
.isNotEmpty();
assertThat(myPageProfile.field())
.isNotEmpty();
assertThat(myPageProfile.keyword())
.isNotEmpty();
assertThat(myPageProfile.info())
.isNull();
assertThat(myPageProfile.target())
.isNull();
assertThat(myPageProfile.chatLink())
.isNull();
assertThat(myPageProfile.oneLiner())
.isNull();
assertThat(myPageProfile.times())
.isNull();
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -303,20 +303,17 @@ void getSeniorProfile() throws Exception {
void getEmptySeniorProfile() throws Exception {
mvc.perform(get("/senior/me/profile")
.header(AUTHORIZATION, BEARER + seniorToken))
.andExpect(status().isOk())
.andExpect(jsonPath("$.code").value(PROFILE_NOT_FOUND.getCode()))
.andExpect(jsonPath("$.message").value(NOT_FOUND_PROFILE.getMessage()));
// .andExpect(status().isOk())
// .andExpect(jsonPath("$.code").value(SENIOR_FIND.getCode()))
// .andExpect(jsonPath("$.message").value(GET_SENIOR_MYPAGE_PROFILE.getMessage()))
// .andExpect(jsonPath("$.data.lab").isNotEmpty())
// .andExpect(jsonPath("$.data.keyword").isNotEmpty())
// .andExpect(jsonPath("$.data.info").isEmpty())
// .andExpect(jsonPath("$.data.target").isEmpty())
// .andExpect(jsonPath("$.data.chatLink").isEmpty())
// .andExpect(jsonPath("$.data.field").isNotEmpty())
// .andExpect(jsonPath("$.data.oneLiner").isEmpty())
// .andExpect(jsonPath("$.data.times").isEmpty());
.andExpect(status().isOk())
.andExpect(jsonPath("$.code").value(SENIOR_FIND.getCode()))
.andExpect(jsonPath("$.message").value(GET_SENIOR_MYPAGE_PROFILE.getMessage()))
.andExpect(jsonPath("$.data.lab").isNotEmpty())
.andExpect(jsonPath("$.data.keyword").isNotEmpty())
.andExpect(jsonPath("$.data.info").isEmpty())
.andExpect(jsonPath("$.data.target").isEmpty())
.andExpect(jsonPath("$.data.chatLink").isEmpty())
.andExpect(jsonPath("$.data.field").isNotEmpty())
.andExpect(jsonPath("$.data.oneLiner").isEmpty())
.andExpect(jsonPath("$.data.times").isEmpty());
}

@Test
Expand Down

0 comments on commit cc396af

Please sign in to comment.