Skip to content

3단계 - 테스트를 통한 코드 보호#532

Open
kymiin wants to merge 2 commits intonext-step:kymiinfrom
kymiin:step3
Open

3단계 - 테스트를 통한 코드 보호#532
kymiin wants to merge 2 commits intonext-step:kymiinfrom
kymiin:step3

Conversation

@kymiin
Copy link

@kymiin kymiin commented Aug 29, 2023

product, menuGroup, menu 에 대한 테스트 코드 먼저 pr 요청 드립니다.

추후에 menu 일부와 order,orderTable 도 추가로 작성하도록 하겠습니다.

Copy link

@serverwizard serverwizard left a comment

Choose a reason for hiding this comment

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

작성하신 테스트 코드까지는 잘 작성해 주셨네요 👍
나머지 부분도 작성해 주시면 좋을 것 같아요~

그리고 생각해 보면 좋을 법한 코멘트도 남겨두었는데 참고 부탁드릴게요 🙏


import java.util.UUID;

public class MenuGroupFixtures {

Choose a reason for hiding this comment

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

테스트 픽스쳐 작성 👍

import static org.mockito.BDDMockito.when;

@DisplayName("메뉴")
public class MenuServiceTest extends ApplicationTest {

Choose a reason for hiding this comment

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

메뉴 가격 변경메뉴 노출 로직에 대해서도 테스트 코드를 작성해보시면 좋을 것 같아요 :)
기존 레거시 코드에 버그가 숨어 있을 수도 있잖아요~

void contextLoads() {
}
}
@ExtendWith(MockitoExtension.class)

Choose a reason for hiding this comment

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

Mockito를 이용하여 테스트 코드를 작성해 주셨네요 :)
혹시 통합 테스트 또는 가짜 객체를 사용해서 테스트 코드를 작성할 수도 있었을텐데 그렇게 하지 않은 이유는 어떤 걸까요?

  • 이렇게 질문 드린 이유는 이런 고민 과정을 통해 특정 상황에서 자신만의 기준을 확립해 나가시면 좋을 듯 해서예요!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants