Skip to content

Commit

Permalink
test(MemCachedSearchEmployeeTest): overflow cache
Browse files Browse the repository at this point in the history
  • Loading branch information
Chamber6821 committed Apr 18, 2024
1 parent 0b6bebe commit bf2da05
Showing 1 changed file with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,18 @@ public class MemCachedSearchEmployeeTest {
void shouldReturnTheSameValueFromOrigin() {
var pageable = PageRequest.of(0, 20);
assertEquals(new MemCachedSearchEmployee((x, p) -> Page.<Employee>empty(p))
.search(EmployeeCriteria.builder().build(), pageable),
Page.<Employee>empty(pageable));
.search(EmployeeCriteria.builder().build(), pageable),
Page.<Employee>empty(pageable));
}

@Test
void overflowCache() {
for (int i = 0; i < 100000; i++) {
var pageable = PageRequest.of(i, 20);
assertEquals(
new MemCachedSearchEmployee((x, p) -> Page.<Employee>empty(p))
.search(EmployeeCriteria.builder().build(), pageable),
Page.<Employee>empty(pageable));
}
}
}

0 comments on commit bf2da05

Please sign in to comment.