mock-server / mockserver

MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby. MockServer also includes a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding).
http://mock-server.com
Apache License 2.0
4.62k stars 1.08k forks source link

Docs: fix Node.js link, add link to Docker Compose examples #1877

Open sgerrand opened 6 months ago

sgerrand commented 6 months ago

💁 While browsing the documentation for this excellent project, I came across a broken link and made these changes.

These changes:

sgerrand commented 6 months ago

👋 @jamesdbloom, would you please approve the pending workflow when you have a chance?

Screenshot 2024-05-29 at 12 38 02
sgerrand commented 6 months ago

🤔 Looks like there are errors being raised in the Java test suite which are unrelated to this change. Can anyone with more knowledge of this test suite comment on whether this flakiness is normal or not?

[ERROR] Tests run: 14, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 28.085 s <<< FAILURE! - in org.mockserver.dashboard.DashboardWebSocketHandlerTest
--
  | [ERROR] shouldSerialiseEventsWithRequestFilter(org.mockserver.dashboard.DashboardWebSocketHandlerTest)  Time elapsed: 2.013 s  <<< FAILURE!
  | java.lang.AssertionError:
  |  
  | Expected: is "{\n  \"logMessages\" : [ {\n    \"key\" : \"2cadd5ed-2de7-447a-a63f-d92d6b2f48f1_log\",\n    \"value\" : {\n      \"description\" : \"05-29 12:51:41.336 RECEIVED_REQUEST   \",\n      \"style\" : {\n        \"paddingBottom\" : \"4px\",\n        \"whiteSpace\" : \"nowrap\",\n        \"overflow\" : \"auto\",\n        \"color\" : \"rgb(114,160,193)\",\n        \"paddingTop\" : \"4px\"\n      },\n      \"messageParts\" : [ {\n        \"key\" : \"2cadd5ed-2de7-447a-a63f-d92d6b2f48f1_0msg\",\n        \"value\" : \"messageFormatThree\"\n      } ]\n    }\n  }, {\n    \"key\" : \"5fb82048-7c7a-4c87-b15b-c6e74c1a5206_log\",\n    \"value\" : {\n      \"description\" : \"05-29 12:51:41.336 INFO               \",\n      \"style\" : {\n        \"style.whiteSpace\" : \"pre-wrap\",\n        \"paddingBottom\" : \"4px\",\n        \"whiteSpace\" : \"nowrap\",\n        \"overflow\" : \"auto\",\n        \"color\" : \"rgb(59,122,87)\",\n        \"paddingTop\" : \"4px\"\n      },\n      \"messageParts\" : [ {\n        \"key\" : \"5fb82048-7c7a-4c87-b15b-c6e74c1a5206_0msg\",\n        \"value\" : \"messageFormat\"\n      } ]\n    }\n  } ],\n  \"recordedRequests\" : [ {\n    \"description\" : \"  /somePathTwo\",\n    \"value\" : {\n      \"path\" : \"/somePathTwo\"\n    },\n    \"key\" : \"2cadd5ed-2de7-447a-a63f-d92d6b2f48f1_request\"\n  } ]\n}"
  | but: was "{\n  \"logMessages\" : [ {\n    \"key\" : \"2cadd5ed-2de7-447a-a63f-d92d6b2f48f1_log\",\n    \"value\" : {\n      \"description\" : \"05-29 12:51:41.336 RECEIVED_REQUEST   \",\n      \"style\" : {\n        \"paddingBottom\" : \"4px\",\n        \"whiteSpace\" : \"nowrap\",\n        \"overflow\" : \"auto\",\n        \"color\" : \"rgb(114,160,193)\",\n        \"paddingTop\" : \"4px\"\n      },\n      \"messageParts\" : [ {\n        \"key\" : \"2cadd5ed-2de7-447a-a63f-d92d6b2f48f1_0msg\",\n        \"value\" : \"messageFormatThree\"\n      } ]\n    }\n  }, {\n    \"key\" : \"4729b142-31e5-42cb-8557-fdb2887deb86_log\",\n    \"value\" : {\n      \"description\" : \"05-29 12:51:41.336 RECEIVED_REQUEST   \",\n      \"style\" : {\n        \"paddingBottom\" : \"4px\",\n        \"whiteSpace\" : \"nowrap\",\n        \"overflow\" : \"auto\",\n        \"color\" : \"rgb(114,160,193)\",\n        \"paddingTop\" : \"4px\"\n      },\n      \"messageParts\" : [ {\n        \"key\" : \"4729b142-31e5-42cb-8557-fdb2887deb86_0msg\",\n        \"value\" : \"messageFormatTwo\"\n      } ]\n    }\n  }, {\n    \"key\" : \"58db37b2-df0a-43dd-8bc4-2f5e0479054e_log\",\n    \"value\" : {\n      \"description\" : \"05-29 12:51:41.336 RECEIVED_REQUEST   \",\n      \"style\" : {\n        \"paddingBottom\" : \"4px\",\n        \"whiteSpace\" : \"nowrap\",\n        \"overflow\" : \"auto\",\n        \"color\" : \"rgb(114,160,193)\",\n        \"paddingTop\" : \"4px\"\n      },\n      \"messageParts\" : [ {\n        \"key\" : \"58db37b2-df0a-43dd-8bc4-2f5e0479054e_0msg\",\n        \"value\" : \"messageFormatOne\"\n      } ]\n    }\n  }, {\n    \"key\" : \"5fb82048-7c7a-4c87-b15b-c6e74c1a5206_log\",\n    \"value\" : {\n      \"description\" : \"05-29 12:51:41.336 INFO               \",\n      \"style\" : {\n        \"style.whiteSpace\" : \"pre-wrap\",\n        \"paddingBottom\" : \"4px\",\n        \"whiteSpace\" : \"nowrap\",\n        \"overflow\" : \"auto\",\n        \"color\" : \"rgb(59,122,87)\",\n        \"paddingTop\" : \"4px\"\n      },\n      \"messageParts\" : [ {\n        \"key\" : \"5fb82048-7c7a-4c87-b15b-c6e74c1a5206_0msg\",\n        \"value\" : \"messageFormat\"\n      } ]\n    }\n  }, {\n    \"key\" : \"6a3183c0-ca5c-4062-8d58-9c12ce148431_log\",\n    \"value\" : {\n      \"description\" : \"05-29 12:51:41.336 INFO               \",\n      \"style\" : {\n        \"style.whiteSpace\" : \"pre-wrap\",\n        \"paddingBottom\" : \"4px\",\n        \"whiteSpace\" : \"nowrap\",\n        \"overflow\" : \"auto\",\n        \"color\" : \"rgb(59,122,87)\",\n        \"paddingTop\" : \"4px\"\n      },\n      \"messageParts\" : [ {\n        \"key\" : \"6a3183c0-ca5c-4062-8d58-9c12ce148431_0msg\",\n        \"value\" : \"messageFormat\"\n      } ]\n    }\n  }, {\n    \"key\" : \"009a1f69-5e8a-4387-ae65-5874bbf16cc2_log\",\n    \"value\" : {\n      \"description\" : \"05-29 12:51:41.336 INFO               \",\n      \"style\" : {\n        \"style.whiteSpace\" : \"pre-wrap\",\n        \"paddingBottom\" : \"4px\",\n        \"whiteSpace\" : \"nowrap\",\n        \"overflow\" : \"auto\",\n        \"color\" : \"rgb(59,122,87)\",\n        \"paddingTop\" : \"4px\"\n      },\n      \"messageParts\" : [ {\n        \"key\" : \"009a1f69-5e8a-4387-ae65-5874bbf16cc2_0msg\",\n        \"value\" : \"messagePartOne:\"\n      }, {\n        \"key\" : \"009a1f69-5e8a-4387-ae65-5874bbf16cc2_0arg\",\n        \"multiline\" : false,\n        \"argument\" : true,\n        \"value\" : \"\\\"argumentOne\\\"\"\n      }, {\n        \"key\" : \"009a1f69-5e8a-4387-ae65-5874bbf16cc2_1msg\",\n        \"value\" : \"messagePartTwo:\"\n      }, {\n        \"key\" : \"009a1f69-5e8a-4387-ae65-5874bbf16cc2_1arg\",\n        \"multiline\" : false,\n        \"argument\" : true,\n        \"value\" : \"\\\"argumentTwo\\\"\"\n      } ]\n    }\n  } ],\n  \"recordedRequests\" : [ {\n    \"description\" : \"  /somePathTwo\",\n    \"value\" : {\n      \"path\" : \"/somePathTwo\"\n    },\n    \"key\" : \"2cadd5ed-2de7-447a-a63f-d92d6b2f48f1_request\"\n  }, {\n    \"description\" : \"  /somePathOne\",\n    \"value\" : {\n      \"path\" : \"/somePathOne\"\n    },\n    \"key\" : \"4729b142-31e5-42cb-8557-fdb2887deb86_request\"\n  }, {\n    \"description\" : \"  /somePathOne\",\n    \"value\" : {\n      \"path\" : \"/somePathOne\"\n    },\n    \"key\" : \"58db37b2-df0a-43dd-8bc4-2f5e0479054e_request\"\n  } ]\n}"
  | at org.mockserver.dashboard.DashboardWebSocketHandlerTest.shouldRenderFilteredLogEntriesCorrectly(DashboardWebSocketHandlerTest.java:1503)
  | at org.mockserver.dashboard.DashboardWebSocketHandlerTest.shouldSerialiseEventsWithRequestFilter(DashboardWebSocketHandlerTest.java:471)
  |  
  | [INFO] Running org.mockserver.clientandserver.ClientAndServerListenerTest
  | STARTED: shouldNotifyListener
  | FAILED: shouldNotifyListener
  | FINISHED: shouldNotifyListener duration: 31
  | [ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.032 s <<< FAILURE! - in org.mockserver.clientandserver.ClientAndServerListenerTest
  | [ERROR] shouldNotifyListener(org.mockserver.clientandserver.ClientAndServerListenerTest)  Time elapsed: 0.03 s  <<< FAILURE!
  | java.lang.AssertionError:
  |  
  | Expected: is <1>
  | but: was <0>
  | at org.mockserver.clientandserver.ClientAndServerListenerTest.shouldNotifyListener(ClientAndServerListenerTest.java:37)
  |  
  | [INFO]
  | [INFO] Results:
  | [INFO]
  | [ERROR] Failures:
  | [ERROR]   ClientAndServerListenerTest.shouldNotifyListener:37
  | Expected: is <1>
  | but: was <0>
  | [ERROR]   DashboardWebSocketHandlerTest.shouldSerialiseEventsWithRequestFilter:471->shouldRenderFilteredLogEntriesCorrectly:1503
  | Expected: is "{\n  \"logMessages\" : [ {\n    \"key\" : \"2cadd5ed-2de7-447a-a63f-d92d6b2f48f1_log\",\n    \"value\" : {\n      \"description\" : \"05-29 12:51:41.336 RECEIVED_REQUEST   \",\n      \"style\" : {\n        \"paddingBottom\" : \"4px\",\n        \"whiteSpace\" : \"nowrap\",\n        \"overflow\" : \"auto\",\n        \"color\" : \"rgb(114,160,193)\",\n        \"paddingTop\" : \"4px\"\n      },\n      \"messageParts\" : [ {\n        \"key\" : \"2cadd5ed-2de7-447a-a63f-d92d6b2f48f1_0msg\",\n        \"value\" : \"messageFormatThree\"\n      } ]\n    }\n  }, {\n    \"key\" : \"5fb82048-7c7a-4c87-b15b-c6e74c1a5206_log\",\n    \"value\" : {\n      \"description\" : \"05-29 12:51:41.336 INFO               \",\n      \"style\" : {\n        \"style.whiteSpace\" : \"pre-wrap\",\n        \"paddingBottom\" : \"4px\",\n        \"whiteSpace\" : \"nowrap\",\n        \"overflow\" : \"auto\",\n        \"color\" : \"rgb(59,122,87)\",\n        \"paddingTop\" : \"4px\"\n      },\n      \"messageParts\" : [ {\n        \"key\" : \"5fb82048-7c7a-4c87-b15b-c6e74c1a5206_0msg\",\n        \"value\" : \"messageFormat\"\n      } ]\n    }\n  } ],\n  \"recordedRequests\" : [ {\n    \"description\" : \"  /somePathTwo\",\n    \"value\" : {\n      \"path\" : \"/somePathTwo\"\n    },\n    \"key\" : \"2cadd5ed-2de7-447a-a63f-d92d6b2f48f1_request\"\n  } ]\n}"
  | but: was "{\n  \"logMessages\" : [ {\n    \"key\" : \"2cadd5ed-2de7-447a-a63f-d92d6b2f48f1_log\",\n    \"value\" : {\n      \"description\" : \"05-29 12:51:41.336 RECEIVED_REQUEST   \",\n      \"style\" : {\n        \"paddingBottom\" : \"4px\",\n        \"whiteSpace\" : \"nowrap\",\n        \"overflow\" : \"auto\",\n        \"color\" : \"rgb(114,160,193)\",\n        \"paddingTop\" : \"4px\"\n      },\n      \"messageParts\" : [ {\n        \"key\" : \"2cadd5ed-2de7-447a-a63f-d92d6b2f48f1_0msg\",\n        \"value\" : \"messageFormatThree\"\n      } ]\n    }\n  }, {\n    \"key\" : \"4729b142-31e5-42cb-8557-fdb2887deb86_log\",\n    \"value\" : {\n      \"description\" : \"05-29 12:51:41.336 RECEIVED_REQUEST   \",\n      \"style\" : {\n        \"paddingBottom\" : \"4px\",\n        \"whiteSpace\" : \"nowrap\",\n        \"overflow\" : \"auto\",\n        \"color\" : \"rgb(114,160,193)\",\n        \"paddingTop\" : \"4px\"\n      },\n      \"messageParts\" : [ {\n        \"key\" : \"4729b142-31e5-42cb-8557-fdb2887deb86_0msg\",\n        \"value\" : \"messageFormatTwo\"\n      } ]\n    }\n  }, {\n    \"key\" : \"58db37b2-df0a-43dd-8bc4-2f5e0479054e_log\",\n    \"value\" : {\n      \"description\" : \"05-29 12:51:41.336 RECEIVED_REQUEST   \",\n      \"style\" : {\n        \"paddingBottom\" : \"4px\",\n        \"whiteSpace\" : \"nowrap\",\n        \"overflow\" : \"auto\",\n        \"color\" : \"rgb(114,160,193)\",\n        \"paddingTop\" : \"4px\"\n      },\n      \"messageParts\" : [ {\n        \"key\" : \"58db37b2-df0a-43dd-8bc4-2f5e0479054e_0msg\",\n        \"value\" : \"messageFormatOne\"\n      } ]\n    }\n  }, {\n    \"key\" : \"5fb82048-7c7a-4c87-b15b-c6e74c1a5206_log\",\n    \"value\" : {\n      \"description\" : \"05-29 12:51:41.336 INFO               \",\n      \"style\" : {\n        \"style.whiteSpace\" : \"pre-wrap\",\n        \"paddingBottom\" : \"4px\",\n        \"whiteSpace\" : \"nowrap\",\n        \"overflow\" : \"auto\",\n        \"color\" : \"rgb(59,122,87)\",\n        \"paddingTop\" : \"4px\"\n      },\n      \"messageParts\" : [ {\n        \"key\" : \"5fb82048-7c7a-4c87-b15b-c6e74c1a5206_0msg\",\n        \"value\" : \"messageFormat\"\n      } ]\n    }\n  }, {\n    \"key\" : \"6a3183c0-ca5c-4062-8d58-9c12ce148431_log\",\n    \"value\" : {\n      \"description\" : \"05-29 12:51:41.336 INFO               \",\n      \"style\" : {\n        \"style.whiteSpace\" : \"pre-wrap\",\n        \"paddingBottom\" : \"4px\",\n        \"whiteSpace\" : \"nowrap\",\n        \"overflow\" : \"auto\",\n        \"color\" : \"rgb(59,122,87)\",\n        \"paddingTop\" : \"4px\"\n      },\n      \"messageParts\" : [ {\n        \"key\" : \"6a3183c0-ca5c-4062-8d58-9c12ce148431_0msg\",\n        \"value\" : \"messageFormat\"\n      } ]\n    }\n  }, {\n    \"key\" : \"009a1f69-5e8a-4387-ae65-5874bbf16cc2_log\",\n    \"value\" : {\n      \"description\" : \"05-29 12:51:41.336 INFO               \",\n      \"style\" : {\n        \"style.whiteSpace\" : \"pre-wrap\",\n        \"paddingBottom\" : \"4px\",\n        \"whiteSpace\" : \"nowrap\",\n        \"overflow\" : \"auto\",\n        \"color\" : \"rgb(59,122,87)\",\n        \"paddingTop\" : \"4px\"\n      },\n      \"messageParts\" : [ {\n        \"key\" : \"009a1f69-5e8a-4387-ae65-5874bbf16cc2_0msg\",\n        \"value\" : \"messagePartOne:\"\n      }, {\n        \"key\" : \"009a1f69-5e8a-4387-ae65-5874bbf16cc2_0arg\",\n        \"multiline\" : false,\n        \"argument\" : true,\n        \"value\" : \"\\\"argumentOne\\\"\"\n      }, {\n        \"key\" : \"009a1f69-5e8a-4387-ae65-5874bbf16cc2_1msg\",\n        \"value\" : \"messagePartTwo:\"\n      }, {\n        \"key\" : \"009a1f69-5e8a-4387-ae65-5874bbf16cc2_1arg\",\n        \"multiline\" : false,\n        \"argument\" : true,\n        \"value\" : \"\\\"argumentTwo\\\"\"\n      } ]\n    }\n  } ],\n  \"recordedRequests\" : [ {\n    \"description\" : \"  /somePathTwo\",\n    \"value\" : {\n      \"path\" : \"/somePathTwo\"\n    },\n    \"key\" : \"2cadd5ed-2de7-447a-a63f-d92d6b2f48f1_request\"\n  }, {\n    \"description\" : \"  /somePathOne\",\n    \"value\" : {\n      \"path\" : \"/somePathOne\"\n    },\n    \"key\" : \"4729b142-31e5-42cb-8557-fdb2887deb86_request\"\n  }, {\n    \"description\" : \"  /somePathOne\",\n    \"value\" : {\n      \"path\" : \"/somePathOne\"\n    },\n    \"key\" : \"58db37b2-df0a-43dd-8bc4-2f5e0479054e_request\"\n  } ]\n}"
  | [INFO]
  | [ERROR] Tests run: 92, Failures: 2, Errors: 0, Skipped: 0
  | [INFO]
  | [INFO] ------------------------------------------------------------------------
  | [INFO] Reactor Summary for MockServer 5.15.1-SNAPSHOT:
  | [INFO]
  | [INFO] MockServer ......................................... SUCCESS [  3.553 s]
  | [INFO] MockServer Testing ................................. SUCCESS [  3.261 s]
  | [INFO] MockServer Core .................................... SUCCESS [01:41 min]
  | [INFO] MockServer Java Client ............................. SUCCESS [04:05 min]
  | [INFO] MockServer Integration Test ........................ SUCCESS [03:01 min]
  | [INFO] MockServer Web Archive ............................. SUCCESS [01:23 min]
  | [INFO] MockServer Proxy Web Archive ....................... SUCCESS [ 41.256 s]
  | [INFO] MockServer & Proxy Netty ........................... FAILURE [ 43.883 s]
  | [INFO] MockServer JUnit 4 Integration ..................... SKIPPED
  | [INFO] MockServer JUnit Jupiter Integration ............... SKIPPED
  | [INFO] MockServer Spring Test ............................. SKIPPED
  | [INFO] MockServer Examples ................................ SKIPPED
  | [INFO] ------------------------------------------------------------------------
  | [INFO] BUILD FAILURE
  | [INFO] ------------------------------------------------------------------------
  | [INFO] Total time:  11:44 min
  | [INFO] Finished at: 2024-05-29T12:52:15+01:00
  | [INFO] ------------------------------------------------------------------------
  | [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.2:test (default-test) on project mockserver-netty: There are test failures.
  | [ERROR]
  | [ERROR] Please refer to /build/mockserver/mockserver-netty/target/surefire-reports for the individual test results.
  | [ERROR] Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.
  | [ERROR] -> [Help 1]
  | [ERROR]
  | [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
  | [ERROR] Re-run Maven using the -X switch to enable full debug logging.
  | [ERROR]
  | [ERROR] For more information about the errors and possible solutions, please read the following articles:
  | [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
  | [ERROR]
  | [ERROR] After correcting the problems, you can resume the build with the command
  | [ERROR]   mvn <args> -rf :mockserver-netty
  | 🚨 Error: The command exited with status 1