Fix the logic on determining whether connection is closed

This commit is contained in:
김선우
2025-01-27 19:49:10 +09:00
parent 1125e51a59
commit 6252947232
3 changed files with 4 additions and 3 deletions

View File

@@ -68,13 +68,16 @@ class JDBC4ConnectionTest {
@Test
void calling_close_multiple_times_throws_no_exception() throws Exception {
assertFalse(connection.isClosed());
connection.close();
assertTrue(connection.isClosed());
connection.close();
}
@Test
void calling_methods_on_closed_connection_should_throw_exception() throws Exception {
connection.close();
assertTrue(connection.isClosed());
assertThrows(
SQLException.class,
() ->