Skip to content

Commit

Permalink
[TEST] add update profile API when portfolio name less than 1
Browse files Browse the repository at this point in the history
  • Loading branch information
nogamsung committed Jan 6, 2024
1 parent c68a8a2 commit c03c294
Showing 1 changed file with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,29 @@ void givenBlankEducationIsCurrent_whenUpdateProfile_thenReturn400() throws Excep
.value(IS_CURRENT_FIELD_REQUIRED.getMessage()));
}

@Test
@DisplayName("포트폴리오에 포트폴리오명 1자 미만일시 프로필 업데이트를 하면 400을 반환한다.")
void givenLessThan1PortfolioPortfolioName_whenUpdateProfile_thenReturn400() throws Exception {
// given
ProfileUpdateRequest request = createValidProfileUpdateRequest();
request.getPortfolios().get(0).setPortfolioName("");

// when
ResultActions actions = mockMvc.perform(
post("/api/v1/user/profile")
.content(objectMapper.writeValueAsString(request))
.contentType(APPLICATION_JSON)
);

// then
actions.andDo(print())
.andExpect(status().isBadRequest())
.andExpect(jsonPath("$.responseCode")
.value(PORTFOLIO_NAME_LENGTH_INVALID.name()))
.andExpect(jsonPath("$.responseMessage")
.value(PORTFOLIO_NAME_LENGTH_INVALID.getMessage()));
}

@Test
@DisplayName("파일 포트폴리오를 하면 200을 반환한다.")
void givenValid_whenUploadPortfolioFile_thenReturn200() throws Exception {
Expand Down

0 comments on commit c03c294

Please sign in to comment.