@Test(expected = RepositoryException.class) public void testGetEntryThrowsException() { when(accessor.getAuditLogEntryList(entry.getApplicationName().toString())) .thenThrow(new RuntimeException("testException")); List<AuditLogEntry> result = repository.getAuditLogEntryList(entry.getApplicationName()); }
@Override public List<AuditLogEntry> getAuditLogEntryList( Application.Name applicationName) { LOGGER.debug("Getting audit log entries for {}", applicationName); try { Result<AuditLog> result = accessor .getAuditLogEntryList(applicationName.toString()); return makeAuditLogEntries(result.all()); } catch (Exception e) { LOGGER.error("Error while getting complete audit log entries list", e); throw new RepositoryException( "Unable to receive complete audit log entry list"); } }
CassandraAuditLogRepository implements AuditLogRepository { @Override public List<AuditLogEntry> getAuditLogEntryList( Application.Name applicationName) { LOGGER.debug("Getting audit log entries for {}", applicationName); try { Result<AuditLog> result = accessor .getAuditLogEntryList(applicationName.toString()); return makeAuditLogEntries(result.all()); } catch (Exception e) { LOGGER.error("Error while getting complete audit log entries list", e); throw new RepositoryException( "Unable to receive complete audit log entry list"); } } }
CassandraAuditLogRepository implements AuditLogRepository { @Override public List<AuditLogEntry> getAuditLogEntryList( Application.Name applicationName) { LOGGER.debug("Getting audit log entries for {}", applicationName); try { Result<AuditLog> result = accessor .getAuditLogEntryList(applicationName.toString()); return makeAuditLogEntries(result.all()); } catch (Exception e) { LOGGER.error("Error while getting complete audit log entries list", e); throw new RepositoryException( "Unable to receive complete audit log entry list"); } } @Inject  CassandraAuditLogRepository(AuditLogAccessor accessor); }
CassandraAuditLogRepository implements AuditLogRepository { @Override public List<AuditLogEntry> getAuditLogEntryList( Application.Name applicationName) { LOGGER.debug("Getting audit log entries for {}", applicationName); try { Result<AuditLog> result = accessor .getAuditLogEntryList(applicationName.toString()); return makeAuditLogEntries(result.all()); } catch (Exception e) { LOGGER.error("Error while getting complete audit log entries list", e); throw new RepositoryException( "Unable to receive complete audit log entry list"); } } @Inject  CassandraAuditLogRepository(AuditLogAccessor accessor); @Override List<AuditLogEntry> getCompleteAuditLogEntryList(); @Override List<AuditLogEntry> getCompleteAuditLogEntryList(int limit); @Override List<AuditLogEntry> getAuditLogEntryList(
            Application.Name applicationName); @Override List<AuditLogEntry> getAuditLogEntryList(
            Application.Name applicationName, int limit); @Override List<AuditLogEntry> getGlobalAuditLogEntryList(); @Override List<AuditLogEntry> getGlobalAuditLogEntryList(int limit); @Override boolean storeEntry(AuditLogEntry entry); }
CassandraAuditLogRepository implements AuditLogRepository { @Override public List<AuditLogEntry> getAuditLogEntryList( Application.Name applicationName) { LOGGER.debug("Getting audit log entries for {}", applicationName); try { Result<AuditLog> result = accessor .getAuditLogEntryList(applicationName.toString()); return makeAuditLogEntries(result.all()); } catch (Exception e) { LOGGER.error("Error while getting complete audit log entries list", e); throw new RepositoryException( "Unable to receive complete audit log entry list"); } } @Inject  CassandraAuditLogRepository(AuditLogAccessor accessor); @Override List<AuditLogEntry> getCompleteAuditLogEntryList(); @Override List<AuditLogEntry> getCompleteAuditLogEntryList(int limit); @Override List<AuditLogEntry> getAuditLogEntryList(
            Application.Name applicationName); @Override List<AuditLogEntry> getAuditLogEntryList(
            Application.Name applicationName, int limit); @Override List<AuditLogEntry> getGlobalAuditLogEntryList(); @Override List<AuditLogEntry> getGlobalAuditLogEntryList(int limit); @Override boolean storeEntry(AuditLogEntry entry);  }