From 22dfd1ccbac05b6193ae36f564095e28ab6263f9 Mon Sep 17 00:00:00 2001 From: Jesse Tuglu Date: Tue, 25 Mar 2025 12:45:54 -0700 Subject: [PATCH] Fix failing test in DimensionSchemaUtilsTest --- .../msq/util/DimensionSchemaUtilsTest.java | 24 ++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/util/DimensionSchemaUtilsTest.java b/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/util/DimensionSchemaUtilsTest.java index 0a4e3ddbd814..d068753d7189 100644 --- a/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/util/DimensionSchemaUtilsTest.java +++ b/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/util/DimensionSchemaUtilsTest.java @@ -25,14 +25,23 @@ import org.apache.druid.data.input.impl.LongDimensionSchema; import org.apache.druid.data.input.impl.StringDimensionSchema; import org.apache.druid.error.DruidException; +import org.apache.druid.java.util.emitter.EmittingLogger; import org.apache.druid.segment.AutoTypeColumnSchema; import org.apache.druid.segment.column.ColumnType; +import org.apache.druid.server.metrics.NoopServiceEmitter; import org.junit.Assert; +import org.junit.Before; import org.junit.Test; public class DimensionSchemaUtilsTest { + @Before + public void setup() + { + EmittingLogger.registerEmitter(new NoopServiceEmitter()); + } + @Test public void testSchemaScalars() { @@ -179,19 +188,28 @@ public void testSchemaMvdMode() DruidException.class, () -> DimensionSchemaUtils.createDimensionSchema("x", ColumnType.LONG_ARRAY, false, ArrayIngestMode.MVD) ); - Assert.assertEquals("Numeric arrays can only be ingested when 'arrayIngestMode' is set to 'array'. Current value of the parameter is[mvd]", t.getMessage()); + Assert.assertEquals( + "Numeric arrays can only be ingested when 'arrayIngestMode' is set to 'array'. Current value of the parameter is[mvd]", + t.getMessage() + ); t = Assert.assertThrows( DruidException.class, () -> DimensionSchemaUtils.createDimensionSchema("x", ColumnType.DOUBLE_ARRAY, false, ArrayIngestMode.MVD) ); - Assert.assertEquals("Numeric arrays can only be ingested when 'arrayIngestMode' is set to 'array'. Current value of the parameter is[mvd]", t.getMessage()); + Assert.assertEquals( + "Numeric arrays can only be ingested when 'arrayIngestMode' is set to 'array'. Current value of the parameter is[mvd]", + t.getMessage() + ); t = Assert.assertThrows( DruidException.class, () -> DimensionSchemaUtils.createDimensionSchema("x", ColumnType.FLOAT_ARRAY, false, ArrayIngestMode.MVD) ); - Assert.assertEquals("Numeric arrays can only be ingested when 'arrayIngestMode' is set to 'array'. Current value of the parameter is[mvd]", t.getMessage()); + Assert.assertEquals( + "Numeric arrays can only be ingested when 'arrayIngestMode' is set to 'array'. Current value of the parameter is[mvd]", + t.getMessage() + ); } @Test