use of io.seata.rm.datasource.xa.StatementProxyXA in project seata by seata.
the class ConnectionProxyXATest method testCreateStatement.
@Test
public void testCreateStatement() throws Throwable {
Connection connection = Mockito.mock(Connection.class);
Mockito.when(connection.getAutoCommit()).thenReturn(true);
XAConnection xaConnection = Mockito.mock(XAConnection.class);
BaseDataSourceResource<ConnectionProxyXA> baseDataSourceResource = Mockito.mock(BaseDataSourceResource.class);
String xid = "xxx";
ConnectionProxyXA connectionProxyXA = new ConnectionProxyXA(connection, xaConnection, baseDataSourceResource, xid);
Statement statement = connectionProxyXA.createStatement();
Assertions.assertTrue(statement instanceof StatementProxyXA);
}
Aggregations