close pagination after assertion completed
package org.killbill.billing.util.entity.dao;
+import java.io.Closeable;
+import java.io.IOException;
import java.util.Iterator;
import java.util.List;
@@ -156,6 +158,8 @@ public class TestDefaultPaginationSqlDaoHelper extends UtilTestSuiteWithEmbedded
Assert.assertEquals(pagination.getMaxNbRecords(), expectedMaxNbRecords);
Assert.assertEquals(pagination.getCurrentOffset(), expectedCurrentOffset);
Assert.assertEquals(pagination.getNextOffset(), expectedNextOffset);
+
+ closePagination(pagination);
}
private void searchAndValidateKombuchas(final String tea,
@@ -173,6 +177,8 @@ public class TestDefaultPaginationSqlDaoHelper extends UtilTestSuiteWithEmbedded
Assert.assertEquals(pagination.getMaxNbRecords(), expectedMaxNbRecords);
Assert.assertEquals(pagination.getCurrentOffset(), expectedCurrentOffset);
Assert.assertEquals(pagination.getNextOffset(), expectedNextOffset);
+
+ closePagination(pagination);
}
private Pagination<KombuchaModelDao> searchKombuchas(final String searchKey,
@@ -262,4 +268,11 @@ public class TestDefaultPaginationSqlDaoHelper extends UtilTestSuiteWithEmbedded
dao.create(kombuchas.get(i), internalCallContext);
}
}
+
+ private void closePagination(final Closeable pagination) {
+ try {
+ pagination.close();
+ } catch (final IOException ignored) {
+ }
+ }
}
