Package org.mockserver.openapi
Class OpenApiResiliencyTest
java.lang.Object
org.mockserver.openapi.OpenApiResiliencyTest
Given an OpenAPI spec, generates deliberately malformed and boundary-case requests
for each operation, sends them via an injected HTTP-send function, and classifies
each outcome as HANDLED (4xx) or UNEXPECTED (5xx, 2xx, or connection error).
The class is HTTP-client-agnostic; the caller wires in the real client via the
httpSender function passed to runResiliencyTests(java.lang.String, java.lang.String, java.lang.String, java.util.function.Function<org.mockserver.model.HttpRequest, org.mockserver.model.HttpResponse>).
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic classstatic enumstatic classstatic class -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionrunResiliencyTests(String specUrlOrPayload, String baseUrl, String operationIdFilter, Function<HttpRequest, HttpResponse> httpSender) Runs resiliency tests for each operation in the spec.
-
Constructor Details
-
OpenApiResiliencyTest
-
-
Method Details
-
runResiliencyTests
public OpenApiResiliencyTest.ResiliencyTestReport runResiliencyTests(String specUrlOrPayload, String baseUrl, String operationIdFilter, Function<HttpRequest, HttpResponse> httpSender) Runs resiliency tests for each operation in the spec.- Parameters:
specUrlOrPayload- URL, file path, or inline JSON/YAML of the OpenAPI specbaseUrl- base URL of the service under test (e.g. "http://localhost:8080")operationIdFilter- optional filter to test only a specific operationhttpSender- function that sends an HttpRequest and returns an HttpResponse- Returns:
- structured report with per-mutation results and summary
-