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

CategoryControllerTest 에러코드 확인 로직 추가 및 개선 #789

Merged
merged 4 commits into from
Oct 18, 2024

Conversation

kyum-q
Copy link
Contributor

@kyum-q kyum-q commented Oct 15, 2024

⚡️ 관련 이슈

#767

📍주요 변경 사항

주요 변경 사항에 대해 작성해주세요.

  • 에러 코드 확인 로직 추가
  • given/when/then 주석 추가로 코드 가독성 개선

🎸기타

고려해야 하는 내용을 작성해 주세요.

🍗 PR 첫 리뷰 마감 기한

10/17 10:00

오전 10시임 ~

@kyum-q kyum-q requested review from HoeSeong123, jminkkk, zeus6768 and zangsu and removed request for HoeSeong123 and jminkkk October 15, 2024 07:37
@kyum-q kyum-q self-assigned this Oct 15, 2024
@kyum-q kyum-q added refactor 요구사항이 바뀌지 않은 변경사항 BE 백엔드 labels Oct 15, 2024
@kyum-q kyum-q added this to the 6차 스프린트 🦴 milestone Oct 15, 2024
HoeSeong123
HoeSeong123 previously approved these changes Oct 16, 2024
Copy link
Contributor

@HoeSeong123 HoeSeong123 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 +95 to +96
.andExpect(jsonPath("$.detail").value("카테고리 이름은 최대 15자까지 입력 가능합니다."))
.andExpect(jsonPath("$.errorCode").value(1101));
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

zeus6768
zeus6768 previously approved these changes Oct 16, 2024
Copy link
Contributor

@jminkkk jminkkk left a comment

Choose a reason for hiding this comment

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

켬미 굿!
사소한 리뷰 남겼으니 확인 부탁드려용

}

@Test
@DisplayName("카테고리 수정 실패: 중복된 이름의 카테고리 존재")
void updateCategoryFailWithDuplicatedName() throws Exception {
// given
Copy link
Contributor

Choose a reason for hiding this comment

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

이 테스트는 서비스단의 책임인 것 같다고 느껴지는데 켬미 생각은 어떤가요?0?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

그러네요 ~!
해당 메서드와 그 외 서비스 단 테스트인 것들은 PR과 같이 제거했습니다. ~

verify(categoryService, times(1))
.deleteById(MemberFixture.memberFixture(), categoryId);
}

@Test
@DisplayName("카테고리 삭제 실패: 권한 없음")
void deleteCategoryFailWithUnauthorized() throws Exception {
// given
Copy link
Contributor

Choose a reason for hiding this comment

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

권한 없음이 403으로 느껴져서 로그인 되지 않은 경우 또는 회원이 아닌 경우로 변경하면 어떤가요~?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

로그인 되지 않은 경우 굿!

@kyum-q kyum-q dismissed stale reviews from zeus6768 and HoeSeong123 via f610da6 October 16, 2024 16:59
Copy link
Contributor

@zangsu zangsu left a comment

Choose a reason for hiding this comment

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

켬미 굳~~~

Copy link
Contributor

@jminkkk jminkkk left a comment

Choose a reason for hiding this comment

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

켬미 굿! 🔥🔥

@kyum-q kyum-q merged commit e647ca5 into dev/be Oct 18, 2024
3 checks passed
@kyum-q kyum-q deleted the test/767-category-controller-test branch October 18, 2024 08:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BE 백엔드 refactor 요구사항이 바뀌지 않은 변경사항
Projects
Status: Weekend Done
Development

Successfully merging this pull request may close these issues.

5 participants