use of cn.taketoday.jdbc.datasource.ConnectionProxy in project today-infrastructure by TAKETODAY.
the class JdbcTemplateTests method testConnectionCallback.
@Test
public void testConnectionCallback() throws Exception {
String result = this.template.execute(new ConnectionCallback<String>() {
@Override
public String doInConnection(Connection con) {
assertThat(con instanceof ConnectionProxy).isTrue();
assertThat(((ConnectionProxy) con).getTargetConnection()).isSameAs(JdbcTemplateTests.this.connection);
return "test";
}
});
assertThat(result).isEqualTo("test");
}
Aggregations