shardingsphere
shardingsphere copied to clipboard
Add more unit tests for the class of `ConnectionSavepointManager`
Hi community, This issue is for #20305
Aim
Add more unit tests for the class of org.apache.shardingsphere.transaction.ConnectionSavepointManager.
Basic Qualifications
- Java
- Maven
- Transaction
Detail
Maybe you can mock the connection and assert the results of setSavepoint,rollbackToSavepoint... methods.
private Connection mockConnection() throws SQLException {
Connection result = mock(Connection.class);
when(result.unwrap(JdbcConnection.class)).thenReturn(mock(JdbcConnection.class));
return result;
}