shardingsphere icon indicating copy to clipboard operation
shardingsphere copied to clipboard

Add more unit tests for the class of `ConnectionSavepointManager`

Open FlyingZC opened this issue 3 years ago • 0 comments

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;
}

FlyingZC avatar Aug 22 '22 08:08 FlyingZC