Search in sources :

Example 46 with HttpResponse

use of com.github.mjeanroy.junit.servers.client.HttpResponse in project springmvc-mustache by mjeanroy.

the class IndexControllerTest method it_should_render_template_using_model_and_mustache_view.

@Test
void it_should_render_template_using_model_and_mustache_view(HttpClient client) {
    HttpResponse response = client.prepareGet("/jane").execute();
    assertThat(response.status()).isEqualTo(200);
    assertThat(response.body()).contains("Hello, my name is Jane Doe");
}
Also used : HttpResponse(com.github.mjeanroy.junit.servers.client.HttpResponse) Test(org.junit.jupiter.api.Test) JettyTest(com.github.mjeanroy.junit.servers.jetty.jupiter.JettyTest)

Example 47 with HttpResponse

use of com.github.mjeanroy.junit.servers.client.HttpResponse in project springmvc-mustache by mjeanroy.

the class IndexControllerTest method it_should_render_handlebars_template.

@Test
void it_should_render_handlebars_template(HttpClient client) {
    HttpResponse response = client.prepareGet("/").execute();
    assertThat(response.status()).isEqualTo(200);
    assertThat(response.body()).contains("Hello, my name is John Doe");
}
Also used : HttpResponse(com.github.mjeanroy.junit.servers.client.HttpResponse) Test(org.junit.jupiter.api.Test) JettyTest(com.github.mjeanroy.junit.servers.jetty.jupiter.JettyTest)

Example 48 with HttpResponse

use of com.github.mjeanroy.junit.servers.client.HttpResponse in project springmvc-mustache by mjeanroy.

the class IndexControllerTest method it_should_render_handlebars_template_using_model_and_mustache_view.

@Test
void it_should_render_handlebars_template_using_model_and_mustache_view(HttpClient client) {
    HttpResponse response = client.prepareGet("/jane").execute();
    assertThat(response.status()).isEqualTo(200);
    assertThat(response.body()).contains("Hello, my name is Jane Doe");
}
Also used : HttpResponse(com.github.mjeanroy.junit.servers.client.HttpResponse) Test(org.junit.jupiter.api.Test) JettyTest(com.github.mjeanroy.junit.servers.jetty.jupiter.JettyTest)

Example 49 with HttpResponse

use of com.github.mjeanroy.junit.servers.client.HttpResponse in project springmvc-mustache by mjeanroy.

the class IndexControllerTest method it_should_render_handlebars_template.

@Test
void it_should_render_handlebars_template(HttpClient client) {
    HttpResponse response = client.prepareGet("/").execute();
    assertThat(response.status()).isEqualTo(200);
    assertThat(response.body()).contains("Hello, my name is John Doe");
}
Also used : HttpResponse(com.github.mjeanroy.junit.servers.client.HttpResponse) Test(org.junit.jupiter.api.Test) JettyTest(com.github.mjeanroy.junit.servers.jetty.jupiter.JettyTest)

Example 50 with HttpResponse

use of com.github.mjeanroy.junit.servers.client.HttpResponse in project springmvc-mustache by mjeanroy.

the class IndexControllerTest method it_should_render_handlebars_template_using_model_and_mustache_view.

@Test
void it_should_render_handlebars_template_using_model_and_mustache_view(HttpClient client) {
    HttpResponse response = client.prepareGet("/jane").execute();
    assertThat(response.status()).isEqualTo(200);
    assertThat(response.body()).contains("Hello, my name is Jane Doe");
}
Also used : HttpResponse(com.github.mjeanroy.junit.servers.client.HttpResponse) Test(org.junit.jupiter.api.Test) JettyTest(com.github.mjeanroy.junit.servers.jetty.jupiter.JettyTest)

Aggregations

HttpResponse (com.github.mjeanroy.junit.servers.client.HttpResponse)50 Test (org.junit.jupiter.api.Test)41 Pair (com.github.mjeanroy.junit.servers.utils.commons.Pair)25 WireMockTest (com.github.mjeanroy.junit.servers.utils.jupiter.WireMockTest)23 JettyTest (com.github.mjeanroy.junit.servers.jetty.jupiter.JettyTest)14 HttpRequest (com.github.mjeanroy.junit.servers.client.HttpRequest)7 HttpRequestBody (com.github.mjeanroy.junit.servers.client.HttpRequestBody)4 HttpUrl (com.github.mjeanroy.junit.servers.client.HttpUrl)3 AbstractHttpRequest (com.github.mjeanroy.junit.servers.client.impl.AbstractHttpRequest)3 HttpHeader (com.github.mjeanroy.junit.servers.client.HttpHeader)2 Response (com.ning.http.client.Response)2 Response (okhttp3.Response)2 Response (org.asynchttpclient.Response)2 Cookie (com.github.mjeanroy.junit.servers.client.Cookie)1 HttpParameter (com.github.mjeanroy.junit.servers.client.HttpParameter)1 WireMockTestUtils.assertRequestWithCookie (com.github.mjeanroy.junit.servers.client.it.WireMockTestUtils.assertRequestWithCookie)1 TomcatTest (com.github.mjeanroy.junit.servers.tomcat.jupiter.TomcatTest)1 AsyncHttpResponseBuilder (com.github.mjeanroy.junit.servers.utils.builders.AsyncHttpResponseBuilder)1 NingHttpResponseBuilder (com.github.mjeanroy.junit.servers.utils.builders.NingHttpResponseBuilder)1 OkHttpResponseBuilder (com.github.mjeanroy.junit.servers.utils.builders.OkHttpResponseBuilder)1