private void verifyAuditLogsForTag(final List<AuditLog> auditLogs, final AuditLevel level) { if (AuditLevel.NONE.equals(level)) { Assert.assertEquals(auditLogs.size(), 0); return; } Assert.assertEquals(auditLogs.size(), 1); Assert.assertEquals(auditLogs.get(0).getUserToken(), internalCallContext.getUserToken().toString()); Assert.assertEquals(auditLogs.get(0).getChangeType(), ChangeType.INSERT); Assert.assertEquals(auditLogs.get(0).getComment(), internalCallContext.getComments()); Assert.assertEquals(auditLogs.get(0).getReasonCode(), internalCallContext.getReasonCode()); Assert.assertEquals(auditLogs.get(0).getUserName(), internalCallContext.getCreatedBy()); Assert.assertNotNull(auditLogs.get(0).getCreatedDate()); } }
public InternalCallContext createInternalCallContext(final Long tenantRecordId, final Long accountRecordId, final InternalCallContext context) { return new InternalCallContext(tenantRecordId, accountRecordId, context.getUserToken(), context.getCreatedBy(), context.getCallOrigin(), context.getContextUserType(), context.getReasonCode(), context.getComments(), context.getCreatedDate(), context.getUpdatedDate()); }
private void verifyInternalCallContext(final InternalCallContext context) { Assert.assertEquals(context.getCallOrigin(), callContext.getCallOrigin()); Assert.assertEquals(context.getComments(), callContext.getComments()); Assert.assertEquals(context.getCreatedDate(), callContext.getCreatedDate()); Assert.assertEquals(context.getReasonCode(), callContext.getReasonCode()); Assert.assertEquals(context.getUpdatedDate(), callContext.getUpdatedDate()); Assert.assertEquals(context.getCreatedBy(), callContext.getUserName()); Assert.assertEquals(context.getUserToken(), callContext.getUserToken()); Assert.assertEquals(context.getContextUserType(), callContext.getUserType()); // Our test callcontext doesn't have a tenant id Assert.assertEquals(context.getTenantRecordId(), (Long) InternalCallContextFactory.INTERNAL_TENANT_RECORD_ID); } }
public InternalCallContext createInternalCallContext(final Long accountRecordId, final InternalCallContext context) { return new InternalCallContext(context.getTenantRecordId(), accountRecordId, context.getUserToken(), context.getCreatedBy(), context.getCallOrigin(), context.getContextUserType(), context.getReasonCode(), context.getComments(), context.getCreatedDate(), context.getUpdatedDate()); }
q.bind("comments", callContext.getComments()); q.bind("userToken", (callContext.getUserToken() != null) ? callContext.getUserToken().toString() : null);