WireMock簡單使用

WireMock官方文檔:http://wiremock.org/docs/running-standalone/java

一、下載相關standalone的jar包git

  http://repo1.maven.org/maven2/com/github/tomakehurst/wiremock-standalone/2.8.0/wiremock-standalone-2.8.0.jargithub

二、cmd一下,而後進入當standalone相關jar包目錄執行命令json

  java -jar wiremock-standalone-2.8.0.jar -port 9998api

  執行完命令後相關目錄會生成兩個子目錄:_files和mappings文件夾瀏覽器

  

三、在mappings目錄下面寫一個json文件(包含請求路徑和響應數據)app

  

 

四、瀏覽器輸入網址:http://localhost:9998/api/mytestmaven

  

相關文章
相關標籤/搜索