use of com.ibatis.sqlmap.engine.transaction.TransactionManager in project pinpoint by naver.
the class SqlMapClientTemplateIT method queryForPaginagedListShouldBeTraced.
@Test
@SuppressWarnings("deprecation")
public void queryForPaginagedListShouldBeTraced() throws Exception {
// Given
final String queryForPaginatedListId = "queryForPaginatedListId";
// to emulate lazy-loading, otherwise exception is thrown
TransactionManager mockTxManager = mock(TransactionManager.class);
when(this.mockSqlMapExecutorDelegate.getTxManager()).thenReturn(mockTxManager);
SqlMapClientTemplate clientTemplate = new SqlMapClientTemplate(this.mockDataSource, this.sqlMapClient);
// When
clientTemplate.queryForPaginatedList(queryForPaginatedListId, 1);
clientTemplate.queryForPaginatedList(queryForPaginatedListId, new Object(), 1);
// Then
PluginTestVerifier verifier = PluginTestVerifierHolder.getInstance();
Method queryForPaginatedList1 = SqlMapClientTemplate.class.getDeclaredMethod("queryForPaginatedList", String.class, int.class);
Method queryForPaginatedList2 = SqlMapClientTemplate.class.getDeclaredMethod("queryForPaginatedList", String.class, Object.class, int.class);
verifier.verifyTrace(event("IBATIS_SPRING", queryForPaginatedList1, Expectations.cachedArgs(queryForPaginatedListId)));
verifier.verifyTrace(event("IBATIS_SPRING", queryForPaginatedList2, Expectations.cachedArgs(queryForPaginatedListId)));
}
Aggregations