Update dependency org.mock-server:mockserver-netty to v6#8418
Merged
Conversation
Closed
e670384 to
b1d63c5
Compare
b1d63c5 to
ce000e1
Compare
jack-berg
approved these changes
May 28, 2026
Contributor
Author
Edited/Blocked NotificationRenovate will not automatically rebase this PR, because it does not recognize the last commit author and assumes somebody else may have edited the PR. You can manually request rebase by checking the rebase/retry box above. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8418 +/- ##
============================================
- Coverage 91.15% 90.98% -0.17%
- Complexity 7763 7810 +47
============================================
Files 881 892 +11
Lines 23409 23702 +293
Branches 2331 2361 +30
============================================
+ Hits 21338 21566 +228
- Misses 1376 1413 +37
- Partials 695 723 +28 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
5.15.0→6.1.0Release Notes
mock-server/mockserver-monorepo (org.mock-server:mockserver-netty)
v6.1.0Security
mockserver.forwardProxyBlockPrivateNetworksproperty (defaultfalsefor backwards compatibility) rejects forward targets that resolve to loopback, link-local, RFC 1918 private, or cloud metadata addresses (e.g.169.254.169.254). Enable in hardened or multi-tenant deployments where untrusted callers can register expectations. A future major release is expected to flip the default totrue.mockserver.regexMatchingTimeoutMillis(default5000ms). Patterns that exceed the budget are treated as non-matches and a WARN log entry is written, so a pathological pattern cannot wedge a Netty worker.mockserver.xpathMatchingTimeoutMillis(default5000ms).UUIDServiceandTemplateFunctionsnow useSecureRandominstead ofjava.util.Randomfor UUID generation,rand_int/rand_int_10/rand_int_100, andrand_bytestemplate helpers.forwardProxyTLSX509CertificatesTrustManagerType=ANY), (b) Velocity class loading is enabled (velocityDisallowClassLoading=false), (c) JavaScript templates have no class restrictions (javascriptDisallowedClassesempty), or (d)tlsProtocolsincludes the deprecated TLSv1 / TLSv1.1.mockserver.tlsAllowInsecureProtocolsconfiguration property (defaulttruefor backwards compatibility): when set tofalse, anyTLSv1orTLSv1.1entries inmockserver.tlsProtocolsare filtered out before the SSL context is built, giving users an opt-in hardened TLS profile without having to rewrite their existingtlsProtocolsvalue. A future major release is expected to flip this default tofalse.Added
httpLlmResponseaction type lets you mock LLM provider APIs at the semantic level — describe the model's reply (text, tool calls, stop reason, usage) and MockServer produces the byte-correct provider wire format. Supports all 7 major providers: Anthropic Messages, OpenAI Chat Completions, OpenAI Responses, Google Gemini, AWS Bedrock, Azure OpenAI, and Ollama. Non-streaming responses return provider-correct JSON; streaming responses generate the full SSE event sequence (e.g.message_startthroughmessage_stopfor Anthropic,chat.completion.chunkwithfinish_reasonfor OpenAI) with configurable timing physics (timeToFirstToken,tokensPerSecond,jitter). OpenAI embeddings are also supported with deterministic vector generation viadeterministicFromInput().whenTurnIndex(n),whenLatestMessageContains(text),whenLatestMessageRole(role), andwhenContainsToolResultFor(toolName)predicates match against the parsedmessagesarray in the inbound request body, enabling scripted multi-turn conversations where turn 1 returns atool_useand turn 2 (after the agent sends atool_result) returns the final answer. All predicates compose with AND semantics and integrate with the scenario state machine for automatic turn advancement.isolateBy(header("x-session-id")),isolateBy(queryParameter("agent")), orisolateBy(cookie("sid")): each unique value of the configured attribute gets independent scenario state, so concurrent agents sharing the same mocked endpoint do not interfere. Missing attributes fall back to shared state gracefully.mock_llm_completionMCP tool: set up a single-turn LLM expectation from the MCP control plane, specifying provider, path, model, text, tool calls, and streaming modecreate_llm_conversationMCP tool: build a multi-turn scenario-chained LLM conversation with optional per-session isolation from the MCP control plane; returns the generated scenario name and per-turn state valuesmockserver.maxLlmConversationBodySizeconfiguration property (default 1 MiB; clamped to 16 KiB - 64 MiB; env varMOCKSERVER_MAX_LLM_CONVERSATION_BODY_SIZE): request bodies larger than this limit skip conversation-aware parsing and are treated as no-match, preventing DoS via oversized JSON payloadsorg.mockserver.matchers.CustomJsonUnitMatcherProviderand pointmockserver.customJsonUnitMatchersClassat it to register named Hamcrest matchers that JSON body expectations can reference via the${json-unit.matches:name}placeholder (e.g.{ "price": "${json-unit.matches:largerThan}" }); misconfigured providers are logged at WARN and ignored, so matching never fails because of an unloadable extension (fixes #2279)http2Enabledconfiguration property to disable HTTP/2: when set to false ALPN no longer advertisesh2(and h2c is not detected) so HTTP/2 capable clients fall back to HTTP/1.1explain_unmatched_requestsMCP tool andPUT /mockserver/explainUnmatchedREST endpoint return recent requests that matched no expectation, each with ranked closest-expectation diffs and actionable remediation hints (e.g., "use method POST not GET", "add missing header Authorization");debug_request_mismatchresults are now ranked by closeness and include remediation hints; newmockserver://unmatchedMCP resourcecreate_expectations_from_recorded_trafficMCP tool: converts traffic recorded by MockServer's forwarding/proxy mode into active mock expectations in one call, enabling an "observe then mock" workflow; supportsmethod/pathfiltering andpreviewmode to inspect expectations before activating themverify_traffic_against_openapivalidates recorded request-response pairs against an OpenAPI spec (passive conformance checking);run_contract_testsends example requests derived from an OpenAPI spec to a running service and validates the responses (active contract testing); both return structured per-operation pass/fail results with validation errorsrun_resiliency_testsends deliberately malformed and boundary-case requests derived from an OpenAPI spec to a running service (omitting required fields, type violations, numeric/string boundary violations, oversized strings, malformed JSON) and classifies each outcome as HANDLED (4xx) or UNEXPECTED (5xx/2xx/error); returns per-mutation results with operation summariesrecord_llm_fixturesMCP tool snapshots LLM/MCP traffic recorded through MockServer's forwarding proxy into a committable JSON fixture file with secrets automatically redacted (Authorization, api-key, Cookie, etc.); SSE streaming responses (Anthropic, OpenAI, etc.) are converted toHttpSseResponseactions for faithful event-by-event replay;load_expectations_from_fileMCP tool loads fixture files as active expectations for offline, deterministic, zero-cost test replayChanged
mockserver.maxRequestBodySize). Previously unbounded. Requests larger than the limit are rejected with413 Payload Too Large. Raise the limit (e.g.-Dmockserver.maxRequestBodySize=52428800) if you intentionally mock large uploads.mockserver.maxResponseBodySize). Previously unbounded. Raise if you forward to services that legitimately return larger payloads.-no-dependenciesshaded artifacts) now declares a stableAutomatic-Module-Namein itsMANIFEST.MF, so downstream JPMS consumers canrequiresMockServer modules with names that no longer change with each version:org.mockserver.core(mockserver-core),org.mockserver.client(mockserver-client-java),org.mockserver.netty(mockserver-netty),org.mockserver.test(mockserver-testing),org.mockserver.testing(mockserver-integration-testing),org.mockserver.junit.rule(mockserver-junit-rule),org.mockserver.junit.jupiter(mockserver-junit-jupiter),org.mockserver.springtest(mockserver-spring-test-listener),org.mockserver.examples(mockserver-examples),org.mockserver.maven(mockserver-maven-plugin); each*-no-dependenciesshaded variant shares its unshaded counterpart's module name and is an alternative packaging (place only one on the JPMS module path)Fixed
dynamicallyCreateCertificateAuthorityCertificate=true(or any auto-generated server certificate path) is used: the fourConfigurationfluent setters forcertificateAuthorityCertificate,certificateAuthorityPrivateKey,privateKeyPath, andx509CertificatePathno longer file-existence-check at set-time, because the internal generator sets these to the destination path before the file is written. User-supplied path typos are still surfaced byCertificateConfigurationValidatorat TLS-init time.*-no-dependenciesshaded artifacts leaked their un-shaded source module (and its transitive dependencies) onto consumers' classpaths; these artifacts are now truly dependency-freev6.0.0Added
Protocol & transport
GrpcStreamResponsesupports multi-frame streaming responsesoperationNamematching, andvariablesSchemaJSON Schema validation for variablesBinaryRequestDefinitionandBinaryResponsefor non-HTTP protocolsdnsEnabled/dnsPortconfiguration and support for A, AAAA, CNAME, MX, SRV, TXT, and PTR record typesCONNECTtunnelRequest matching
percentagefield (0–100) on an expectation so only a fraction of matching requests are served by it, enabling fault-injection scenarios (fixes #2122)HttpRequest:HttpRequest.get(path),.post(path),.put(path),.delete(path),.patch(path),.head(path),.options(path)for more concise expectation definitions (fixes #1509)Responses & actions
httpResponseslist with aresponseModeofSEQUENTIAL(cycle repeatedly through the list in order) orRANDOM(pick at random) to serve different responses on successive matched requestsnewScenarioStateon the expectation, making it straightforward to model multi-step protocolsPUT /mockserver/crud: supply a data model and MockServer auto-generates a fully stateful REST API (list, create, read, update, delete) backed by an in-memory storeFileBodyresponse body type that loads content from a file path at response time, useful for large or binary payloads (fixes #2163)PUT /mockserver/files/store, retrieve viaPUT /mockserver/files/retrieve, list viaPUT /mockserver/files/list, and delete viaPUT /mockserver/files/delete; stored files can be referenced byFileBody(fixes #1652)respondBeforeBodyflag on the request matcher to dispatch the configured response (and optionally close the connection) before MockServer reads the request body, useful for reproducing client behaviour when a server responds and closes mid-upload (fixes #1831)Delays & timing
mockserver.globalResponseDelayMillisconfiguration property to add a baseline delay to every responsemockserver.connectionDelayMillisconfiguration property: a configurable delay before protocol detection fires, so slow-connect scenarios can be tested without a real network (fixes #1604)ConnectionOptions.withChunkSize()/withChunkDelay()to drip-feed any response body in configurable-size chunks at a configurable rateResponse templates
Record & replay
format=HARto the retrieve API to get a standard HAR file of all recorded requests and responses (fixes #2175)persistRecordedExpectationsandpersistedRecordedExpectationsPathconfiguration properties save recorded traffic to disk so it survives restarts (fixes #2175)Debugging & diagnostics
debugMismatch()client method andPUT /mockserver/debugMismatchendpoint to programmatically retrieve the closest-match analysis for the last unmatched requestEXPECTATION_NOT_MATCHEDlog events to guide correction of common mistakesEXPECTATION_NOT_MATCHEDlog messages to make it easier to correlate log output with the intended expectation (fixes #1937)Logging
mockserver.compactLogFormat=trueto emit single-line JSON log entries instead of multi-line formatted output (fixes #1510)mockserver.logLevelOverridesso individual event types can have different log levels (fixes #1694)retrieveLogsByCorrelationId()client method and a correlationId chip in the dashboard for tracing a single request across all related log eventsretrieveLogEntries()client method returning typedLogEntryobjects with optional time-range filtering; passLOG_ENTRIESas the format to the retrieve API for programmatic accessConsumer<LogEntry>callback registered with theConfigurationobject, enabling integration with external observability tools (fixes #1960)Proxy & forwarding configuration
mockserver.forwardDefaultHostHeaderconfiguration property: set a specificHostheader value to send on all forwarded requests, overriding the original clientHostheader (fixes #1782)mockserver.proxyRemoteHostandmockserver.proxyRemotePortconfiguration properties to route all proxy traffic through an upstream proxy (fixes #1753)OpenAPI
callbacksentries in an OpenAPI specification and automatically createsAfterActionwebhook expectations (fixes #1483)TLS & security
Client & test integration
@MockServerTestnow appliesmockserver.*prefixed properties to the per-instance MockServerConfigurationobject, enabling declarative configuration ofinitializationClass,logLevel,maxExpectations, and other settings directly in the annotation (fixes #1554)StreamReadConstraintsmaximum string length raised to 100 MB to handle large JSON bodies withoutStreamConstraintsException(fixes #1754)Build & deployment
initializationJsonnow accepts glob patterns to load multiple expectation files from a directory (fixes #2231)mockserver/mockserver:graaljsDocker image tag that bundles the GraalJS engine JARs, enabling native ECMAScript 2022 support in response templates without NashornpodLabelsvalue to attach arbitrary labels to MockServer pods, useful for service-mesh injection and internal routing rules (fixes #1884)Changed
classifier=shadedform ofmockserver-client-java,mockserver-netty,mockserver-junit-jupiter,mockserver-junit-rule, andmockserver-spring-test-listeneris no longer published. Use the corresponding*-no-dependenciesartifactId instead (e.g. depend onmockserver-netty-no-dependenciesrather thanmockserver-nettywith<classifier>shaded</classifier>). The*-no-dependenciesvariants are now proper Maven modules and are the supported way to consume a shaded MockServer jar.Fixed
Proxy & forwarding
502 Bad Gatewayinstead of404 Not Found, making it clearer to clients that the upstream could not be reached (fixes #1519)Hostheader updated to match the forwarding target to prevent421 Misdirected Requesterrors from strict servers (fixes #1897)Content-Encodingare now re-compressed correctly when forwarding, preventing garbled bodies on the upstream (fixes #1668)Transfer-Encodingheader preserved on forwarded responses; spuriousContent-Lengthheader no longer added whenTransfer-Encodingis present (fixes #1733)Request & response handling
!were corrupted in forwarded responses (fixes #1875)application/octet-stream; charset=utf-8) were corrupted because acharsetparameter inContent-Typecaused the body to be treated as a string; now correctly treated as binary (fixes #1910)0.00was incorrectly serialized as0.0(fixes #1740)OpenAPI
ByteArraySchema(stringformatbyte) properties were omitted from generated OpenAPI examples (fixes #1788)$refinside OpenAPI example values was not resolved, leading to raw$refstrings in generated responses (fixes #1474)allOf/anyOf/oneOfcomposed schemas now generate merged example responses (fixes #1852)exclusiveMinimum/exclusiveMaximumnow correctly translated to JSON Schema Draft-07 numeric format (fixes #1896)typesarray field now correctly preserved during schema serialization (fixes #1940)XML
xs:includeorxs:importusing relative paths now resolve correctly (fixes #2118)JUnit & Spring integration
@MockServerTestfield injection now works in@NestedJUnit 5 test classes (fixes #1979)@MockServerSettings(carrying@ExtendWith) is combined with explicitMockServerExtensionregistration is now prevented (fixes #1977)clientCertificateChain,localAddress, andremoteAddressfields onHttpRequestwere serialized but not deserialized — both directions now work (fixes #1973)MockServerClientparameter injection now works with@TestInstance(PER_CLASS)where the test instance is created before@BeforeAll(fixes #1621)ClassNotFoundExceptionfor callback classes when running in a Spring Boot uber JAR (fixes #1571)Dashboard & WebSocket
CONNECTproxy no longer hangs when the client advertisesh2via ALPN (fixes #1933)Concurrency & thread safety
Times.remainingTimes()made thread-safe withAtomicIntegerto prevent race conditions under concurrent load (fixes #1834)XmlStringMatchermade thread-safe by creating a newDiffBuilderper match instead of sharing one (fixes #1796)verify()to prevent false-positive or false-negative results under high throughput (fixes #1757)TLS & mTLS
Docker & deployment
netty-tcnativenative libraries no longer bundled in the shaded JAR, preventing native library conflicts (fixes #1778)Glob & file initialization
initializationJsonpath failed to find the starting directory in some environments (fixes #1715)WebSocketchannel leak when theCircularHashMapevicted the oldest callback client (fixes #1543)Configuration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.