@Test public void testUpdateExisting() throws Exception { long pk = RandomTestUtil.nextLong(); JournalArticleImage newJournalArticleImage = _persistence.create(pk); newJournalArticleImage.setGroupId(RandomTestUtil.nextLong()); newJournalArticleImage.setArticleId(RandomTestUtil.randomString()); newJournalArticleImage.setVersion(RandomTestUtil.nextDouble()); newJournalArticleImage.setElInstanceId(RandomTestUtil.randomString()); newJournalArticleImage.setElName(RandomTestUtil.randomString()); newJournalArticleImage.setLanguageId(RandomTestUtil.randomString()); newJournalArticleImage.setTempImage(RandomTestUtil.randomBoolean()); _journalArticleImages.add(_persistence.update(newJournalArticleImage)); JournalArticleImage existingJournalArticleImage = _persistence.findByPrimaryKey(newJournalArticleImage.getPrimaryKey()); Assert.assertEquals( existingJournalArticleImage.getArticleImageId(), newJournalArticleImage.getArticleImageId()); Assert.assertEquals( existingJournalArticleImage.getGroupId(), newJournalArticleImage.getGroupId()); Assert.assertEquals( existingJournalArticleImage.getArticleId(), newJournalArticleImage.getArticleId()); AssertUtils.assertEquals( existingJournalArticleImage.getVersion(), newJournalArticleImage.getVersion()); Assert.assertEquals( existingJournalArticleImage.getElInstanceId(), newJournalArticleImage.getElInstanceId()); Assert.assertEquals( existingJournalArticleImage.getElName(), newJournalArticleImage.getElName()); Assert.assertEquals( existingJournalArticleImage.getLanguageId(), newJournalArticleImage.getLanguageId()); Assert.assertEquals( existingJournalArticleImage.getTempImage(), newJournalArticleImage.getTempImage()); }