mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-12-27 19:47:49 +01:00
Fixed TPS Storage test
This commit is contained in:
parent
4085ae310a
commit
e26a272e60
@ -21,7 +21,6 @@ import com.djrapitops.plan.gathering.domain.TPS;
|
||||
import com.djrapitops.plan.gathering.domain.builders.TPSBuilder;
|
||||
import com.djrapitops.plan.storage.database.queries.Query;
|
||||
import com.djrapitops.plan.storage.database.queries.QueryStatement;
|
||||
import com.djrapitops.plan.storage.database.sql.building.Select;
|
||||
import com.djrapitops.plan.storage.database.sql.tables.ServerTable;
|
||||
import com.djrapitops.plan.utilities.java.Lists;
|
||||
|
||||
@ -129,10 +128,11 @@ public class TPSQueries {
|
||||
}
|
||||
|
||||
public static Query<List<TPS>> fetchTPSDataOfServer(long after, long before, UUID serverUUID) {
|
||||
String sql = Select.all(TABLE_NAME)
|
||||
.where(SERVER_ID + "=" + ServerTable.STATEMENT_SELECT_SERVER_ID)
|
||||
.and(DATE + ">=?").and(DATE + "<=?")
|
||||
.toString();
|
||||
String sql = SELECT + "*" + FROM + TABLE_NAME +
|
||||
WHERE + SERVER_ID + "=" + ServerTable.STATEMENT_SELECT_SERVER_ID +
|
||||
AND + DATE + ">=?" +
|
||||
AND + DATE + "<=?" +
|
||||
ORDER_BY + DATE;
|
||||
|
||||
return new QueryStatement<List<TPS>>(sql, 50000) {
|
||||
@Override
|
||||
|
@ -22,6 +22,7 @@ import com.djrapitops.plan.storage.database.DatabaseTestPreparer;
|
||||
import com.djrapitops.plan.storage.database.queries.objects.TPSQueries;
|
||||
import com.djrapitops.plan.storage.database.transactions.commands.RemoveEverythingTransaction;
|
||||
import com.djrapitops.plan.storage.database.transactions.events.TPSStoreTransaction;
|
||||
import com.djrapitops.plan.utilities.comparators.TPSComparator;
|
||||
import com.djrapitops.plan.utilities.java.Lists;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import utilities.RandomData;
|
||||
@ -44,6 +45,7 @@ public interface TPSQueriesTest extends DatabaseTestPreparer {
|
||||
|
||||
forcePersistenceCheck();
|
||||
|
||||
expected.sort(new TPSComparator());
|
||||
assertEquals(expected, db().query(TPSQueries.fetchTPSDataOfServer(Long.MIN_VALUE, Long.MAX_VALUE, serverUUID())));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user