Skip to content

Commit 5dec7c3

Browse files
author
elasticsearchmachine
committed
[CI] Auto commit changes from spotless
1 parent 449abe6 commit 5dec7c3

File tree

7 files changed

+23
-23
lines changed

7 files changed

+23
-23
lines changed

x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/TestCaseSupplier.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1577,11 +1577,9 @@ public static List<TestCaseSupplier> mapTestCases(
15771577
Collection<TestCaseSupplier> suppliers,
15781578
Function<TestCaseSupplier.TestCase, TestCaseSupplier.TestCase> mapper
15791579
) {
1580-
return suppliers.stream().map(supplier ->
1581-
new TestCaseSupplier(supplier.name(), supplier.types(), () ->
1582-
mapper.apply(supplier.get())
1583-
)
1584-
).toList();
1580+
return suppliers.stream()
1581+
.map(supplier -> new TestCaseSupplier(supplier.name(), supplier.types(), () -> mapper.apply(supplier.get())))
1582+
.toList();
15851583
}
15861584

15871585
public static final class TestCase {

x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/AbstractConfigurationFunctionTestCase.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,12 @@
77

88
package org.elasticsearch.xpack.esql.expression.function.scalar;
99

10-
import org.elasticsearch.xpack.esql.ConfigurationTestUtils;
1110
import org.elasticsearch.xpack.esql.core.expression.Expression;
1211
import org.elasticsearch.xpack.esql.core.tree.Source;
1312
import org.elasticsearch.xpack.esql.expression.function.AbstractScalarFunctionTestCase;
1413
import org.elasticsearch.xpack.esql.session.Configuration;
1514

1615
import java.util.List;
17-
import java.util.Map;
1816

1917
import static org.elasticsearch.xpack.esql.ConfigurationTestUtils.randomConfiguration;
2018
import static org.elasticsearch.xpack.esql.ConfigurationTestUtils.randomTables;
@@ -34,7 +32,10 @@ public void testSerializationWithConfiguration() {
3432

3533
assertSerialization(expr, config);
3634

37-
Configuration differentConfig = randomValueOtherThan(config, () -> randomConfiguration(testCase.getSource().text(), randomTables()));
35+
Configuration differentConfig = randomValueOtherThan(
36+
config,
37+
() -> randomConfiguration(testCase.getSource().text(), randomTables())
38+
);
3839

3940
Expression differentExpr = buildWithConfiguration(testCase.getSource(), testCase.getDataAsFields(), differentConfig);
4041
assertNotEquals(expr, differentExpr);

x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/date/DateExtractTests.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,9 @@ public static Iterable<Object[]> parameters() {
9494
DataType.LONG,
9595
is(nullValue())
9696
).withConfiguration(TestCaseSupplier.TEST_CONFIGURATION)
97-
.withWarning("Line 1:1: evaluation of [source] failed, treating result as null. Only first 20 failures recorded.")
97+
.withWarning(
98+
"Line 1:1: evaluation of [source] failed, treating result as null. Only first 20 failures recorded."
99+
)
98100
.withWarning(
99101
"Line 1:1: java.lang.IllegalArgumentException: "
100102
+ "No enum constant java.time.temporal.ChronoField.NOT A UNIT"

x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/date/DateFormatTests.java

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
import org.apache.lucene.util.BytesRef;
1414
import org.elasticsearch.common.time.DateFormatter;
1515
import org.elasticsearch.common.time.DateUtils;
16-
import org.elasticsearch.xpack.esql.EsqlTestUtils;
1716
import org.elasticsearch.xpack.esql.core.expression.Expression;
1817
import org.elasticsearch.xpack.esql.core.tree.Source;
1918
import org.elasticsearch.xpack.esql.core.type.DataType;
@@ -24,13 +23,9 @@
2423

2524
import java.time.Instant;
2625
import java.util.ArrayList;
27-
import java.util.Collection;
2826
import java.util.List;
29-
import java.util.function.Function;
3027
import java.util.function.Supplier;
3128

32-
import static java.util.stream.Collectors.toList;
33-
import static org.hamcrest.Matchers.equalTo;
3429
import static org.hamcrest.Matchers.matchesPattern;
3530

3631
public class DateFormatTests extends AbstractConfigurationFunctionTestCase {
@@ -89,10 +84,7 @@ public static Iterable<Object[]> parameters() {
8984
(value) -> new BytesRef(EsqlDataTypeConverter.DEFAULT_DATE_TIME_FORMATTER.formatNanos(DateUtils.toLong((Instant) value))),
9085
List.of()
9186
);
92-
suppliers = TestCaseSupplier.mapTestCases(
93-
suppliers,
94-
testCase -> testCase.withConfiguration(TestCaseSupplier.TEST_CONFIGURATION)
95-
);
87+
suppliers = TestCaseSupplier.mapTestCases(suppliers, testCase -> testCase.withConfiguration(TestCaseSupplier.TEST_CONFIGURATION));
9688
return parameterSuppliersFromTypedDataWithDefaultChecksNoErrors(true, suppliers);
9789
}
9890

x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/date/DayNameTests.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
import org.elasticsearch.common.lucene.BytesRefs;
1515
import org.elasticsearch.common.settings.Settings;
1616
import org.elasticsearch.common.time.DateUtils;
17-
import org.elasticsearch.xpack.esql.ConfigurationTestUtils;
1817
import org.elasticsearch.xpack.esql.analysis.AnalyzerSettings;
1918
import org.elasticsearch.xpack.esql.core.expression.Expression;
2019
import org.elasticsearch.xpack.esql.core.expression.FoldContext;

x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/ToLowerTests.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,9 @@ private static void suppliers(List<TestCaseSupplier> suppliers, String name, Dat
9191
values.add(new TestCaseSupplier.TypedData(new BytesRef(value), type, "0"));
9292

9393
String expectedValue = value.toLowerCase(EsqlTestUtils.TEST_CFG.locale());
94-
return new TestCaseSupplier.TestCase(values, expectedToString, type, equalTo(new BytesRef(expectedValue))).withConfiguration(TestCaseSupplier.TEST_CONFIGURATION);
94+
return new TestCaseSupplier.TestCase(values, expectedToString, type, equalTo(new BytesRef(expectedValue))).withConfiguration(
95+
TestCaseSupplier.TEST_CONFIGURATION
96+
);
9597
}));
9698
suppliers.add(new TestCaseSupplier(name + " mv", List.of(type), () -> {
9799
List<TestCaseSupplier.TypedData> values = new ArrayList<>();
@@ -101,7 +103,9 @@ private static void suppliers(List<TestCaseSupplier> suppliers, String name, Dat
101103
values.add(new TestCaseSupplier.TypedData(strings.stream().map(BytesRef::new).toList(), type, "0"));
102104

103105
List<BytesRef> expectedValue = strings.stream().map(s -> new BytesRef(s.toLowerCase(EsqlTestUtils.TEST_CFG.locale()))).toList();
104-
return new TestCaseSupplier.TestCase(values, expectedToString, type, equalTo(expectedValue)).withConfiguration(TestCaseSupplier.TEST_CONFIGURATION);
106+
return new TestCaseSupplier.TestCase(values, expectedToString, type, equalTo(expectedValue)).withConfiguration(
107+
TestCaseSupplier.TEST_CONFIGURATION
108+
);
105109
}));
106110
}
107111

x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/ToUpperTests.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,9 @@ private static void supplier(List<TestCaseSupplier> suppliers, String name, Data
9191
values.add(new TestCaseSupplier.TypedData(new BytesRef(value), type, "0"));
9292

9393
String expectedValue = value.toUpperCase(EsqlTestUtils.TEST_CFG.locale());
94-
return new TestCaseSupplier.TestCase(values, expectedToString, type, equalTo(new BytesRef(expectedValue))).withConfiguration(TestCaseSupplier.TEST_CONFIGURATION);
94+
return new TestCaseSupplier.TestCase(values, expectedToString, type, equalTo(new BytesRef(expectedValue))).withConfiguration(
95+
TestCaseSupplier.TEST_CONFIGURATION
96+
);
9597
}));
9698
suppliers.add(new TestCaseSupplier(name + " mv", List.of(type), () -> {
9799
List<TestCaseSupplier.TypedData> values = new ArrayList<>();
@@ -101,7 +103,9 @@ private static void supplier(List<TestCaseSupplier> suppliers, String name, Data
101103
values.add(new TestCaseSupplier.TypedData(strings.stream().map(BytesRef::new).toList(), type, "0"));
102104

103105
List<BytesRef> expectedValue = strings.stream().map(s -> new BytesRef(s.toUpperCase(EsqlTestUtils.TEST_CFG.locale()))).toList();
104-
return new TestCaseSupplier.TestCase(values, expectedToString, type, equalTo(expectedValue)).withConfiguration(TestCaseSupplier.TEST_CONFIGURATION);
106+
return new TestCaseSupplier.TestCase(values, expectedToString, type, equalTo(expectedValue)).withConfiguration(
107+
TestCaseSupplier.TEST_CONFIGURATION
108+
);
105109
}));
106110
}
107111

0 commit comments

Comments
 (0)