Skip to content

Commit 3a2e33c

Browse files
committed
Fix
1 parent 60c000f commit 3a2e33c

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

core/src/test/java/com/scalar/db/transaction/jdbc/JdbcTransactionManagerTest.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -195,14 +195,12 @@ public void beginReadOnly_WithTxId_ShouldCreateReadOnlyTransactionWithGivenId()
195195
}
196196

197197
@Test
198-
public void begin_ConnectionFailure_ShouldThrowTransactionException() throws Exception {
198+
public void begin_SQLExceptionThrown_ShouldThrowTransactionException() throws Exception {
199199
// Arrange
200-
when(dataSource.getConnection()).thenThrow(new SQLException("Connection failed"));
200+
when(dataSource.getConnection()).thenThrow(SQLException.class);
201201

202-
// Act & Assert
203-
assertThatThrownBy(() -> manager.begin())
204-
.isInstanceOf(TransactionException.class)
205-
.hasMessageContaining("Connection failed");
202+
// Act Assert
203+
assertThatThrownBy(() -> manager.begin()).isInstanceOf(TransactionException.class);
206204
}
207205

208206
@Test

0 commit comments

Comments
 (0)