public void testWriteJAXBObject() throws Exception
{
MessageBodyWriter writer = providers.getMessageBodyWriter(Book.class, null, null, mediaType);
assertNotNull(writer);
assertTrue(writer.isWriteable(Book.class, Book.class, null, mediaType));
Book book = new Book();
book.setAuthor("William Shakespeare");
book.setTitle("Hamlet");
book.setPrice(createPrice("EUR", 15.15F));
book.setMemberPrice(createMemberPrice("EUR", 14.73F));
book.setSendByPost(true);
writer.writeTo(book, Book.class, Book.class, null, mediaType, null, new ByteArrayOutputStream());
}