-
Notifications
You must be signed in to change notification settings - Fork 297
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
[MVC 구현하기 - 3단계] 오찌(오지훈) 미션 제출합니다 #255
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.
안녕하세요 오찌~! 빨리 구현해주셨네요!
잘 구현해주셔서 특별히 코멘트 드릴게 없지만 미션 기간이 여유로우니 약간의 코멘트만 남겼어요~!
README.md
Outdated
## 3단계 - JSON View 구현하기 | ||
|
||
- [x] 힌트에서 제공한 UserController 컨트롤러가 json 형태로 응답을 반환한다. | ||
- [ ] 레거시 코드를 삭제하고 서버를 띄워도 정상 동작한다. |
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.
요기 체크가 안됐네요!
import nextstep.mvc.view.ModelAndView; | ||
import org.junit.jupiter.api.Test; | ||
|
||
class UserControllerTest { |
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.
컨트롤러 테스트 👍
} | ||
|
||
private Object getAttributes(final Map<String, ?> model) { | ||
if (model.size() > 1) { |
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.
사소하지만 매직넘버 제거하면 좋을 것 같아욥
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.
3단계까지 미션하시느라 수고하셨습니다!
마지막으로 한가지 질문만 남겼어요.
다음 미션도 화이팅하세욥🙏
@RequestMapping(value = "/api/user", method = RequestMethod.GET) | ||
public ModelAndView show(HttpServletRequest request, HttpServletResponse response) { | ||
final String account = request.getParameter("account"); | ||
if (account == null) { |
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.
if (account == null) { | |
if (Objects.isNull(account)) { |
위에처럼 Objects의 메서드를 사용하지 않으신 이유가 있을까요?
안녕하세요 기론 😄 3단계를 빨리 마무리하고 리뷰 요청 드립니다!
새로 추가되는 UserController 메서드도 테스트 하기 위해 InMemoryUserRepository를 UserRepository로 한 단계 추상화했습니다!
사실 나머지 Controller들도 테스트를 추가해야 할지가 조금 고민이네요...!
또다른 고민이 있다면 서블릿에 매핑되지 않은 URL의 경우 어떻게 해야 404.jsp를 보내줄 수 있을지, ServletException이 발생했을 때 500.jsp로 리다이렉션해주는 것은 어떨지에 대한 고민입니다. 에러에 관련된 jsp 파일을 리다이렉션 하는 부분에서 좋은 생각이 있으시다면 공유 부탁드려요 ㅎㅎ :)
3단계도 잘 부탁드립니다!