@Test
public void writesJsonValueToOutputStream() throws Exception {

    ObjectValue jsonBook = createJsonBook(createJunitBook());
    ByteArrayOutputStream out = new ByteArrayOutputStream();
    jsonEntityProvider.writeTo(jsonBook, Book.class, null, null, APPLICATION_JSON_TYPE, new MultivaluedHashMap<>(), out);
    assertEquals("{\"author\":\"Vincent Massol\",\"title\":\"JUnit in Action\",\"pages\":386,\"price\":19.37,\"isdn\":93011099534534}", out.toString());
}