_test(app, "bar: bar", "POST", new StringWrapperBar("bar"), APPLICATION_BAR, APPLICATION_BAR);
}
private void _test(ApplicationHandler app, String expected, String method, Object entity, String mediaType, String... accept)
throws ExecutionException, InterruptedException {
RequestContextBuilder requestContextBuilder = RequestContextBuilder.from("/", method);
if (entity != null) {
requestContextBuilder.entity(entity).type(mediaType);
}
ContainerRequest requestContext = requestContextBuilder.accept(accept).build();
ByteArrayOutputStream baos = new ByteArrayOutputStream();
app.apply(requestContext, baos);
assertEquals(expected, baos.toString());
}