Assert.assertEquals(auditLogsWithHistory.get(0).getChangeType(), ChangeType.INSERT); Assert.assertEquals(history1.getAccountRecordId(), createdAccount.getRecordId()); Assert.assertEquals(history1.getTenantRecordId(), createdAccount.getTenantRecordId()); Assert.assertEquals(auditLogsWithHistory.get(0).getChangeType(), ChangeType.INSERT); Assert.assertEquals(auditLogsWithHistory.get(1).getChangeType(), ChangeType.UPDATE); Assert.assertEquals(history2.getAccountRecordId(), retrievedAccount.getRecordId()); Assert.assertEquals(history2.getTenantRecordId(), retrievedAccount.getTenantRecordId()); Assert.assertEquals(auditLogsWithHistory.get(0).getChangeType(), ChangeType.INSERT); Assert.assertEquals(auditLogsWithHistory.get(1).getChangeType(), ChangeType.UPDATE); Assert.assertEquals(auditLogsWithHistory.get(2).getChangeType(), ChangeType.UPDATE); Assert.assertEquals(history3.getAccountRecordId(), retrievedAccount2.getRecordId()); Assert.assertEquals(history3.getTenantRecordId(), retrievedAccount2.getTenantRecordId());
public AuditLogJson(final AuditLogWithHistory auditLogWithHistory) { this(auditLogWithHistory.getChangeType().toString(), auditLogWithHistory.getCreatedDate(), auditLogWithHistory.getAuditedObjectType(), auditLogWithHistory.getAuditedEntityId(), auditLogWithHistory.getUserName(), auditLogWithHistory.getReasonCode(), auditLogWithHistory.getComment(), auditLogWithHistory.getUserToken(), auditLogWithHistory.getEntity()); }
Assert.assertEquals(auditLogsWithHistory.get(0).getChangeType(), ChangeType.INSERT); Assert.assertEquals(history1.getAccountRecordId(), paymentMethodModelDao.getAccountRecordId()); Assert.assertEquals(history1.getTenantRecordId(), paymentMethodModelDao.getTenantRecordId()); Assert.assertEquals(auditLogsWithHistory.get(0).getChangeType(), ChangeType.INSERT); Assert.assertEquals(history1.getAccountRecordId(), paymentMethodModelDao.getAccountRecordId()); Assert.assertEquals(history1.getTenantRecordId(), paymentMethodModelDao.getTenantRecordId()); Assert.assertTrue(history1.isActive()); Assert.assertEquals(auditLogsWithHistory.get(1).getChangeType(), ChangeType.UPDATE); Assert.assertEquals(history2.getAccountRecordId(), paymentMethodModelDao.getAccountRecordId()); Assert.assertEquals(history2.getTenantRecordId(), paymentMethodModelDao.getTenantRecordId());
Assert.assertEquals(auditLogsWithHistory.get(0).getChangeType(), ChangeType.INSERT); Assert.assertEquals(history1.getAccountRecordId(), savedPayment.getAccountRecordId()); Assert.assertEquals(history1.getTenantRecordId(), savedPayment.getTenantRecordId()); Assert.assertEquals(auditLogsWithHistory.get(0).getChangeType(), ChangeType.INSERT); Assert.assertEquals(history1.getAccountRecordId(), savedPayment.getAccountRecordId()); Assert.assertEquals(history1.getTenantRecordId(), savedPayment.getTenantRecordId()); Assert.assertEquals(history1.getExternalKey(), savedPayment.getExternalKey()); Assert.assertEquals(auditLogsWithHistory.get(1).getChangeType(), ChangeType.UPDATE); Assert.assertEquals(history2.getAccountRecordId(), savedPayment.getAccountRecordId()); Assert.assertEquals(history2.getTenantRecordId(), savedPayment.getTenantRecordId()); history2 = (PaymentModelDao) auditLogsWithHistory.get(1).getEntity(); final PaymentModelDao history3 = (PaymentModelDao) auditLogsWithHistory.get(2).getEntity(); Assert.assertEquals(auditLogsWithHistory.get(0).getChangeType(), ChangeType.INSERT); Assert.assertEquals(history1.getAccountRecordId(), savedPayment.getAccountRecordId()); Assert.assertEquals(history1.getTenantRecordId(), savedPayment.getTenantRecordId()); Assert.assertEquals(history1.getExternalKey(), savedPayment.getExternalKey()); Assert.assertEquals(auditLogsWithHistory.get(1).getChangeType(), ChangeType.UPDATE); Assert.assertEquals(history2.getAccountRecordId(), savedPayment.getAccountRecordId()); Assert.assertEquals(history2.getTenantRecordId(), savedPayment.getTenantRecordId()); Assert.assertEquals(history2.getExternalKey(), savedPayment.getExternalKey()); Assert.assertTrue(auditLogsWithHistory.get(1).getEntity().getUpdatedDate().compareTo(auditLogsWithHistory.get(0).getEntity().getUpdatedDate()) >= 0); Assert.assertEquals(auditLogsWithHistory.get(2).getChangeType(), ChangeType.UPDATE); Assert.assertEquals(history3.getAccountRecordId(), savedPayment.getAccountRecordId()); Assert.assertEquals(history3.getTenantRecordId(), savedPayment.getTenantRecordId());