LogEntryDAOMysqlImpl extends AbstractTableCreatingDAOImpl implements LogEntryDAO { public List<Integer> getRunningTenants() { return getRunningTenants.execute(); } protected  LogEntryDAOMysqlImpl(DataSource dataSource, SqlScriptService sqlScriptService,
                                   PluginRegistry pluginRegistry); @Override String getDefaultTableName(); @Override String getTableCreatingSQLScriptName(); void startEntry(LogEntry entry); void endEntry(LogEntry entry); void endAllEntries(Date endDate); void endAllEntries(); void deleteEntry(LogEntry entry); List<Integer> getRunningTenants(); List<LogEntry> getLogEntries(int offset, int limit); List<LogEntry> getLogEntriesForTenant(int tenantId, int offset, int limit); List<LogEntry> getLogEntries(int assocTypeId, int offset, int limit); List<LogEntry> getLogEntriesForTenant(int tenantId, int assocTypeId, int offset, int limit); int getNumberOfLogEntries(); int getNumberOfLogEntriesForTenant(int tenantId); void deleteLogEntries(); int getComputationDurationForDate(Date date); int getComputationDurationForDate();  }
@Test @DataSet("/dbunit/pluginContainer/plugin_log+1new_started.xml") public void getRunningTenants_shouldReturnAllRunningTenants() { List<Integer> runningTenants = logEntryDAO.getRunningTenants(); assertThat(runningTenants, is(not(nullValue()))); assertThat(runningTenants.size(), is(2)); assertThat(runningTenants, hasItem(1)); assertThat(runningTenants, hasItem(2)); }
@Test @DataSet("/dbunit/pluginContainer/plugin_log+all_ended.xml") public void getRunningTenants_shouldReturnEmptyListIfNoRunningTenants() { List<Integer> runningTenants = logEntryDAO.getRunningTenants(); assertThat(runningTenants, is(not(nullValue()))); assertThat(runningTenants.size(), is(0)); }