diff --git a/src/test/java/com/example/jonebook/services/search/MemCachedSearchEmployeeTest.java b/src/test/java/com/example/jonebook/services/search/MemCachedSearchEmployeeTest.java index 2c473fa..71e8816 100644 --- a/src/test/java/com/example/jonebook/services/search/MemCachedSearchEmployeeTest.java +++ b/src/test/java/com/example/jonebook/services/search/MemCachedSearchEmployeeTest.java @@ -13,7 +13,18 @@ public class MemCachedSearchEmployeeTest { void shouldReturnTheSameValueFromOrigin() { var pageable = PageRequest.of(0, 20); assertEquals(new MemCachedSearchEmployee((x, p) -> Page.empty(p)) - .search(EmployeeCriteria.builder().build(), pageable), - Page.empty(pageable)); + .search(EmployeeCriteria.builder().build(), pageable), + Page.empty(pageable)); + } + + @Test + void overflowCache() { + for (int i = 0; i < 100000; i++) { + var pageable = PageRequest.of(i, 20); + assertEquals( + new MemCachedSearchEmployee((x, p) -> Page.empty(p)) + .search(EmployeeCriteria.builder().build(), pageable), + Page.empty(pageable)); + } } }