SpringMVC3.2.x整合Fastjson与Controller单元测试
SpringMVC与Fastjson整合相当简单,只要在pom引入fastjson包后,配置一下SpringMVC的messageConverter就可以使用了。 <mvc:annotation-driven content-negotiation-manager="contentNegotiationManager"> <mvc:message-converters register-defaults="true"> <bean class="com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter"></bean> </mvc:message-converters> </mvc:annotation-driven> <bean id="contentNegotiationManager" class="org.springframework.web.accept.ContentNegotiationManagerFactoryBean"> <property name="mediaTypes" > <value> json=application/json xml=application/xml </value> </property> </bean> 但是如果在单元测试时