差異處

這裏顯示兩個版本的差異處。

連向這個比對檢視

Both sides previous revision 前次修改
java:wiremock:record-disconnection-behavior [2021/08/15 15:56]
tony
java:wiremock:record-disconnection-behavior [2021/08/15 16:05] (目前版本)
tony [Extend ResponseTransformer]
行 47: 行 47:
     @Override     @Override
     public Response transform(Request request, Response response, FileSource files, Parameters parameters) {     public Response transform(Request request, Response response, FileSource files, Parameters parameters) {
-    if(response.getStatus()==500&&​response.getBodyAsString().contains("​timed out")) {+    if(response.getStatus()==500&&​response.getBodyAsString().contains("​Network failure")) {
     return Response.Builder.like(response)     return Response.Builder.like(response)
     .body(String.valueOf(Fault.CONNECTION_RESET_BY_PEER))     .body(String.valueOf(Fault.CONNECTION_RESET_BY_PEER))