Skip to content

Commit 9b47e05

Browse files
committed
Fix compilation of test framework tests
We accidentally broke the compilation of the test frameworks tests. All better now.
1 parent b94bc70 commit 9b47e05

File tree

1 file changed

+15
-14
lines changed

1 file changed

+15
-14
lines changed

test/framework/src/test/java/org/elasticsearch/test/rest/yaml/section/DoSectionTests.java

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
package org.elasticsearch.test.rest.yaml.section;
2121

22+
import org.elasticsearch.Version;
2223
import org.elasticsearch.common.logging.DeprecationLogger;
2324
import org.elasticsearch.common.xcontent.XContent;
2425
import org.elasticsearch.common.xcontent.XContentLocation;
@@ -44,7 +45,7 @@ public void testWarningHeaders() throws IOException {
4445
final DoSection section = new DoSection(new XContentLocation(1, 1));
4546

4647
// No warning headers doesn't throw an exception
47-
section.checkWarningHeaders(emptyList());
48+
section.checkWarningHeaders(emptyList(), Version.CURRENT);
4849
}
4950

5051
final String testHeader = DeprecationLogger.formatWarning("test");
@@ -55,13 +56,12 @@ public void testWarningHeaders() throws IOException {
5556
{
5657
final DoSection section = new DoSection(new XContentLocation(1, 1));
5758

58-
final AssertionError one = expectThrows(AssertionError.class, () -> section.checkWarningHeaders(singletonList(testHeader)));
59+
final AssertionError one = expectThrows(AssertionError.class, () ->
60+
section.checkWarningHeaders(singletonList(testHeader), Version.CURRENT));
5961
assertEquals("got unexpected warning header [\n\t" + testHeader + "\n]\n", one.getMessage());
6062

61-
final AssertionError multiple =
62-
expectThrows(
63-
AssertionError.class,
64-
() -> section.checkWarningHeaders(Arrays.asList(testHeader, anotherHeader, someMoreHeader)));
63+
final AssertionError multiple = expectThrows(AssertionError.class, () ->
64+
section.checkWarningHeaders(Arrays.asList(testHeader, anotherHeader, someMoreHeader), Version.CURRENT));
6565
assertEquals(
6666
"got unexpected warning headers [\n\t" +
6767
testHeader + "\n\t" +
@@ -74,39 +74,40 @@ public void testWarningHeaders() throws IOException {
7474
{
7575
final DoSection section = new DoSection(new XContentLocation(1, 1));
7676
section.setExpectedWarningHeaders(singletonList("test"));
77-
section.checkWarningHeaders(singletonList(testHeader));
77+
section.checkWarningHeaders(singletonList(testHeader), Version.CURRENT);
7878
}
7979
{
8080
final DoSection section = new DoSection(new XContentLocation(1, 1));
8181
section.setExpectedWarningHeaders(Arrays.asList("test", "another", "some more"));
82-
section.checkWarningHeaders(Arrays.asList(testHeader, anotherHeader, someMoreHeader));
82+
section.checkWarningHeaders(Arrays.asList(testHeader, anotherHeader, someMoreHeader), Version.CURRENT);
8383
}
8484

8585
// But if you don't get some that you did expect, that is an error
8686
{
8787
final DoSection section = new DoSection(new XContentLocation(1, 1));
8888
section.setExpectedWarningHeaders(singletonList("test"));
89-
final AssertionError e = expectThrows(AssertionError.class, () -> section.checkWarningHeaders(emptyList()));
89+
final AssertionError e = expectThrows(AssertionError.class, () -> section.checkWarningHeaders(emptyList(), Version.CURRENT));
9090
assertEquals("did not get expected warning header [\n\ttest\n]\n", e.getMessage());
9191
}
9292
{
9393
final DoSection section = new DoSection(new XContentLocation(1, 1));
9494
section.setExpectedWarningHeaders(Arrays.asList("test", "another", "some more"));
9595

96-
final AssertionError multiple = expectThrows(AssertionError.class, () -> section.checkWarningHeaders(emptyList()));
96+
final AssertionError multiple = expectThrows(AssertionError.class, () ->
97+
section.checkWarningHeaders(emptyList(), Version.CURRENT));
9798
assertEquals("did not get expected warning headers [\n\ttest\n\tanother\n\tsome more\n]\n", multiple.getMessage());
9899

99-
final AssertionError one =
100-
expectThrows(AssertionError.class, () -> section.checkWarningHeaders(Arrays.asList(testHeader, someMoreHeader)));
100+
final AssertionError one = expectThrows(AssertionError.class, () ->
101+
section.checkWarningHeaders(Arrays.asList(testHeader, someMoreHeader), Version.CURRENT));
101102
assertEquals("did not get expected warning header [\n\tanother\n]\n", one.getMessage());
102103
}
103104

104105
// It is also an error if you get some warning you want and some you don't want
105106
{
106107
final DoSection section = new DoSection(new XContentLocation(1, 1));
107108
section.setExpectedWarningHeaders(Arrays.asList("test", "another", "some more"));
108-
final AssertionError e =
109-
expectThrows(AssertionError.class, () -> section.checkWarningHeaders(Arrays.asList(testHeader, catHeader)));
109+
final AssertionError e = expectThrows(AssertionError.class, () ->
110+
section.checkWarningHeaders(Arrays.asList(testHeader, catHeader), Version.CURRENT));
110111
assertEquals("got unexpected warning header [\n\t" +
111112
catHeader + "\n]\n" +
112113
"did not get expected warning headers [\n\tanother\n\tsome more\n]\n",

0 commit comments

Comments
 (0)