Skip to content

Commit

Permalink
test fix
Browse files Browse the repository at this point in the history
  • Loading branch information
strehle committed Sep 11, 2024
1 parent 6316d78 commit be963b7
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,29 +53,29 @@ public void dropFoo() {
void iterationOverPages() {
list = new JdbcPagingList<Map<String, Object>>(jdbcTemplate, limitSqlAdapter, "SELECT * from foo where id>=:id",
Collections.<String, Object>singletonMap("id", 0), new ColumnMapRowMapper(), 3);
assertEquals(5, list.size());
assertEquals(6, list.size());
Set<String> names = new HashSet<String>();
for (Map<String, Object> map : list) {
String name = (String) map.get("name");
assertNotNull(name);
names.add(name);
}
assertEquals(5, names.size());
assertEquals(6, names.size());
names = new HashSet<String>();
for (Map<String, Object> map : list) {
String name = (String) map.get("name");
assertNotNull(name);
names.add(name);
}
assertEquals(5, names.size());
assertEquals(6, names.size());
}

@Test
void iterationWithDeletedElements() {
list = new JdbcPagingList<Map<String, Object>>(jdbcTemplate, limitSqlAdapter, "SELECT * from foo where id>=:id",
Collections.<String, Object>singletonMap("id", 0), new ColumnMapRowMapper(), 3);
jdbcTemplate.update("DELETE from foo where id>3");
assertEquals(5, list.size());
assertEquals(6, list.size());
Set<String> names = new HashSet<String>();
for (Map<String, Object> map : list) {
String name = (String) map.get("name");
Expand All @@ -89,14 +89,14 @@ void iterationWithDeletedElements() {
void orderBy() {
list = new JdbcPagingList<Map<String, Object>>(jdbcTemplate, limitSqlAdapter, "SELECT * from foo order by id asc",
Collections.<String, Object>singletonMap("id", 0), new ColumnMapRowMapper(), 3);
assertEquals(5, list.size());
assertEquals(6, list.size());
Set<String> names = new HashSet<String>();
for (Map<String, Object> map : list) {
String name = (String) map.get("name");
assertNotNull(name);
names.add(name);
}
assertEquals(5, names.size());
assertEquals(6, names.size());
}

@Test
Expand Down Expand Up @@ -176,7 +176,7 @@ void subListFromDeletedElements() {
new ColumnMapRowMapper(), 3);
jdbcTemplate.update("DELETE from foo where id>3");
list = list.subList(1, list.size());
assertEquals(4, list.size());
assertEquals(5, list.size());
int count = 0;
for (Map<String, Object> map : list) {
count++;
Expand Down

0 comments on commit be963b7

Please sign in to comment.