Stay in Current State for specified number of requests
See original GitHub issueHey guy,s I need to write mocks such that a request keeps faulting for a given number of time before it can succeed. I know that I can use Scenarios for this.
But there’s a problem. Let’s suppose I want to fault my request 2 times before succeeding on 3rd attempt. So I have to write three mocks where flow would be like this:
-- 1st Mock:
-- Set next state to "fail"
-- Fail request
-- 2nd Mock:
-- When current state is "fail"
-- Set next state to "pass"
-- Fail request
-- 3rd Mock:
-- When current state is "pass"
-- Pass request
We can see that first 2 states are just doing same thing. So my question is this: Is it possible to build a mock which stay in its current state for a given number of time, before switching to next one. So my mocks would be like below:
-- 1st Mock:
-- Set next state to "pass" ONLY after 2 requests
-- Fail request
-- 2nd Mock:
-- When current state is "pass"
-- Pass request
Issue Analytics
- State:
- Created 3 years ago
- Comments:5
Top Results From Across the Web
Quotas - AWS Step Functions - AWS Documentation
AWS Step Functions places quotas on the sizes of certain state machine parameters, such as the number of API actions during a certain...
Read more >Invoke-WebRequest - PowerShell
The Invoke-WebRequest cmdlet sends HTTP and HTTPS requests to a web page or web service. It parses the response and returns collections of...
Read more >HTTP/1.1: Status Code Definitions
10.2 Successful 2xx. This class of status code indicates that the client's request was successfully received, understood, and accepted.
Read more >HTTP Request Methods – Get vs Put vs Post Explained ...
In this article, we'll be discussing the get, put, and post HTTP methods. You'll learn what each HTTP method is used for as...
Read more >How to Fix 429 Too Many Requests Error
The HTTP 429 error is returned when a user has sent too many requests within a short period of time. The 429 status...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@shoaibshakeel381 Can you try preview version
WireMock.Net.1.2.16-ci-13650.nupkg
from MyGet ? (https://github.com/WireMock-Net/WireMock.Net/wiki/MyGet-preview-versions)@shoaibshakeel381
Probably the interface can look like:
or