Hello we want to use the following filter in our t...
# help
n
Hello we want to use the following filter in our tests https://wiremock.org/docs/extensibility/filtering-requests/ to ensure that our service has always a bearer token if it sends rest requests to other services. We use WireMockContainer to mock our service dependencies. How can I add the filter to those container? I tried it with
Copy code
this.withExtension(SimpleAuthRequestFilter::class.java.simpleName)
We use kotlin for our tests. But I only get the error that the Container can't find the class.
After I changed it to WireMockRule(wireMockConfig().extensions(SimpleAuthRequestFilter())) I get the following error "Jetty 11 is not present and no suitable HttpServerFactory extension was found. Please ensure that the classpath includes a WireMock extension that provides an HttpServerFactory implementation."
Next try via withCopyFileToContainer( MountableFile.forHostPath("//build/libs/examples.jar"), "/var/wiremock/extensions/" ) withCliArg("--extensions ${SimpleAuthRequestFilter::class.java.name}"). Resulted in Java Runtime (class file version 65.0), this version of the Java Runtime only recognizes class file versions up to 55.0. Is there an option to run it with Java 21? We use the following image wiremock/wiremock:3.6.0