Skip to content

Commit

Permalink
SNOW-1903631: Improve test assertions in datasource (#2067)
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-dprzybysz authored Feb 7, 2025
1 parent f8b89f6 commit fdebcea
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,15 +120,15 @@ public void testDataSourceWithoutUsernameOrPasswordThrowsExplicitException() {

ds.setAccount("testaccount");
ds.setAuthenticator("snowflake");
assertThrows(
SnowflakeSQLException.class,
ds::getConnection,
"Cannot create connection because username is missing in DataSource properties.");
Exception e = assertThrows(SnowflakeSQLException.class, ds::getConnection);
assertEquals(
"Cannot create connection because username is missing in DataSource properties.",
e.getMessage());

ds.setUser("testuser");
assertThrows(
SnowflakeSQLException.class,
ds::getConnection,
"Cannot create connection because password is missing in DataSource properties.");
e = assertThrows(SnowflakeSQLException.class, ds::getConnection);
assertEquals(
"Cannot create connection because password is missing in DataSource properties.",
e.getMessage());
}
}

0 comments on commit fdebcea

Please sign in to comment.