WireMock 的時候報錯:No response could be served as there are no stub mappings in this WireMock
環境:
idea
win10
問題描述:
使用wiremock讀取resources下的mock.json檔案,瀏覽器報錯
No response could be served as there are no stub mappings in this WireMock
程式碼如下
public void proxyMockTest(){
try {
stubFor(get(urlMatching(".*")).atPriority(10)
.willReturn(aResponse().proxiedFrom("https://www.baidu.com/")));
stubFor(get(urlEqualTo("categories_and_latest")).atPriority(1)
//通過json檔案修改指定網頁資訊
.willReturn(aResponse().withBody(Files.readAllBytes(Paths
.get(WireMockTest.class.getResource("/mock.json")
.toURI())))));
Thread.sleep(50000);
} catch (Exception e) {
e.printStackTrace();
}
報錯解決方案:
在resources檔案下增加mocks資料夾,那麼在上面的專案中,路徑變成resources/mocks/mock.json,即可解決
相關文章
- Mock工具wiremock-pyMockREM
- 使用Wiremock進行整合測試 - kubilayREMMock
- su的時候報:could not open sessionSession
- WireMock+renren-fast 快速搭建 HTTP Mock 視覺化平臺思路REMMockASTHTTP視覺化
- rsync 客戶端同步的時候報錯客戶端
- 執行dbca命令的時候報錯了
- setInterval()呼叫其他函式時候報錯函式
- 物理data guard備standby庫的時候報錯。
- vagrant下composer安裝laravel-wechat時候,出現could not delete的錯誤Laraveldelete
- 誰遇到過執行 monkey 的時候報 filenotfound 的報錯
- 解決vue使用Sass時候的報錯問題Vue
- suse10啟動vsftp的時候報錯FTP
- nginx的an upstream response is buffered to a temporary file報錯Nginx
- oracle RAC dbca的時候報錯提示cluster nodes are not accessibleOracle
- crontab 新增計劃任務的時候報錯疑問?
- 提交App Store的時候報錯java.lang.reflect.InvocationTargetExceptionAPPJavaException
- mount iso檔案的時候提示Could not find any loop deviceOOPdev
- HIVE運算的時候報HADOOP Name node is in safe mode 錯HiveHadoop
- 今天在object-c 和swift 混編的時候出現錯誤:could not build module foundationObjectSwiftUI
- pg_basebackup 報錯could not create directory
- 設定Ruby報錯bad response Not Found 404
- weblogic 部署應用的時候報錯 java.util.zip.ZipException: ErrorWebJavaExceptionError
- rman映象備份全庫的時候報ora-00600錯誤。
- 奇怪的問題: 資料庫使用者登入的時候報錯資料庫
- 使用jsp:useBean的時候出錯!JSBean
- cmake報錯CMake Error: Could not find CMAKE_ROOTError
- 配置 C3 工具時,修改/etc/host,再重新安裝叢集的時候報錯
- 在事件中實現 佇列的時候報錯請教一下事件佇列
- npm publish 釋出一個 Angular 庫的時候報錯以及解決方法NPMAngular
- 啟動oracle資料庫的時候報ORA-00205錯誤:Oracle資料庫
- oracle 安裝的時候出現PRVF-0002 : could not retrieve local node nameOracle
- 建立Materialed View (物化檢視)時候報錯ORA-01723View
- Could not initialize class sun.awt.X11GraphicsEnvironment 報錯
- Could not resolve host: 'localhost 報錯解決辦法localhost
- redhat as4 64位安裝oracle10.2.0.1建庫的時候報錯RedhatOracle
- 最近在學習rman,恢復的時候報錯,大家看看,怎麼解決
- virtualbox 安裝 虛擬機器的時候報錯不能建立新任務虛擬機
- 啟動Eclipse的時候報錯Failed to load the JNI shared library..EclipseAI