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

[week4,5] howoldareu 리팩토링 및 테스트 코드 15개 작성 #1

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

gardening-y
Copy link
Member

4-5주차 Test Code 15개 작성했습니다.

Copy link
Member

@unanchoi unanchoi 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 +54 to +56
assertEquals(Success.CREATE_MEMBER_SUCCESS.getHttpStatus(), result.getCode());
assertEquals(Success.CREATE_MEMBER_SUCCESS.getMessage(), result.getMessage());
assertEquals(response, result.getData());
Copy link
Member

Choose a reason for hiding this comment

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

JUnit으로 Test Code 쓰셨네요 ...

);

// given(questionService.getQuestionResponseDTOList()).willReturn(List.of(response1, response2));
doReturn(List.of(response1, response2)).when(questionService)
Copy link
Member

Choose a reason for hiding this comment

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

배워갑니다

Copy link
Member

Choose a reason for hiding this comment

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

22

Copy link
Member

@sung-silver sung-silver left a comment

Choose a reason for hiding this comment

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

수고많으셨습니다!!

mockMvc = MockMvcBuilders.standaloneSetup(memberController).build();
}

// ai가 나보다 잘짠다..
Copy link
Member

Choose a reason for hiding this comment

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

??

);

// given(questionService.getQuestionResponseDTOList()).willReturn(List.of(response1, response2));
doReturn(List.of(response1, response2)).when(questionService)
Copy link
Member

Choose a reason for hiding this comment

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

22

.getAllResults(any(Long.class));
// when
ResultActions resultActions = mockMvc.perform(
MockMvcRequestBuilders.get("/result/1")
Copy link
Member

Choose a reason for hiding this comment

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

이런 API ENDPOINT 분리해도 좋지 않을까요?

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