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

전체 테스트 시 Posts_updated 테스트 실패 이슈 #4

Closed
kchung1995 opened this issue Feb 22, 2022 · 1 comment
Closed

전체 테스트 시 Posts_updated 테스트 실패 이슈 #4

kchung1995 opened this issue Feb 22, 2022 · 1 comment

Comments

@kchung1995
Copy link
Owner

단위 테스트 시에는 정상적으로 동작하지만, 전체 테스트 시 PostsApiControllerTest.java의 Posts_updated()가 실패함

@kchung1995
Copy link
Owner Author

전체 테스트를 실행하는 경우 Posts_updated() 이전에 Posts_registerd()가 실행되는데,
이 때 생성된 posts가 0번째 인자가 되고, Posts_updated()에서 생성한 posts가 1번째 인자가 됨.

Update는 1번째 인자의 posts를 수정하지만, 이후 assertEquals에서는 0번째 인자의 posts와 기댓값을 비교함.

이를 위해 삭제 기능을 추가하고, 이를 Posts_registered(), Posts_updated()의 마지막 줄에 추가해 주었음.
해당 commit 내용을 참고.

이후 전체 테스트를 실행하였더니 정상적으로 테스트를 통과하는 것을 확인함.

관련된 사항을 블로그 글에 자세하게 정리하였음.

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

No branches or pull requests

1 participant