Search in sources :

Example 6 with Cookie

use of com.github.mjeanroy.junit.servers.client.Cookie in project junit-servers by mjeanroy.

the class AbstractHttpResponseImplTest method it_get_given_cookie_and_return_null_without_cookie.

@Test
void it_get_given_cookie_and_return_null_without_cookie() {
    final V response = createHttpResponseWithHeaders(givenCookieHeader());
    final Cookie cookie = response.getCookie("fake_cookie");
    assertThat(cookie).isNull();
}
Also used : Cookie(com.github.mjeanroy.junit.servers.client.Cookie) Test(org.junit.jupiter.api.Test)

Example 7 with Cookie

use of com.github.mjeanroy.junit.servers.client.Cookie in project junit-servers by mjeanroy.

the class AbstractHttpResponseImplTest method it_get_given_cookie.

@Test
void it_get_given_cookie() {
    final V response = createHttpResponseWithHeaders(givenCookieHeader());
    final Cookie cookie = response.getCookie("ABT_force_signin_anonymous");
    assertThat(cookie).isNotNull();
    assertThat(cookie.getName()).isEqualTo("ABT_force_signin_anonymous");
    assertThat(cookie.getValue()).isEqualTo("ON");
    assertThat(cookie.getMaxAge()).isEqualTo(15552000L);
    assertThat(cookie.getPath()).isEqualTo("/");
    assertThat(cookie.getDomain()).isNull();
}
Also used : Cookie(com.github.mjeanroy.junit.servers.client.Cookie) Test(org.junit.jupiter.api.Test)

Aggregations

Cookie (com.github.mjeanroy.junit.servers.client.Cookie)7 Test (org.junit.jupiter.api.Test)4 HttpHeader (com.github.mjeanroy.junit.servers.client.HttpHeader)3 HttpRequest (com.github.mjeanroy.junit.servers.client.HttpRequest)1 HttpResponse (com.github.mjeanroy.junit.servers.client.HttpResponse)1 HttpUrl (com.github.mjeanroy.junit.servers.client.HttpUrl)1 WireMockTestUtils.assertRequestWithCookie (com.github.mjeanroy.junit.servers.client.it.WireMockTestUtils.assertRequestWithCookie)1 Pair (com.github.mjeanroy.junit.servers.utils.commons.Pair)1 WireMockTest (com.github.mjeanroy.junit.servers.utils.jupiter.WireMockTest)1 ArrayList (java.util.ArrayList)1