-
Notifications
You must be signed in to change notification settings - Fork 227
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
Step3 - 테스트를 통한 코드 보호 #161
base: bgpark82
Are you sure you want to change the base?
Conversation
테스트 코드 작성해주신다고 고생 많으셨습니다 (_ _)
이번 리뷰 요청은 수정 요청 드릴게요. |
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.
테스트 코드 구현 잘해주셨습니다. 💯
몇가지 코멘트를 남겨두었는데 확인부탁드려요 🙏
src/test/java/kitchenpos/menu/accpetance/MenuAcceptanceTest.java
Outdated
Show resolved
Hide resolved
src/test/java/kitchenpos/menu_group/acceptance/MenuGroupAcceptanceTest.java
Outdated
Show resolved
Hide resolved
src/test/java/kitchenpos/menu_group/acceptance/MenuGroupAcceptanceTest.java
Outdated
Show resolved
Hide resolved
src/test/java/kitchenpos/menu_group/application/MenuGroupServiceTest.java
Outdated
Show resolved
Hide resolved
안녕하세요 동철님 리뷰 부탁드립니다🙏 말씀하신 조언대로 Fixture의 네이밍을 해보았는데요 (OrderTable과 Order 테스트 부터 적용했습니다) 그리고 작성하다보니 질문이 하나 있습니다. |
피드백 반영 너무 잘해주셨네요 👍 우선 Fixture를 의도적으로 중복생성 하지는 않을것 같아요. |
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.
피드백 반영 잘해주셨습니다 ㅎㅎ
몇가지 생각거리를 남겨두었는데 확인 부탁드려요 🙏
src/test/java/kitchenpos/order_table/application/OrderTableServiceTest.java
Outdated
Show resolved
Hide resolved
src/test/java/kitchenpos/product/application/ProductServiceTest.java
Outdated
Show resolved
Hide resolved
src/test/java/kitchenpos/order/application/OrderServiceTest.java
Outdated
Show resolved
Hide resolved
안녕하세요. 꼼꼼히 리뷰 해주셔서 감사합니다😄 Fixture에 신경이 팔려서 꼼꼼하지 못했네요ㅠ 덕분에 많이 배웠습니다. 감사합니다! |
피드백 반영 너무 잘해주셧네요 👍 이대로 미션을 끝내도 될거 같지만 한가지만 더 부탁드려볼게요. |
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 | ||
public void createWithinRegisteredMenuGroup() { | ||
// given | ||
given(menuGroupRepository.findById(any())).willReturn(Optional.empty()); | ||
|
||
// when, then | ||
assertThatThrownBy(() -> menuService.create(기본_후라이드_치킨_메뉴)) | ||
assertThatThrownBy(() -> menuService.create(메뉴_생성_요청)) |
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.
assertThatExceptionOfType
을 사용해보는것도 좋을것 같아요 😄
assertThatThrownBy
과 동일한 기능이지만 조금더 자연스럽게 표현 가능하다고 되어 있어요 !
This method is more or less the same of assertThatThrownBy(ThrowableAssert.ThrowingCallable) but in a more natural way
이번주 미션도 잘 부탁드립니다.😀
이번에는 인수 테스트와 단위 테스트를 작성하여 미션을 진행해보았습니다.
일단은 중간 정도 하다가 궁금한게 생겨서 PR 먼저 보냅니다.
주로 Menu 도메인 관련하여 인수테스트를 봐주셨으면 합니다.
관련하여 몇가지 질문이 있습니다.
인수 테스트 데이터베이스 분리 및 데이터 입력
서비스 테스트
ReflectionTestUtils
빌더 패턴? 정적 팩토리 메소드? 일반 생성자?
질문이 많이 길어져서 죄송합니다😥.
평소에 회사 코드가 저런 상태인데 인수 테스트를 작성하며 고민해왔던 내용입니다.
어디 물어볼데가 없어서 의견을 한번 듣고 싶습니다.