Added feature to enable and disable mappings#1437
Merged
StefH merged 4 commits intowiremock:masterfrom Apr 24, 2026
Merged
Conversation
StefH
requested changes
Apr 3, 2026
Collaborator
|
@jayaraman-venkatesan |
…able and /disable
…tion that is causing upstream connection from proxy to teardown prematurely before test ends
…le insted of IsEnabled
b395b67 to
f2eb410
Compare
Contributor
Author
|
@StefH I have made all the suggested changes |
Collaborator
|
@jayaraman-venkatesan |
Contributor
Author
|
The 2 APIs ( I dont think there are any more interfaces that can trigger this action. But please let me know if had missed something. If needed, on top of this I can also add if |
Collaborator
|
Ok. It's fine |
This was referenced Apr 25, 2026
Merged
This was referenced Apr 27, 2026
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat: add soft-disable support for mappings (#1421)
Summary
IsEnabledflag on mappings (defaults totrue) that prevents a mapping from being matched without deleting it, preserving it for post-test inspectionPUT /__admin/mappings/{guid}/enableandPUT /__admin/mappings/{guid}/disableadmin endpointsEnableMappingAsync/DisableMappingAsynctoIWireMockAdminApityped clientIsEnabled: falsecan be set in POST/PUT mapping body and round-trips throughGET /mappingsand static mapping filesGET /mappingsandserver.Mappings— only request matching skips themChanges
IRespondWithAProvider— newWithIsEnabled(bool)builder method (fluent, consistent withWithProbability/WithTitle)RespondWithAProvider— stores_isEnabled, applies it duringRespondWith()WireMockServer.ConvertMapping— callsWithIsEnabled(false)whenmappingModel.IsEnabled == falseMappingConverter.ToMappingModel— serializesIsEnabledasfalseonly when disabled (null = enabled, sparse/backward-compatible)WireMockServer.Admin— two new regex path matchers, two route registrations,MappingEnable/MappingDisablehandlers,TryParseGuidFromSecondToLastSegmenthelperMappingMatcherTests— fixedInitMappingshelper and exception test mock to setIsEnabled = true(required after.Where(m => m.IsEnabled)was added); addedWhenMappingIsDisabled_ShouldReturnNulltestWireMockAdminApiTests.IsEnabled— 4 integration tests covering create-disabled, disable endpoint, enable endpoint, GET serializationBackward compatibility
IsEnableddefaults totrueeverywhere — existing mappings, JSON files, and API clients are unaffectedIsEnabledfield is omitted from JSON whentrue(null) and only written whenfalseSubmitter checklist
#help-contributingor a project-specific channel like#wiremock-java