Clean up warnings in JdbcTransactionManagerTests

This commit is contained in:
Sam Brannen 2023-12-06 21:35:02 +01:00
parent 61dd9fce73
commit 302cdeeee6
1 changed files with 4 additions and 1 deletions

View File

@ -43,7 +43,7 @@ import static org.mockito.Mockito.verify;
* @since 5.3 * @since 5.3
* @see org.springframework.jdbc.datasource.DataSourceTransactionManagerTests * @see org.springframework.jdbc.datasource.DataSourceTransactionManagerTests
*/ */
public class JdbcTransactionManagerTests extends DataSourceTransactionManagerTests { public class JdbcTransactionManagerTests extends DataSourceTransactionManagerTests<JdbcTransactionManager> {
@Override @Override
protected JdbcTransactionManager createTransactionManager(DataSource ds) { protected JdbcTransactionManager createTransactionManager(DataSource ds) {
@ -51,6 +51,7 @@ public class JdbcTransactionManagerTests extends DataSourceTransactionManagerTes
} }
@Override
@Test @Test
public void testTransactionWithExceptionOnCommit() throws Exception { public void testTransactionWithExceptionOnCommit() throws Exception {
willThrow(new SQLException("Cannot commit")).given(con).commit(); willThrow(new SQLException("Cannot commit")).given(con).commit();
@ -106,6 +107,7 @@ public class JdbcTransactionManagerTests extends DataSourceTransactionManagerTes
verify(con).close(); verify(con).close();
} }
@Override
@Test @Test
public void testTransactionWithExceptionOnCommitAndRollbackOnCommitFailure() throws Exception { public void testTransactionWithExceptionOnCommitAndRollbackOnCommitFailure() throws Exception {
willThrow(new SQLException("Cannot commit")).given(con).commit(); willThrow(new SQLException("Cannot commit")).given(con).commit();
@ -127,6 +129,7 @@ public class JdbcTransactionManagerTests extends DataSourceTransactionManagerTes
verify(con).close(); verify(con).close();
} }
@Override
@Test @Test
public void testTransactionWithExceptionOnRollback() throws Exception { public void testTransactionWithExceptionOnRollback() throws Exception {
given(con.getAutoCommit()).willReturn(true); given(con.getAutoCommit()).willReturn(true);