Step2 Acceptance Test 기반 구현#128
Open
decaffeine wants to merge 2 commits into
Open
Conversation
javajigi
requested changes
Apr 3, 2019
Contributor
javajigi
left a comment
There was a problem hiding this comment.
도메인 객체에 로직 구현 및 Acceptance Test 구현 잘 했네요. 💯
도메인 객체에 로직 구현했으면 이에 대한 단위 테스트도 구현하면 어떨까?
| this.contents = contents; | ||
| } | ||
|
|
||
| public Question update(User loginUser, Question updatedQuestion) { |
| Iterable<Question> questionsIterable = qnaService.findAll(); | ||
| List<Question> questions = new ArrayList<>(); | ||
| questionsIterable.forEach(questions::add); | ||
| model.addAttribute("questions",questions); |
Contributor
There was a problem hiding this comment.
굳이 새로운 List에 담기보다 questionsIterable을 그냥 전달해도 되지 않을까?
| Iterable<Question> questionsIterable = qnaService.findAll(); | ||
| List<Question> questions = new ArrayList<>(); | ||
| questionsIterable.forEach(questions::add); | ||
| model.addAttribute("questions",questions); |
| public String login(String userId, String password, HttpSession session) throws UnAuthenticationException { | ||
| User loginUser = userService.login(userId, password); | ||
| session.setAttribute(HttpSessionUtils.USER_SESSION_KEY, loginUser); | ||
| return "redirect:/"; |
Contributor
There was a problem hiding this comment.
로그인 실패하는 경우에 대한 예외처리도 하면 좋지 않을까?
| softly.assertThat(response.getStatusCode()).isEqualTo(HttpStatus.FOUND); | ||
| softly.assertThat((response.getHeaders().getLocation()).getPath().startsWith("/questions")); | ||
| } | ||
| } |
Contributor
There was a problem hiding this comment.
도메인 객체에 로직을 구현했는데 이에 대한 단위 테스트도 구현하면 좋지 않을까?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Step2 리뷰 요청드립니다.