Skip to content

Commit 3ba8b5e

Browse files
simplified tests for checking for failure
Signed-off-by: Matthew Wells <[email protected]>
1 parent fedb6c3 commit 3ba8b5e

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

integ-test/src/test/java/org/opensearch/sql/sql/DateTimeFunctionIT.java

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1358,18 +1358,14 @@ public void testBracketedEquivalent() throws IOException {
13581358
compareBrackets("time", "time", "17:30:00");
13591359
compareBrackets("time", "t", "17:30:00");
13601360
}
1361-
1362-
private void queryFails(String query) {
1363-
assertThrows(ResponseException.class, ()->executeQuery(query));
1364-
}
1365-
1361+
13661362
@Test
13671363
public void testBracketFails() {
1368-
queryFails("select {time 'failure'}");
1369-
queryFails("select {t 'failure'}");
1370-
queryFails("select {date 'failure'}");
1371-
queryFails("select {d 'failure'}");
1372-
queryFails("select {timestamp 'failure'}");
1373-
queryFails("select {ts 'failure'}");
1364+
assertThrows(ResponseException.class, ()->executeQuery("select {time 'failure'}"));
1365+
assertThrows(ResponseException.class, ()->executeQuery("select {t 'failure'}"));
1366+
assertThrows(ResponseException.class, ()->executeQuery("select {date 'failure'}"));
1367+
assertThrows(ResponseException.class, ()->executeQuery("select {d 'failure'}"));
1368+
assertThrows(ResponseException.class, ()->executeQuery("select {timestamp 'failure'}"));
1369+
assertThrows(ResponseException.class, ()->executeQuery("select {ts 'failure'}"));
13741370
}
13751371
}

0 commit comments

Comments
 (0)