@Test
public void convertsCookieValueToTypeSpecifiedInParameter() throws Exception {

    when(cookieParam.value()).thenReturn("cookie1");
    when(parameter.getParameterClass()).thenReturn((Class)String.class);
    when(typeProducer.createValue(eq("cookie1"), any(MultivaluedMap.class), any())).thenAnswer(
            invocation -> ((MultivaluedMap<String, String>)invocation.getArguments()[1]).getFirst("cookie1"));
    Object resolvedValue = cookieParameterResolver.resolve(parameter, applicationContext);
    assertEquals(cookie1.getValue(), resolvedValue);
}