public void asListAndFilterInMemoryByInCriterionOfCipherText()
throws Exception {
Hoge hoge1 = new Hoge();
Hoge hoge2 = new Hoge();
Hoge hoge3 = new Hoge();
hoge1.setMyCipherText(new Text("1102"));
hoge2.setMyCipherText(new Text("1103"));
hoge3.setMyCipherText(new Text("1104"));
DatastoreUtil.put(ds, null, DatastoreUtil.modelToEntity(ds, hoge1));
DatastoreUtil.put(ds, null, DatastoreUtil.modelToEntity(ds, hoge2));
DatastoreUtil.put(ds, null, DatastoreUtil.modelToEntity(ds, hoge3));
List<Hoge> list =
new ModelQuery<Hoge>(ds, meta)
.filterInMemory(
new InCriterion(meta.myCipherText, Arrays.asList(
"1102",
"1104")))
.filterInMemory(
new InCriterion(meta.myCipherText, Arrays.asList(new Text(
"1102"), new Text("1104"))))
.filterInMemory(
new InMemoryInCriterion(meta.myCipherText, Arrays.asList(
"1102",
"1104")))
.filterInMemory(
new InMemoryInCriterion(meta.myCipherText, Arrays.asList(
new Text("1102"),
new Text("1104"))))
.sortInMemory(meta.key.asc)
.asList();
assertThat(list.size(), is(2));
assertThat(list.get(0).getMyCipherText().getValue(), is("1102"));
assertThat(list.get(1).getMyCipherText().getValue(), is("1104"));