@Test public void testAduditUpdateObject() throws Exception { ParameterGroup parameterGroup = parameterGroupDao.findOne(24L); ParameterGroup oldParameterGroup = AuditUtil.getStateObject(parameterGroup); parameterGroup.setParamGroup("TEST_AUDIT_edit"); parameterGroup.setDescription("Audit Desc_edit"); parameterGroupDao.merge(parameterGroup); parameterGroupDao.flush(); // Send oldObject and newObject for compare auditService.callAuditing(oldParameterGroup, parameterGroup, "TEST_USER2"); }
@Transactional @Test public void testAuditPLUpdateObject() throws SQLException { ParameterGroup parameterGroup = parameterGroupDao.findOne(25L); parameterGroup.setParamGroup("TEST_AUDIT_PL_edit3"); parameterGroup.setDescription("Audit Desc_PL_edit4"); Long auditId = auditDetailDao.getNextSequence(); auditDetailDao.beforeUpdateAuditDetailByPL( auditService.getTableName(parameterGroup), parameterGroup.getParamGroupId().toString()); parameterGroupDao.merge(parameterGroup); parameterGroupDao.flush(); auditDetailDao.afterUpdateAuditDetailByPL( auditService.getTableName(parameterGroup), parameterGroup.getParamGroupId().toString(), auditId, "TEST_PL2"); }