Skip to content

Commit

Permalink
Fix failing unit tests due to immutability.
Browse files Browse the repository at this point in the history
Signed-off-by: currantw <[email protected]>
  • Loading branch information
currantw committed Dec 10, 2024
1 parent 0ca7f2b commit 41359b9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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")),
Expand Down

0 comments on commit 41359b9

Please sign in to comment.