From 4ff86347b06f5f686c0da566a3347ce1b76e8265 Mon Sep 17 00:00:00 2001 From: Rsl1122 Date: Fri, 19 Jul 2019 13:03:01 +0300 Subject: [PATCH] Fixed an ActivityIndex query --- .../access/queries/analysis/ActivityIndexQueries.java | 8 ++++---- .../test/java/com/djrapitops/plan/db/DatabaseTest.java | 10 ++++++++++ 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/Plan/common/src/main/java/com/djrapitops/plan/db/access/queries/analysis/ActivityIndexQueries.java b/Plan/common/src/main/java/com/djrapitops/plan/db/access/queries/analysis/ActivityIndexQueries.java index f41e296c3..1170fd0b1 100644 --- a/Plan/common/src/main/java/com/djrapitops/plan/db/access/queries/analysis/ActivityIndexQueries.java +++ b/Plan/common/src/main/java/com/djrapitops/plan/db/access/queries/analysis/ActivityIndexQueries.java @@ -202,10 +202,10 @@ public class ActivityIndexQueries { public void prepare(PreparedStatement statement) throws SQLException { setSelectActivityIndexSQLParameters(statement, 1, threshold, serverUUID, end); setSelectActivityIndexSQLParameters(statement, 12, threshold, serverUUID, start); - statement.setDouble(22, ActivityIndex.REGULAR); - statement.setDouble(23, 5.1); - statement.setDouble(24, -0.1); - statement.setDouble(25, ActivityIndex.IRREGULAR); + statement.setDouble(23, ActivityIndex.REGULAR); + statement.setDouble(24, 5.1); + statement.setDouble(25, -0.1); + statement.setDouble(26, ActivityIndex.IRREGULAR); } @Override diff --git a/Plan/common/src/test/java/com/djrapitops/plan/db/DatabaseTest.java b/Plan/common/src/test/java/com/djrapitops/plan/db/DatabaseTest.java index 0f0d70cc5..81950ab01 100644 --- a/Plan/common/src/test/java/com/djrapitops/plan/db/DatabaseTest.java +++ b/Plan/common/src/test/java/com/djrapitops/plan/db/DatabaseTest.java @@ -33,6 +33,7 @@ import com.djrapitops.plan.data.time.WorldTimes; import com.djrapitops.plan.db.access.Executable; import com.djrapitops.plan.db.access.Query; import com.djrapitops.plan.db.access.queries.*; +import com.djrapitops.plan.db.access.queries.analysis.ActivityIndexQueries; import com.djrapitops.plan.db.access.queries.containers.AllPlayerContainersQuery; import com.djrapitops.plan.db.access.queries.containers.ContainerFetchQueries; import com.djrapitops.plan.db.access.queries.containers.ServerPlayerContainersQuery; @@ -1392,6 +1393,15 @@ public interface DatabaseTest { assertEquals(expected.parseHtml(), table.getHtmlTable().parseHtml()); } + @Test + public void activeTunredInactiveQueryHasAllParametersSet() { + Integer result = db.query(ActivityIndexQueries.countRegularPlayersTurnedInactive( + 0, System.currentTimeMillis(), serverUUID, + TimeUnit.HOURS.toMillis(2L) + )); + assertNotNull(result); + } + @PluginInfo(name = "ConditionalExtension") class ConditionalExtension implements DataExtension {