Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
JingsongLi committed Nov 18, 2024
1 parent 7311f0e commit 221a237
Showing 1 changed file with 14 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,23 @@ public void test() throws IOException {

// test empty
map.put("k1", Collections.emptyList());
List<String> values = cache.read("k1", null, Filter.alwaysTrue(), Filter.alwaysTrue());
List<String> values =
cache.read(
"k1", null, Filter.alwaysTrue(), Filter.alwaysTrue(), Filter.alwaysTrue());
assertThat(values).isEmpty();

// test values
List<String> expect = Arrays.asList("v1", "v2", "v3");
map.put("k2", expect);
values = cache.read("k2", null, Filter.alwaysTrue(), Filter.alwaysTrue());
values =
cache.read(
"k2", null, Filter.alwaysTrue(), Filter.alwaysTrue(), Filter.alwaysTrue());
assertThat(values).containsExactlyElementsOf(expect);

// test cache
values = cache.read("k2", null, Filter.alwaysTrue(), Filter.alwaysTrue());
values =
cache.read(
"k2", null, Filter.alwaysTrue(), Filter.alwaysTrue(), Filter.alwaysTrue());
assertThat(values).containsExactlyElementsOf(expect);

// test filter
Expand All @@ -77,7 +83,8 @@ public void test() throws IOException {
"k2",
null,
Filter.alwaysTrue(),
r -> r.getString(0).toString().endsWith("2"));
r -> r.getString(0).toString().endsWith("2"),
Filter.alwaysTrue());
assertThat(values).containsExactly("v2");

// test load filter
Expand All @@ -88,6 +95,7 @@ public void test() throws IOException {
"k3",
null,
r -> r.getString(0).toString().endsWith("2"),
Filter.alwaysTrue(),
Filter.alwaysTrue());
assertThat(values).containsExactly("v2");

Expand All @@ -99,6 +107,7 @@ public void test() throws IOException {
"k4",
null,
r -> r.getString(0).toString().endsWith("5"),
Filter.alwaysTrue(),
Filter.alwaysTrue());
assertThat(values).isEmpty();

Expand All @@ -117,6 +126,7 @@ public void test() throws IOException {
k,
null,
Filter.alwaysTrue(),
Filter.alwaysTrue(),
Filter.alwaysTrue()))
.containsExactly(k);
} catch (IOException e) {
Expand Down

0 comments on commit 221a237

Please sign in to comment.