File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed
core/src/test/java/com/scalar/db/transaction/jdbc Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments