@Test public void testProcessAuthException() { AuditEntry.Builder entryBuilder = AuditEntry.newBuilder().permissions(PERMISSIONS).resource(ConnectionResource.root()); when(mockAuditEntryBuilderFactory.createAuthenticationEntryBuilder()).thenReturn(entryBuilder); doThrow(new ReadTimeoutException(ConsistencyLevel.QUORUM, 3, 4, true)).when(mockAuditor).audit(any(AuditEntry.class)); assertThatExceptionOfType(AuthenticationException.class) .isThrownBy(() -> auditAdapter.auditAuth(USER, Status.ATTEMPT, TIMESTAMP)); }
public void auditAuth(String username, Status status, long timestamp) throws AuthenticationException { auditAuth(username, null, status, timestamp); }
AuditAdapter { public void auditAuth(String username, Status status, long timestamp) throws AuthenticationException { auditAuth(username, null, status, timestamp); } }
AuditAdapter { public void auditAuth(String username, Status status, long timestamp) throws AuthenticationException { auditAuth(username, null, status, timestamp); } AuditAdapter(Auditor auditor, AuditEntryBuilderFactory entryBuilderFactory, BoundValueSuppressor boundValueSuppressor); }
AuditAdapter { public void auditAuth(String username, Status status, long timestamp) throws AuthenticationException { auditAuth(username, null, status, timestamp); } AuditAdapter(Auditor auditor, AuditEntryBuilderFactory entryBuilderFactory, BoundValueSuppressor boundValueSuppressor); static AuditAdapter getInstance(); void setup(); void auditRegular(String operation, ClientState state, Status status, long timestamp); void auditPrepared(MD5Digest id, CQLStatement statement, ClientState state, QueryOptions options, Status status, long timestamp); void auditBatch(BatchStatement statement, UUID uuid, ClientState state, BatchQueryOptions options, Status status, long timestamp); void auditAuth(String username, Status status, long timestamp); void auditAuth(String userName, String subject, Status status, long timestamp); void mapIdToQuery(MD5Digest id, String query); Auditor getAuditor(); @VisibleForTesting void setBoundValueSuppressor(BoundValueSuppressor suppressor); @VisibleForTesting BoundValueSuppressor getBoundValueSuppressor(); }
AuditAdapter { public void auditAuth(String username, Status status, long timestamp) throws AuthenticationException { auditAuth(username, null, status, timestamp); } AuditAdapter(Auditor auditor, AuditEntryBuilderFactory entryBuilderFactory, BoundValueSuppressor boundValueSuppressor); static AuditAdapter getInstance(); void setup(); void auditRegular(String operation, ClientState state, Status status, long timestamp); void auditPrepared(MD5Digest id, CQLStatement statement, ClientState state, QueryOptions options, Status status, long timestamp); void auditBatch(BatchStatement statement, UUID uuid, ClientState state, BatchQueryOptions options, Status status, long timestamp); void auditAuth(String username, Status status, long timestamp); void auditAuth(String userName, String subject, Status status, long timestamp); void mapIdToQuery(MD5Digest id, String query); Auditor getAuditor(); @VisibleForTesting void setBoundValueSuppressor(BoundValueSuppressor suppressor); @VisibleForTesting BoundValueSuppressor getBoundValueSuppressor();  }