QueryExceptionMapper.class,
CookieExceptionMapper.class,
HeaderExceptionMapper.class,
FormExceptionMapper.class);
ContainerResponse responseContext = getResponseContext(UriBuilder.fromPath("/").path("path/ 123").build().toString());
assertEquals("path", responseContext.getEntity());
responseContext = getResponseContext(UriBuilder.fromPath("/").path("matrix;x= 123").build().toString());
assertEquals("matrix", responseContext.getEntity());
responseContext = getResponseContext(UriBuilder.fromPath("/").path("query").queryParam("x", " 123").build().toString());
assertEquals("query", responseContext.getEntity());
responseContext = getResponseContext(UriBuilder.fromPath("/").path("cookie").build().toString(), new Cookie("x", " 123"));
assertEquals("cookie", responseContext.getEntity());
responseContext = apply(
RequestContextBuilder.from("/header", "GET").
header("x", " 123").
build()
);
assertEquals("header", responseContext.getEntity());
Form f = new Form();
f.param("x", " 123");
responseContext = apply(
RequestContextBuilder.from("/form", "POST").
type(MediaType.APPLICATION_FORM_URLENCODED_TYPE).
entity(f).
build()
);
assertEquals("form", responseContext.getEntity());
}