Add mocking of HttpAsyncClient
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);
Hi @[PawelAdamski] i am interested in this issue Will you please assign me this issue
Hi @Priyanshu-ai902 I'm happy to hear that you are interested in contributing to HttpClientMock. Feel free to work on HttpAsycClient.It would be great if you could first expalin my your idea and then jump into the code, thanks to that approving your PR should be much easier.
I explain my idea within the code
@Priyanshu-ai902 Your code doesn't give me enough information how you would like build mock for HttpClientAsync. Please provide more detail or working examples.