Skip to content

Commit

Permalink
[TEST] change test display name
Browse files Browse the repository at this point in the history
  • Loading branch information
nogamsung committed Jan 10, 2024
1 parent 91390c9 commit 19e2901
Showing 1 changed file with 29 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ void givenFormatPosition_whenUpdateProfile_thenReturn400() throws Exception {

@Test
@DisplayName("기술에 기술명 20자 초과일시 프로필 업데이트를 하면 400을 반환한다.")
void givenSkillGreaterThan20SkillName_whenUpdateProfile_thenReturn400() throws Exception {
void givenSkillGreaterThan20SizeSkillName_whenUpdateProfile_thenReturn400() throws Exception {
// given
ProfileUpdateRequest request = createValidProfileUpdateRequest();
request.getSkills().get(0).setSkillName("가".repeat(21));
Expand Down Expand Up @@ -345,7 +345,7 @@ void givenSkillFormatLevel_whenUpdateProfile_thenReturn400() throws Exception {

@Test
@DisplayName("학력에 학교명 3자 미만일시 프로필 업데이트를 하면 400을 반환한다.")
void givenEducationLessThan3InstitutionName_whenUpdateProfile_thenReturn400() throws Exception {
void givenEducationLessThan3SizeInstitutionName_whenUpdateProfile_thenReturn400() throws Exception {
// given
ProfileUpdateRequest request = createValidProfileUpdateRequest();
request.getEducations().get(0).setInstitutionName("대학");
Expand All @@ -368,7 +368,7 @@ void givenEducationLessThan3InstitutionName_whenUpdateProfile_thenReturn400() th

@Test
@DisplayName("학력에 학교명 3자 미만일시 프로필 업데이트를 하면 400을 반환한다.")
void givenEducationGreaterThan20InstitutionName_whenUpdateProfile_thenReturn400() throws Exception {
void givenEducationGreaterThan20SizeInstitutionName_whenUpdateProfile_thenReturn400() throws Exception {
// given
ProfileUpdateRequest request = createValidProfileUpdateRequest();
request.getEducations().get(0).setInstitutionName("대".repeat(21));
Expand Down Expand Up @@ -437,7 +437,7 @@ void givenEducationBlankIsCurrent_whenUpdateProfile_thenReturn400() throws Excep

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

@Test
@DisplayName("포트폴리오에 포트폴리오명이 10자 초과일시 프로필 업데이트를 하면 400을 반환한다.")
void givenPortfolioGreaterThan10PortfolioName_whenUpdateProfile_thenReturn400() throws Exception {
void givenPortfolioGreaterThan10SizePortfolioName_whenUpdateProfile_thenReturn400() throws Exception {
// given
ProfileUpdateRequest request = createValidProfileUpdateRequest();
request.getPortfolios().get(0).setPortfolioName("a".repeat(11));
Expand All @@ -483,7 +483,7 @@ void givenPortfolioGreaterThan10PortfolioName_whenUpdateProfile_thenReturn400()

@Test
@DisplayName("포트폴리오에 포트폴리오 URL이 1자 미만일시 프로필 업데이트를 하면 400을 반환한다.")
void givenPortfolioLessThan1PortfolioUrl_whenUpdateProfile_thenReturn400() throws Exception {
void givenPortfolioLessThan1SizePortfolioUrl_whenUpdateProfile_thenReturn400() throws Exception {
// given
ProfileUpdateRequest request = createValidProfileUpdateRequest();
request.getPortfolios().get(0).setPortfolioUrl("");
Expand All @@ -504,6 +504,29 @@ void givenPortfolioLessThan1PortfolioUrl_whenUpdateProfile_thenReturn400() throw
.value(PORTFOLIO_URL_LENGTH_INVALID.getMessage()));
}

@Test
@DisplayName("포트폴리오에 포트폴리오 URL이 1000자 초과일시 프로필 업데이트를 하면 400을 반환한다.")
void givenPortfolioGreaterThan1000SizePortfolioUrl_whenUpdateProfile_thenReturn400() throws Exception {
// given
ProfileUpdateRequest request = createValidProfileUpdateRequest();
request.getPortfolios().get(0).setPortfolioUrl("a".repeat(1001));

// 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_URL_LENGTH_INVALID.name()))
.andExpect(jsonPath("$.responseMessage")
.value(PORTFOLIO_URL_LENGTH_INVALID.getMessage()));
}

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

0 comments on commit 19e2901

Please sign in to comment.