diff --git a/extensions-contrib/kubernetes-overlord-extensions/src/test/java/org/apache/druid/k8s/overlord/KubernetesTaskRunnerFactoryTest.java b/extensions-contrib/kubernetes-overlord-extensions/src/test/java/org/apache/druid/k8s/overlord/KubernetesTaskRunnerFactoryTest.java index a3a25ce112e6..68f6ba40eed5 100644 --- a/extensions-contrib/kubernetes-overlord-extensions/src/test/java/org/apache/druid/k8s/overlord/KubernetesTaskRunnerFactoryTest.java +++ b/extensions-contrib/kubernetes-overlord-extensions/src/test/java/org/apache/druid/k8s/overlord/KubernetesTaskRunnerFactoryTest.java @@ -20,16 +20,10 @@ package org.apache.druid.k8s.overlord; import com.fasterxml.jackson.databind.ObjectMapper; -import com.google.common.base.Supplier; import org.apache.druid.indexing.common.TestUtils; -import org.apache.druid.indexing.common.config.TaskConfig; -import org.apache.druid.indexing.common.config.TaskConfigBuilder; import org.apache.druid.java.util.emitter.service.ServiceEmitter; import org.apache.druid.k8s.overlord.common.DruidKubernetesClient; -import org.apache.druid.k8s.overlord.execution.KubernetesTaskRunnerDynamicConfig; import org.apache.druid.k8s.overlord.taskadapter.TaskAdapter; -import org.apache.druid.server.DruidNode; -import org.apache.druid.server.log.StartupLoggingConfig; import org.apache.druid.tasklogs.NoopTaskLogs; import org.apache.druid.tasklogs.TaskLogs; import org.easymock.Mock; @@ -37,21 +31,14 @@ import org.junit.Before; import org.junit.Test; -import java.util.Properties; - public class KubernetesTaskRunnerFactoryTest { private ObjectMapper objectMapper; private KubernetesTaskRunnerConfig kubernetesTaskRunnerConfig; - private StartupLoggingConfig startupLoggingConfig; private TaskLogs taskLogs; - private DruidNode druidNode; - private TaskConfig taskConfig; - private Properties properties; private DruidKubernetesClient druidKubernetesClient; @Mock private ServiceEmitter emitter; - @Mock private Supplier dynamicConfigRef; @Mock private TaskAdapter taskAdapter; @Before @@ -61,19 +48,7 @@ public void setup() kubernetesTaskRunnerConfig = KubernetesTaskRunnerConfig.builder() .withCapacity(1) .build(); - startupLoggingConfig = new StartupLoggingConfig(); taskLogs = new NoopTaskLogs(); - druidNode = new DruidNode( - "test", - "", - false, - 0, - 1, - true, - false - ); - taskConfig = new TaskConfigBuilder().setBaseDir("/tmp").build(); - properties = new Properties(); druidKubernetesClient = new DruidKubernetesClient(); } diff --git a/extensions-core/lookups-cached-single/src/test/java/org/apache/druid/server/lookup/LoadingLookupFactoryTest.java b/extensions-core/lookups-cached-single/src/test/java/org/apache/druid/server/lookup/LoadingLookupFactoryTest.java index 4f98411e86d4..24cb19f78553 100644 --- a/extensions-core/lookups-cached-single/src/test/java/org/apache/druid/server/lookup/LoadingLookupFactoryTest.java +++ b/extensions-core/lookups-cached-single/src/test/java/org/apache/druid/server/lookup/LoadingLookupFactoryTest.java @@ -167,7 +167,12 @@ public List reverseFetchKeys(Object value) } @Override - @SuppressWarnings("EqualsHashCode") + public int hashCode() + { + return 0; + } + + @Override public boolean equals(Object obj) { return obj instanceof MockDataFetcher; diff --git a/extensions-core/lookups-cached-single/src/test/java/org/apache/druid/server/lookup/PollingLookupSerDeserTest.java b/extensions-core/lookups-cached-single/src/test/java/org/apache/druid/server/lookup/PollingLookupSerDeserTest.java index fed973ad3af7..ede9f3363cdc 100644 --- a/extensions-core/lookups-cached-single/src/test/java/org/apache/druid/server/lookup/PollingLookupSerDeserTest.java +++ b/extensions-core/lookups-cached-single/src/test/java/org/apache/druid/server/lookup/PollingLookupSerDeserTest.java @@ -103,7 +103,12 @@ public List reverseFetchKeys(Object value) } @Override - @SuppressWarnings("EqualsHashCode") + public int hashCode() + { + return 0; + } + + @Override public boolean equals(Object obj) { return obj instanceof MockDataFetcher; diff --git a/extensions-core/lookups-cached-single/src/test/java/org/apache/druid/server/lookup/PollingLookupTest.java b/extensions-core/lookups-cached-single/src/test/java/org/apache/druid/server/lookup/PollingLookupTest.java index 41f0b6de2592..cb9fa3fa2c48 100644 --- a/extensions-core/lookups-cached-single/src/test/java/org/apache/druid/server/lookup/PollingLookupTest.java +++ b/extensions-core/lookups-cached-single/src/test/java/org/apache/druid/server/lookup/PollingLookupTest.java @@ -102,7 +102,12 @@ public List reverseFetchKeys(Object value) } @Override - @SuppressWarnings("EqualsHashCode") + public int hashCode() + { + return 0; + } + + @Override public boolean equals(Object obj) { return obj instanceof MockDataFetcher; diff --git a/indexing-service/src/test/java/org/apache/druid/indexing/common/task/batch/parallel/AbstractParallelIndexSupervisorTaskTest.java b/indexing-service/src/test/java/org/apache/druid/indexing/common/task/batch/parallel/AbstractParallelIndexSupervisorTaskTest.java index 9dd6fe3f88a9..eb470709405b 100644 --- a/indexing-service/src/test/java/org/apache/druid/indexing/common/task/batch/parallel/AbstractParallelIndexSupervisorTaskTest.java +++ b/indexing-service/src/test/java/org/apache/druid/indexing/common/task/batch/parallel/AbstractParallelIndexSupervisorTaskTest.java @@ -716,7 +716,7 @@ public File fetchSegmentFile( location.getBucketId() ); if (!zippedFile.isPresent()) { - throw new ISE("Can't find segment file for location[%s] at path[%s]", location); + throw new ISE("Can't find segment file for location[%s] at path[%s]", location, zippedFile); } final File fetchedFile = new File(partitionDir, StringUtils.format("temp_%s", location.getSubTaskId())); FileUtils.writeAtomically( diff --git a/processing/src/test/java/org/apache/druid/query/lookup/LookupExtractorFactoryContainerTest.java b/processing/src/test/java/org/apache/druid/query/lookup/LookupExtractorFactoryContainerTest.java index 727fdf52dd35..cc523c088160 100644 --- a/processing/src/test/java/org/apache/druid/query/lookup/LookupExtractorFactoryContainerTest.java +++ b/processing/src/test/java/org/apache/druid/query/lookup/LookupExtractorFactoryContainerTest.java @@ -122,7 +122,12 @@ public LookupExtractor get() } @Override - @SuppressWarnings("EqualsHashCode") + public int hashCode() + { + return 0; + } + + @Override public boolean equals(Object other) { return other instanceof TestLookupExtractorFactory; diff --git a/server/src/test/java/org/apache/druid/client/CachingClusteredClientTest.java b/server/src/test/java/org/apache/druid/client/CachingClusteredClientTest.java index 61a20b6da48b..26fa73c38971 100644 --- a/server/src/test/java/org/apache/druid/client/CachingClusteredClientTest.java +++ b/server/src/test/java/org/apache/druid/client/CachingClusteredClientTest.java @@ -2567,7 +2567,8 @@ private Iterable> makeSearchResults(String dim, Object List values = new ArrayList<>(); while (index < objects.length && !(objects[index] instanceof DateTime)) { - values.add(new SearchHit(dim, objects[index++].toString(), (Integer) objects[index++])); + values.add(new SearchHit(dim, objects[index].toString(), (Integer) objects[index + 1])); + index += 2; } retVal.add(new Result<>(timestamp, new SearchResultValue(values))); @@ -2575,29 +2576,6 @@ private Iterable> makeSearchResults(String dim, Object return retVal; } - private Iterable makeGroupByResults(GroupByQuery query, Object... objects) - { - List retVal = new ArrayList<>(); - int index = 0; - while (index < objects.length) { - final DateTime timestamp = (DateTime) objects[index++]; - final Map rowMap = (Map) objects[index++]; - final ResultRow row = ResultRow.create(query.getResultRowSizeWithoutPostAggregators()); - - if (query.getResultRowHasTimestamp()) { - row.set(0, timestamp.getMillis()); - } - - for (Map.Entry entry : rowMap.entrySet()) { - final int position = query.getResultRowSignature().indexOf(entry.getKey()); - row.set(position, entry.getValue()); - } - - retVal.add(row); - } - return retVal; - } - private T makeMock(List mocks, Class clazz) { T obj = EasyMock.createMock(clazz);