Tabnine Logo
AuditLog.getUserToken
Code IndexAdd Tabnine to your IDE (free)

How to use
getUserToken
method
in
org.killbill.billing.util.audit.AuditLog

Best Java code snippets using org.killbill.billing.util.audit.AuditLog.getUserToken (Showing top 8 results out of 315)

origin: killbill/killbill

  protected AuditLog createAuditLog() {
    final AuditLog auditLog = Mockito.mock(AuditLog.class);
    final DateTime utcNow = clock.getUTCNow();
    Mockito.when(auditLog.getCreatedDate()).thenReturn(utcNow);
    Mockito.when(auditLog.getReasonCode()).thenReturn(UUID.randomUUID().toString());
    Mockito.when(auditLog.getUserName()).thenReturn(UUID.randomUUID().toString());
    Mockito.when(auditLog.getUserToken()).thenReturn(UUID.randomUUID().toString());
    Mockito.when(auditLog.getComment()).thenReturn(UUID.randomUUID().toString());
    Mockito.when(auditLog.getChangeType()).thenReturn(ChangeType.DELETE);

    return auditLog;
  }
}
origin: killbill/killbill

  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());
  }
}
origin: killbill/killbill

@Test(groups = "fast")
public void testGetters() 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 accountId = UUID.randomUUID();
  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 DefaultCallContext callContext = new DefaultCallContext(accountId, tenantId, userName, callOrigin, userType, userToken, clock);
  final AuditLog auditLog = new DefaultAuditLog(new AuditLogModelDao(entityAudit, callContext), ObjectType.ACCOUNT_EMAIL, UUID.randomUUID());
  Assert.assertEquals(auditLog.getChangeType(), changeType);
  Assert.assertNull(auditLog.getComment());
  Assert.assertNotNull(auditLog.getCreatedDate());
  Assert.assertNull(auditLog.getReasonCode());
  Assert.assertEquals(auditLog.getUserName(), userName);
  Assert.assertEquals(auditLog.getUserToken(), userToken.toString());
}
origin: org.kill-bill.billing/killbill-util

  protected AuditLog createAuditLog() {
    final AuditLog auditLog = Mockito.mock(AuditLog.class);
    final DateTime utcNow = clock.getUTCNow();
    Mockito.when(auditLog.getCreatedDate()).thenReturn(utcNow);
    Mockito.when(auditLog.getReasonCode()).thenReturn(UUID.randomUUID().toString());
    Mockito.when(auditLog.getUserName()).thenReturn(UUID.randomUUID().toString());
    Mockito.when(auditLog.getUserToken()).thenReturn(UUID.randomUUID().toString());
    Mockito.when(auditLog.getComment()).thenReturn(UUID.randomUUID().toString());
    Mockito.when(auditLog.getChangeType()).thenReturn(ChangeType.DELETE);

    return auditLog;
  }
}
origin: org.kill-bill.billing/killbill-util

  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());
  }
}
origin: org.kill-bill.billing/killbill-util

@Test(groups = "fast")
public void testGetters() 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 accountId = UUID.randomUUID();
  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 DefaultCallContext callContext = new DefaultCallContext(accountId, tenantId, userName, callOrigin, userType, userToken, clock);
  final AuditLog auditLog = new DefaultAuditLog(new AuditLogModelDao(entityAudit, callContext), ObjectType.ACCOUNT_EMAIL, UUID.randomUUID());
  Assert.assertEquals(auditLog.getChangeType(), changeType);
  Assert.assertNull(auditLog.getComment());
  Assert.assertNotNull(auditLog.getCreatedDate());
  Assert.assertNull(auditLog.getReasonCode());
  Assert.assertEquals(auditLog.getUserName(), userName);
  Assert.assertEquals(auditLog.getUserToken(), userToken.toString());
}
origin: org.kill-bill.billing/killbill-beatrix

private <T extends EntitySqlDao<M, E>, M extends EntityModelDao<E>, E extends Entity> void checkAuditLog(final ChangeType changeType, @Nullable final CallContext context, final AuditLog auditLog, final UUID entityId, Class<T> sqlDao,
                                                     boolean useHistory, boolean checkContext) {
  Assert.assertEquals(auditLog.getChangeType(), changeType);
  if (checkContext) {
    Assert.assertEquals(auditLog.getUserName(), context.getUserName());
    Assert.assertEquals(auditLog.getComment(), context.getComments());
    //Assert.assertEquals(auditLog.getCreatedDate().comparesTo(callcontext.getCreatedDate()));
    // We can't take userToken oustide of the 'if' because for instance NextBillingDate invoice will not have it.
    Assert.assertEquals(auditLog.getUserToken(), context.getUserToken().toString());
  }
  final M entityModel = extractEntityModelFromEntityWithTargetRecordId(entityId, auditLog.getId(), sqlDao, context, useHistory);
  Assert.assertEquals(entityModel.getId(), entityId);
}
origin: org.kill-bill.billing/killbill-jaxrs

public AuditLogJson(final AuditLog auditLog) {
  this(auditLog.getChangeType().toString(), auditLog.getCreatedDate(), auditLog.getAuditedObjectType(), auditLog.getAuditedEntityId(), auditLog.getUserName(), auditLog.getReasonCode(),
     auditLog.getComment(), auditLog.getUserToken(), null);
}
org.killbill.billing.util.auditAuditLoggetUserToken

Javadoc

Get the user token of this change requestor

Popular methods of AuditLog

  • getChangeType
    Get the type of change for this log entry
  • getComment
    Get the comment for this change
  • getUserName
    Get the name of the requestor
  • getAuditedEntityId
    Get the original Entity id for this log entry
  • getAuditedObjectType
    Get the original Entity object type for this log entry
  • getCreatedDate
    Get the time when this change was effective
  • getReasonCode
    Get the reason code for this change
  • getId

Popular in Java

  • Parsing JSON documents to java classes using gson
  • findViewById (Activity)
  • getContentResolver (Context)
  • scheduleAtFixedRate (Timer)
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • Menu (java.awt)
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
  • Collectors (java.util.stream)
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now