-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Description
Currently HttpClientMock supports only mocking of HttpClient. In scope of this issue we want to add support for mocking HttpAsyncClient. Working HttpAsyncClientMock should look similar to HttpClientMock. Example:
Record:
HttpClientAsyncMock httpClientAsyncMock = new HttpClientAsyncMock();
httpClientAsyncMock .onGet("http://localhost/login")
.withParameter("user","john")
.doReturn("Ok");
httpClientAsyncMock .onPost("http://localhost/login").doReturnStatus(501);
verify:
httpClientAsyncMock .verify().get("http://localhost/login").withParameter("user","john").called()
httpClientAsyncMock .verify().post("http://localhost/login").notCalled()
HttpClientAsyncMock should have additional action to simulate a delay response.
httpClientAsyncMock .onPost("http://localhost/login").delay(4,TimeUnit.Seconds).doReturnStatus(501);
ryber, larsga, c0nstruct0r, pomu0325 and atholbro