Class ValidatedWireMockRule
java.lang.Object
com.github.tomakehurst.wiremock.WireMockServer
com.github.tomakehurst.wiremock.junit.WireMockRule
com.atlassian.oai.validator.wiremock.ValidatedWireMockRule
- All Implemented Interfaces:
com.github.tomakehurst.wiremock.core.Admin,com.github.tomakehurst.wiremock.core.Container,com.github.tomakehurst.wiremock.junit.Stubbing,org.junit.rules.TestRule
public class ValidatedWireMockRule
extends com.github.tomakehurst.wiremock.junit.WireMockRule
A near drop-in replacement for the
WireMockRule that adds support for validating the request/response
interactions against an OpenAPI / Swagger specification.
If a validation failure is found, will throw a
OpenApiValidationListener.OpenApiValidationException that will
fail the test.
- See Also:
-
Field Summary
Fields inherited from class com.github.tomakehurst.wiremock.WireMockServer
client, options -
Constructor Summary
ConstructorsConstructorDescriptionValidatedWireMockRule(OpenApiInteractionValidator validator) ValidatedWireMockRule(OpenApiInteractionValidator validator, int port) ValidatedWireMockRule(OpenApiInteractionValidator validator, int port, Integer httpsPort) ValidatedWireMockRule(OpenApiInteractionValidator validator, com.github.tomakehurst.wiremock.core.Options options) ValidatedWireMockRule(OpenApiInteractionValidator validator, com.github.tomakehurst.wiremock.core.Options options, boolean failOnUnmatchedStubs) ValidatedWireMockRule(String specUrlOrPayload) ValidatedWireMockRule(String specUrlOrPayload, int port) ValidatedWireMockRule(String specUrlOrPayload, int port, Integer httpsPort) ValidatedWireMockRule(String specUrlOrPayload, com.github.tomakehurst.wiremock.core.Options options) ValidatedWireMockRule(String specUrlOrPayload, com.github.tomakehurst.wiremock.core.Options options, boolean failOnUnmatchedStubs) -
Method Summary
Methods inherited from class com.github.tomakehurst.wiremock.junit.WireMockRule
applyMethods inherited from class com.github.tomakehurst.wiremock.WireMockServer
addMockServiceRequestListener, addStubMapping, baseUrl, checkForUnmatchedRequests, countRequestsMatching, editStub, editStubMapping, enableRecordMappings, findAll, findAllNearMissesFor, findAllStubsByMetadata, findAllUnmatchedRequests, findNearMissesFor, findNearMissesForAllUnmatchedRequests, findNearMissesForUnmatchedRequests, findRequestsMatching, findStubMappingsByMetadata, findTopNearMissesFor, findTopNearMissesFor, findUnmatchedRequests, getAllScenarios, getAllServeEvents, getGlobalSettings, getGlobalSettingsHolder, getOptions, getRecordingStatus, getServedStub, getServeEvents, getServeEvents, getSingleStubMapping, getStubMapping, getStubMappings, givenThat, httpsPort, importStubs, isHttpEnabled, isHttpsEnabled, isRunning, listAllStubMappings, loadMappingsUsing, port, removeServeEvent, removeServeEventsForStubsMatchingMetadata, removeServeEventsMatching, removeStub, removeStub, removeStubMapping, removeStubMapping, removeStubMappingsByMetadata, removeStubsByMetadata, resetAll, resetMappings, resetRequests, resetScenario, resetScenarios, resetToDefaultMappings, saveMappings, setGlobalFixedDelay, setScenarioState, shutdown, shutdownServer, snapshotRecord, snapshotRecord, snapshotRecord, start, startRecording, startRecording, startRecording, stop, stopRecording, stubFor, updateGlobalSettings, url, verify, verify, verify
-
Constructor Details
-
ValidatedWireMockRule
public ValidatedWireMockRule(String specUrlOrPayload, com.github.tomakehurst.wiremock.core.Options options) -
ValidatedWireMockRule
public ValidatedWireMockRule(OpenApiInteractionValidator validator, com.github.tomakehurst.wiremock.core.Options options) -
ValidatedWireMockRule
public ValidatedWireMockRule(String specUrlOrPayload, com.github.tomakehurst.wiremock.core.Options options, boolean failOnUnmatchedStubs) -
ValidatedWireMockRule
public ValidatedWireMockRule(OpenApiInteractionValidator validator, com.github.tomakehurst.wiremock.core.Options options, boolean failOnUnmatchedStubs) -
ValidatedWireMockRule
-
ValidatedWireMockRule
-
ValidatedWireMockRule
-
ValidatedWireMockRule
-
ValidatedWireMockRule
-
ValidatedWireMockRule
-
-
Method Details
-
before
protected void before()- Overrides:
beforein classcom.github.tomakehurst.wiremock.junit.WireMockRule
-
after
protected void after()- Overrides:
afterin classcom.github.tomakehurst.wiremock.junit.WireMockRule
-