From 41359b980c4ec1b3221956768c687562651c7d7a Mon Sep 17 00:00:00 2001 From: currantw Date: Mon, 9 Dec 2024 16:12:07 -0800 Subject: [PATCH] Fix failing unit tests due to immutability. Signed-off-by: currantw --- .../sql/correctness/tests/ComparisonTestTest.java | 7 ++++--- .../opensearch/sql/correctness/tests/TestReportTest.java | 3 ++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/integ-test/src/test/java/org/opensearch/sql/correctness/tests/ComparisonTestTest.java b/integ-test/src/test/java/org/opensearch/sql/correctness/tests/ComparisonTestTest.java index f3ca1f1838..90006f4728 100644 --- a/integ-test/src/test/java/org/opensearch/sql/correctness/tests/ComparisonTestTest.java +++ b/integ-test/src/test/java/org/opensearch/sql/correctness/tests/ComparisonTestTest.java @@ -10,6 +10,7 @@ import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; +import java.util.Arrays; import java.util.List; import org.junit.Before; import org.junit.Test; @@ -81,7 +82,7 @@ public void testFailureDueToInconsistency() { TestReport expected = new TestReport(); expected.addTestCase( new FailedTestCase( - 1, "SELECT * FROM accounts", List.of(openSearchResult, otherDbResult), "")); + 1, "SELECT * FROM accounts", Arrays.asList(openSearchResult, otherDbResult), "")); TestReport actual = correctnessTest.verify(querySet("SELECT * FROM accounts")); assertEquals(expected, actual); } @@ -145,7 +146,7 @@ public void testFailureDueToEventualInconsistency() { new FailedTestCase( 1, "SELECT * FROM accounts", - List.of(openSearchResult, otherDbResult, anotherDbResult), + Arrays.asList(openSearchResult, otherDbResult, anotherDbResult), "")); TestReport actual = correctnessTest.verify(querySet("SELECT * FROM accounts")); assertEquals(expected, actual); @@ -236,7 +237,7 @@ public void testFailureDueToInconsistencyAndExceptionMixed() { new FailedTestCase( 1, "SELECT * FROM accounts", - List.of(openSearchResult, otherResult), + Arrays.asList(openSearchResult, otherResult), "Unsupported feature;")); TestReport actual = correctnessTest.verify(querySet("SELECT * FROM accounts")); assertEquals(expected, actual); diff --git a/integ-test/src/test/java/org/opensearch/sql/correctness/tests/TestReportTest.java b/integ-test/src/test/java/org/opensearch/sql/correctness/tests/TestReportTest.java index 8fa3f189ba..42b46a5086 100644 --- a/integ-test/src/test/java/org/opensearch/sql/correctness/tests/TestReportTest.java +++ b/integ-test/src/test/java/org/opensearch/sql/correctness/tests/TestReportTest.java @@ -7,6 +7,7 @@ import static org.junit.Assert.fail; +import java.util.Arrays; import java.util.List; import org.json.JSONObject; import org.junit.Test; @@ -55,7 +56,7 @@ public void testFailedReport() { new FailedTestCase( 1, "SELECT * FROM accounts", - List.of( + Arrays.asList( new DBResult( "OpenSearch", List.of(new Type("firstName", "text")),