public void testInterceptDataSet() throws Exception {
DataContext dc = new InterceptableDataContext(delegateDataContext)
.addDataSetInterceptor(new DataSetInterceptor() {
@Override
public DataSet intercept(DataSet dataSet) {
return new MaxRowsDataSet(dataSet, 1);
}
});
DataSet ds = dc.query().from(table).select("foo").execute();
assertEquals(MaxRowsDataSet.class, ds.getClass());