use of io.r2dbc.spi.Connection in project spring-framework by spring-projects.
the class SingleConnectionFactoryUnitTests method shouldSuppressClose.
@Test
@SuppressWarnings("rawtypes")
void shouldSuppressClose() {
SingleConnectionFactory factory = new SingleConnectionFactory("r2dbc:h2:mem:///foo", true);
Connection connection = factory.create().block();
StepVerifier.create(connection.close()).verifyComplete();
assertThat(connection).isInstanceOf(Wrapped.class);
assertThat(((Wrapped) connection).unwrap()).isInstanceOf(H2Connection.class);
StepVerifier.create(connection.setTransactionIsolationLevel(IsolationLevel.READ_COMMITTED)).verifyComplete();
factory.destroy();
}
Aggregations