I am sending a request to a MockWebServer. I want to checkout parameters of said request for testing purposes. How can I extract it from MockWebServer?
I am sending a request to a MockWebServer. I want to checkout parameters of said request for testing purposes. How can I extract it from MockWebServer?
A good tutorial on MockWebServer https://www.baeldung.com/spring-mocking-webclient
You should be able to use getRequestUrl to access the full url including query params.
RecordedRequest recordedRequest = mockBackEnd.takeRequest();
assertEquals("GET", recordedRequest.getMethod());
assertEquals("/employee/100", recordedRequest.getPath());
HttpUrl requestUrl = recordedRequest.getRequestUrl();