use of org.killbill.billing.util.dao.TableName in project killbill by killbill.
the class TestDefaultAuditLog method testEquals.
@Test(groups = "fast")
public void testEquals() throws Exception {
final TableName tableName = TableName.ACCOUNT_EMAIL_HISTORY;
final long recordId = Long.MAX_VALUE;
final ChangeType changeType = ChangeType.DELETE;
final EntityAudit entityAudit = new EntityAudit(tableName, recordId, changeType, null);
final UUID tenantId = UUID.randomUUID();
final String userName = UUID.randomUUID().toString();
final CallOrigin callOrigin = CallOrigin.EXTERNAL;
final UserType userType = UserType.CUSTOMER;
final UUID userToken = UUID.randomUUID();
final ClockMock clock = new ClockMock();
final CallContext callContext = new DefaultCallContext(tenantId, userName, callOrigin, userType, userToken, clock);
final AuditLogModelDao auditLog = new AuditLogModelDao(entityAudit, callContext);
Assert.assertEquals(auditLog, auditLog);
final AuditLogModelDao sameAuditLog = new AuditLogModelDao(entityAudit, callContext);
Assert.assertEquals(sameAuditLog, auditLog);
clock.addMonths(1);
final CallContext otherCallContext = new DefaultCallContext(tenantId, userName, callOrigin, userType, userToken, clock);
final AuditLogModelDao otherAuditLog = new AuditLogModelDao(entityAudit, otherCallContext);
Assert.assertNotEquals(otherAuditLog, auditLog);
}
use of org.killbill.billing.util.dao.TableName in project killbill by killbill.
the class TestDefaultAuditUserApi method beforeClass.
@Override
@BeforeClass(groups = "fast")
public void beforeClass() throws Exception {
super.beforeClass();
auditLogs = ImmutableList.<AuditLog>of(createAuditLog(), createAuditLog(), createAuditLog(), createAuditLog());
objectIds = ImmutableList.<UUID>of(UUID.randomUUID(), UUID.randomUUID(), UUID.randomUUID(), UUID.randomUUID());
for (final TableName tableName : TableName.values()) {
for (final UUID objectId : objectIds) {
for (final AuditLog auditLog : auditLogs) {
((MockAuditDao) auditDao).addAuditLogForId(tableName, objectId, auditLog);
}
}
}
}
Aggregations