Skip to content

Commit

Permalink
unit test case fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
Amit-CloudSufi committed Jan 27, 2025
1 parent ba55ccc commit 4d34ed8
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ private BigQueryExecute.Config getConfig(String sql) throws NoSuchFieldException
@Test
public void testBigQueryExecuteSQLWithNonExistentResource() throws Exception {
String errorMessage = "Resource was not found. Please verify the resource name. If the resource will be created " +
"at runtime, then update to use a macro for the resource name. Error message received was: ";
"at runtime, then update to use a macro for the resource name. Error message received was ";
int errorCode = 404;
BigQueryExecute.Config config = getConfig("select * from dataset.table where id=1");
MockFailureCollector failureCollector = new MockFailureCollector();
Expand All @@ -69,8 +69,7 @@ public void testBigQueryExecuteSQLWithNonExistentResource() throws Exception {
config.validateSQLSyntax(failureCollector, bigQuery);
LOG.warn("size : {}", failureCollector.getValidationFailures().size());
Assert.assertEquals(1, failureCollector.getValidationFailures().size());
Assert.assertEquals(String.format("%s. Error code: %s.", errorMessage, errorCode),
failureCollector.getValidationFailures().get(0).getMessage());
Assert.assertTrue(failureCollector.getValidationFailures().get(0).getMessage().contains(errorMessage));
Assert.assertEquals("sql",
failureCollector.getValidationFailures().get(0).getCauses().get(0).getAttribute("stageConfig"));
}
Expand Down

0 comments on commit 4d34ed8

Please sign in to comment.