use of com.github.mjeanroy.junit.servers.utils.builders.AsyncHttpResponseBuilder in project junit-servers by mjeanroy.
the class AsyncHttpResponseFactoryTest method it_should_create_http_response.
@Test
void it_should_create_http_response() {
Response delegate = new AsyncHttpResponseBuilder().build();
long duration = 1000L;
HttpResponse response = AsyncHttpResponseFactory.of(delegate, duration);
assertThat(response).isNotNull().isExactlyInstanceOf(AsyncHttpResponse.class);
assertThat(response.getRequestDuration()).isEqualTo(duration);
}
use of com.github.mjeanroy.junit.servers.utils.builders.AsyncHttpResponseBuilder in project junit-servers by mjeanroy.
the class AsyncHttpResponseTest method it_should_implement_to_string.
@Test
void it_should_implement_to_string() {
final Response delegate = new AsyncHttpResponseBuilder().build();
final long duration = 1000L;
final AsyncHttpResponse response = new AsyncHttpResponse(delegate, duration);
assertThat(response.toString()).isEqualTo("AsyncHttpResponse{" + "duration: 1000, " + "response: NettyResponse {\n" + " statusCode=200\n" + " headers=\n" + " body=\n" + "\n" + "}" + "}");
}
Aggregations