Skip to content

Commit

Permalink
Revise the tests
Browse files Browse the repository at this point in the history
Signed-off-by: Simeon Widdis <[email protected]>
  • Loading branch information
Swiddis committed Oct 17, 2024
1 parent c8c4d9a commit 0c4e03b
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
package org.opensearch.sql.legacy;

import static org.opensearch.sql.legacy.TestUtils.performRequest;

import java.io.IOException;
import java.util.Arrays;
import java.util.Locale;
import org.apache.hc.core5.http.ParseException;
import org.apache.hc.core5.http.io.entity.EntityUtils;
Expand Down Expand Up @@ -33,7 +30,6 @@ public void testJoinWithInvalidCondition() throws IOException, ParseException {
TestsConstants.TEST_INDEX_BANK,
TestsConstants.TEST_INDEX_BANK_TWO)));
var errMsg = new JSONObject(EntityUtils.toString(result.getResponse().getEntity()));
System.err.println("Full response: " + errMsg);

Assert.assertEquals("SqlParseException", errMsg.getJSONObject("error").getString("type"));
Assert.assertEquals(400, errMsg.getInt("status"));
Expand All @@ -48,13 +44,13 @@ public void testWildcardInSubquery() throws IOException, ParseException {
executeQuery(
String.format(
Locale.ROOT,
"SELECT a.age FROM %s AS a WHERE a.age IN (SELECT b.age FROM * AS b)",
"SELECT a.first_name FROM %s AS a WHERE a.age IN (SELECT age FROM * WHERE age > 30)",
TestsConstants.TEST_INDEX_BANK)));
var errMsg = new JSONObject(EntityUtils.toString(result.getResponse().getEntity()));
System.err.println("Full response: " + errMsg);

Assert.assertEquals(
"IllegalArgumentException", errMsg.getJSONObject("error").getString("type"));
"SqlParseException", errMsg.getJSONObject("error").getString("type"));
Assert.assertEquals(400, errMsg.getInt("status"));
}
}

0 comments on commit 0c4e03b

Please sign in to comment.