Search in sources :

Example 1 with NewCookie

use of net.codestory.http.NewCookie in project datashare by ICIJ.

the class ApiKeyFilterTest method test_does_nothing_if_there_is_datashare_cookie.

@Test
public void test_does_nothing_if_there_is_datashare_cookie() throws Exception {
    when(context.cookies()).thenReturn(new SimpleCookies() {

        {
            put("_ds_session_id", new NewCookie("_ds_session_id", "cookie value"));
        }
    });
    Payload payload = apiKeyFilter.apply("url", context, nextFilter);
    assertThat(payload).isSameAs(next);
}
Also used : Payload(net.codestory.http.payload.Payload) NewCookie(net.codestory.http.NewCookie) Test(org.junit.Test)

Aggregations

NewCookie (net.codestory.http.NewCookie)1 Payload (net.codestory.http.payload.Payload)1 Test (org.junit.Test)1