Header header = new Header("name", "value");
String method = "METHOD";
String path = "path";
Parameter parameter = new Parameter("name", "value");
String url = "url";
HttpRequest httpRequest = new HttpRequest()
.withBody(body)
.withCookies(cookie)
.withHeaders(header)
.withMethod(method)
.withPath(path)
.withQueryStringParameter(parameter)
.withURL(url);
// when
HttpRequest builtHttpRequest = new HttpRequestDTO(httpRequest).buildObject();
// then
assertThat(builtHttpRequest.getBody(), Is.<org.mockserver.model.Body>is(exact(body)));
assertThat(builtHttpRequest.getCookies(), containsInAnyOrder(cookie));
assertThat(builtHttpRequest.getHeaders(), containsInAnyOrder(header));
assertThat(builtHttpRequest.getMethod(), is(method));
assertThat(builtHttpRequest.getPath(), is(path));
assertThat(builtHttpRequest.getQueryStringParameters(), containsInAnyOrder(parameter));
assertThat(builtHttpRequest.getURL(), is(url));
}