java.lang.IllegalArgumentException: incorrect expectation json format for:
{
"httpRequest" : {
"method" : "POST",
"path" : "/oauth2/token",
"headers" : {
"Content-Type" : [ "application/x-www-form-urlencoded;charset=UTF-8" ]
},
"secure" : true
},
"id" : "65b36753-ed36-440c-a93a-b5e3691359db",
"priority" : 0,
"timeToLive" : {
"unlimited" : true
},
"times" : {
"unlimited" : true
}
}
schema validation errors:
11 errors:
- $.httpError: is missing, but is required, if specifying action of type Error
- $.httpForward: is missing, but is required, if specifying action of type Forward
- $.httpForwardClassCallback: is missing, but is required, if specifying action of type ForwardClassCallback
- $.httpForwardObjectCallback: is missing, but is required, if specifying action of type ForwardObjectCallback
- $.httpForwardTemplate: is missing, but is required, if specifying action of type ForwardTemplate
- $.httpOverrideForwardedRequest: is missing, but is required, if specifying action of type OverrideForwardedRequest
- $.httpResponse: is missing, but is required, if specifying action of type Response
- $.httpResponseClassCallback: is missing, but is required, if specifying action of type ResponseClassCallback
- $.httpResponseObjectCallback: is missing, but is required, if specifying action of type ResponseObjectCallback
- $.httpResponseTemplate: is missing, but is required, if specifying action of type ResponseTemplate
- oneOf of the following must be specified [httpError, httpForward, httpForwardClassCallback, httpForwardObjectCallback, httpForwardTemplate, httpOverrideForwardedRequest, httpResponse, httpResponseClassCallback, httpResponseObjectCallback, httpResponseTemplate]
OpenAPI Specification: https://app.swaggerhub.com/apis/jamesdbloom/mock-server-openapi/5.15.x
Documentation: https://mock-server.com/mock_server/creating_expectations.html
at org.mockserver.serialization.ExpectationSerializer.deserializeArray(ExpectationSerializer.java:205)
at org.mockserver.serialization.ExpectationSerializer.deserializeArray(ExpectationSerializer.java:158)
at org.mockserver.client.MockServerClient.upsert(MockServerClient.java:1517)
at org.mockserver.client.ForwardChainExpectation.respond(ForwardChainExpectation.java:84)
at io.cloudcatalyst.journey.commons.domain.config.service.external.rest.authentication.MutualTLSTest.test(MutualTLSTest.java:211)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
as you can see half of the Expectation's JSON is missing (e.g. no "httpResponse"), if I remove .withClientCertificateChain(clientCertificateChain) everything works fine but then client certificates are not matched
Describe the issue
every time I try to use
HttpRequest.request().withClientCertificateChain(clientCertificateChain(...)I get the following exception when calling the chained.respond(HttpResponse.response()....:as you can see half of the Expectation's JSON is missing (e.g. no "httpResponse"), if I remove
.withClientCertificateChain(clientCertificateChain)everything works fine but then client certificates are not matchedWhat you are trying to do
verify if my client is correctly using mTLS authentication
MockServer version
5.15.0