使用mockserver来进行http接口mock
转载:http://blog.csdn.net/heymysweetheart/article/details/52227379 前言 进行单元测试时,必须要mock掉第三方的依赖调用,而mockserver提供了足够的api来支持这种http的mock,现在简单介绍如何使用mockserver进行http接口mock。 依赖 mockserver依赖 < dependency > < groupId > org . mock - server </ groupId > < artifactId > mockserver - netty </ artifactId > < version > 3.10 . 4 </ version > </ dependency > httpclient依赖 < dependency > < groupId > org . apache . httpcomponents </ groupId > < artifactId > httpclient </ artifactId > < version > 4.3 . 3 </ version > </ dependency > <!-- https : //mvnrepository.com/artifact/org.apache.httpcomponents/httpcore --> <