Added feature to enable and disable mappings (#1437)

* feat/1421 added feature to enable and disable mappings

* feat/1421 updated test constants to reflect 2 new admin endpoints /enable and /disable

* feat/1421 updated tests to fix flakyness - removed delay before assertion that is causing upstream connection from proxy to teardown prematurely before test ends

* feat/1421 addressing PR comments - Updated logic to represent IsDisable insted of IsEnabled
This commit is contained in:
Jayaraman Venkatesan
2026-04-24 02:07:37 -04:00
committed by GitHub
parent 85d61a1877
commit 1962437dcd
13 changed files with 277 additions and 4 deletions

View File

@@ -37,6 +37,7 @@ internal class RespondWithAProvider : IRespondWithAProvider
private int _timesInSameState = 1;
private bool? _useWebhookFireAndForget;
private double? _probability;
private bool _isDisabled = false;
private GraphQLSchemaDetails? _graphQLSchemaDetails; // Future Use.
public Guid Guid { get; private set; }
@@ -108,6 +109,11 @@ internal class RespondWithAProvider : IRespondWithAProvider
mapping.WithProbability(_probability.Value);
}
if (_isDisabled)
{
mapping.IsDisabled = true;
}
if (ProtoDefinition != null)
{
mapping.WithProtoDefinition(ProtoDefinition.Value);
@@ -354,6 +360,13 @@ internal class RespondWithAProvider : IRespondWithAProvider
return this;
}
/// <inheritdoc />
public IRespondWithAProvider WithIsDisabled(bool isDisabled)
{
_isDisabled = isDisabled;
return this;
}
/// <inheritdoc />
public IRespondWithAProvider WithProtoDefinition(params string[] protoDefinitionOrId)
{