openmetadata-mcp depends on mockwebserver for one test the JDK HttpServer can serve
openmetadata-mcp declares a test dependency on com.squareup.okhttp3:mockwebserver:4.12.0 that is
used by exactly one test class, IdTokenValidatorTest, to serve a static JWKS document.
The JDK has shipped com.sun.net.httpserver.HttpServer since Java 6 and it does the job in a few
lines, so the dependency buys nothing and costs a third-party HTTP server on the test classpath.
Also worth fixing while there
MockWebServer.enqueue is a one-shot queue: each enqueued response is consumed by a single
request. IdTokenValidatorTest enqueues one JWKS response in setUp and a second one inside
testValidateAndDecode_NoAudienceValidationWhenNull. Any change that causes an extra JWKS fetch —
a retry, a cache miss, a second validator instance — silently gets an empty queue rather than the
document, and the failure looks like a JWKS parse error rather than a missing stub.
A plain HttpServer handler serves the same body to every request, so the test stops depending on
how many times the validator happens to fetch.
How we know it is fixed
openmetadata-mcp/pom.xmlno longer declaresmockwebserver, and no source in the module references it.IdTokenValidatorTestbinds anHttpServeron127.0.0.1:0, serves the JWKS document from a single context, and stops it in@AfterEach.- All 10 tests in the class pass.
Source: open-metadata/OpenMetadata