@Test public void testUpdateExisting() throws Exception { long pk = RandomTestUtil.nextLong(); MDRRuleGroup newMDRRuleGroup = _persistence.create(pk); newMDRRuleGroup.setUuid(RandomTestUtil.randomString()); newMDRRuleGroup.setGroupId(RandomTestUtil.nextLong()); newMDRRuleGroup.setCompanyId(RandomTestUtil.nextLong()); newMDRRuleGroup.setUserId(RandomTestUtil.nextLong()); newMDRRuleGroup.setUserName(RandomTestUtil.randomString()); newMDRRuleGroup.setCreateDate(RandomTestUtil.nextDate()); newMDRRuleGroup.setModifiedDate(RandomTestUtil.nextDate()); newMDRRuleGroup.setName(RandomTestUtil.randomString()); newMDRRuleGroup.setDescription(RandomTestUtil.randomString()); _persistence.update(newMDRRuleGroup); MDRRuleGroup existingMDRRuleGroup = _persistence.findByPrimaryKey(newMDRRuleGroup.getPrimaryKey()); Assert.assertEquals(existingMDRRuleGroup.getUuid(), newMDRRuleGroup.getUuid()); Assert.assertEquals(existingMDRRuleGroup.getRuleGroupId(), newMDRRuleGroup.getRuleGroupId()); Assert.assertEquals(existingMDRRuleGroup.getGroupId(), newMDRRuleGroup.getGroupId()); Assert.assertEquals(existingMDRRuleGroup.getCompanyId(), newMDRRuleGroup.getCompanyId()); Assert.assertEquals(existingMDRRuleGroup.getUserId(), newMDRRuleGroup.getUserId()); Assert.assertEquals(existingMDRRuleGroup.getUserName(), newMDRRuleGroup.getUserName()); Assert.assertEquals( Time.getShortTimestamp(existingMDRRuleGroup.getCreateDate()), Time.getShortTimestamp(newMDRRuleGroup.getCreateDate())); Assert.assertEquals( Time.getShortTimestamp(existingMDRRuleGroup.getModifiedDate()), Time.getShortTimestamp(newMDRRuleGroup.getModifiedDate())); Assert.assertEquals(existingMDRRuleGroup.getName(), newMDRRuleGroup.getName()); Assert.assertEquals(existingMDRRuleGroup.getDescription(), newMDRRuleGroup.getDescription()); }