Fix random delay in mapping json file (#1386)

This commit is contained in:
Stef Heyenrath
2025-11-25 20:54:06 +01:00
committed by GitHub
parent 5e25ca767d
commit 44388ce80d
6 changed files with 293 additions and 5 deletions

View File

@@ -78,3 +78,45 @@ server
.WithBody("Buy milk")
);
server
.Given(Request.Create()
.UsingMethod("GET")
.WithPath(new WildcardMatcher(WireMock.Matchers.MatchBehaviour.AcceptOnMatch, "/delay", false, WireMock.Matchers.MatchOperator.Or))
)
.WithGuid("98fae52e-76df-47d9-876f-2ee32e931006")
.RespondWith(Response.Create()
.WithDelay(1000)
);
server
.Given(Request.Create()
.UsingMethod("GET")
.WithPath(new WildcardMatcher(WireMock.Matchers.MatchBehaviour.AcceptOnMatch, "/random-delay", false, WireMock.Matchers.MatchOperator.Or))
)
.WithGuid("98fae52e-76df-47d9-876f-2ee32e931007")
.RespondWith(Response.Create()
.WithRandomDelay(1234, 60000)
);
server
.Given(Request.Create()
.UsingMethod("GET")
.WithPath(new WildcardMatcher(WireMock.Matchers.MatchBehaviour.AcceptOnMatch, "/prob", false, WireMock.Matchers.MatchOperator.Or))
)
.WithGuid("98fae52e-76df-47d9-876f-2ee32e931008")
.WithProbability(0.1)
.RespondWith(Response.Create()
.WithStatusCode(300)
);
server
.Given(Request.Create()
.UsingMethod("GET")
.WithPath(new WildcardMatcher(WireMock.Matchers.MatchBehaviour.AcceptOnMatch, "/prob", false, WireMock.Matchers.MatchOperator.Or))
)
.WithGuid("98fae52e-76df-47d9-876f-2ee32e931009")
.WithProbability(0.9)
.RespondWith(Response.Create()
.WithStatusCode(201)
);