Spring RequestBodyAdvice is not picking up by the mock MVC frame work, how ever it is working for ResponseBodyAdvice

会有一股神秘感。 提交于 2020-01-04 05:48:06

问题


We are using Spring 4.2.0-RELEASE and implementing RequestBodyAdvice and ResponseBodyAdvice advices to parse the request and response bodies.

When we try to write the mock unit tests using spring test frame work, it is picking up only the Response body advice and not reuqestBodyadvice

advices[0] = testRequestBodyAdvice;
advices[1] = testResponseBodyAdvice;
mockMvc =  MockMvcBuilders.standaloneSetup(authTokenController).
  setControllerAdvice(advices).build();

Are we missing any thing here?

来源:https://stackoverflow.com/questions/36419353/spring-requestbodyadvice-is-not-picking-up-by-the-mock-mvc-frame-work-how-ever

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!