@Test public void jaxbCommentTest() throws Exception { Assume.assumeFalse(getType().equals(TestType.YAML)); CommentImpl comment = new CommentImpl(); comment.setAddedAt(new Date()); comment.setAddedBy(new UserImpl("user")); comment.setId(23l); comment.setText("ILLUMINATI!"); JaxbComment jaxbComment = new JaxbComment(comment); assertEquals("added at", comment.getAddedAt(), jaxbComment.getAddedAt()); assertEquals("added by", comment.getAddedBy().getId(), jaxbComment.getAddedById()); assertEquals("added by", comment.getAddedBy().getId(), jaxbComment.getAddedBy().getId()); assertEquals("id", comment.getId(), jaxbComment.getId()); assertEquals("text", comment.getText(), jaxbComment.getText()); JaxbComment copyJaxbComment = testRoundTrip(jaxbComment); Assertions.assertThat(jaxbComment).isEqualToComparingFieldByFieldRecursively(copyJaxbComment); }