@Test
public void shouldExtractRightCookie() {

    GetCookieFromRequestRule rule = new GetCookieFromRequestRule();
    FullHttpRequest request = mock(FullHttpRequest.class);
    HttpHeaders headers = mock(HttpHeaders.class);
    when(request.headers()).thenReturn(headers);
    when(headers.get(eq("Cookie"))).thenReturn("key1=val1;key2=val2");
    assertEquals("val2", rule.resolve(request, "key2"));
}