コード例 #1
0
  private void assertNews(News expected, News actual) {

    Assert.assertEquals(expected.getId(), actual.getId());
    Assert.assertEquals(expected.getCreationDate(), actual.getCreationDate());
    Assert.assertEquals(expected.getFullText(), actual.getFullText());
    Assert.assertEquals(expected.getShortText(), actual.getShortText());
    Assert.assertEquals(expected.getModificationDate(), actual.getModificationDate());
    Assert.assertEquals(expected.getTitle(), actual.getTitle());
  }
コード例 #2
0
  @Test
  @DatabaseSetup(PATH_TO_NEWS)
  public void testSave() throws Exception {

    Long id = newsDAO.add(expectedNews);

    News actual = newsDAO.fetchById(id);

    Assert.assertEquals(expectedNews.getCreationDate(), actual.getCreationDate());
    Assert.assertEquals(expectedNews.getFullText(), actual.getFullText());
    Assert.assertEquals(expectedNews.getShortText(), actual.getShortText());
    Assert.assertEquals(expectedNews.getModificationDate(), actual.getModificationDate());
    Assert.assertEquals(expectedNews.getTitle(), actual.getTitle());
  }