728x90
MockHttpServletRequest:
HTTP Method = POST
Request URI = /users/create
Parameters = {}
Headers = [Content-Type:"application/json;charset=UTF-8", Accept:"application/xml", Content-Length:"41"]
Body = {"username":"sangguk", "password":"1234"}
Session Attrs = {}
Handler:
Type = com.example.springbootwebmvc.user.UserController
Method = com.example.springbootwebmvc.user.UserController#create(User)
Async:
Async started = false
Async result = null
Resolved Exception:
Type = org.springframework.web.HttpMediaTypeNotAcceptableException
ModelAndView:
View name = null
View = null
Model = null
FlashMap:
Attributes = null
MockHttpServletResponse:
Status = 406
Error message = null
Headers = []
Content type = null
Body =
Forwarded URL = null
Redirected URL = null
Cookies = []
java.lang.AssertionError: Status
Expected :200
Actual :406
> 위의 경우 해당 View의 메시지 컨버터의 dependency를 추가해주면 해결된다.
728x90
'Spring Boot > error' 카테고리의 다른 글
The called method's class hierarchy was loaded from the following locations (0) | 2022.03.26 |
---|---|
java.lang.IllegalStateException: Failed to load ApplicationContext (0) | 2022.02.05 |
org.junit.runners.model.InvalidTestClassError (0) | 2022.02.05 |
댓글