ObjectContext originatingContext,
Query query,
DataChannelFilterChain filterChain) {
results.add("f1start");
QueryResponse response = filterChain.onQuery(originatingContext, query);
results.add("f1end");
return response;
}
};
DataChannelFilter f2 = new MockDataChannelFilter() {
@Override
public QueryResponse onQuery(
ObjectContext originatingContext,
Query query,
DataChannelFilterChain filterChain) {
results.add("f2start");
QueryResponse response = filterChain.onQuery(originatingContext, query);
results.add("f2end");
return response;
}
};
domain.filters.add(f1);
domain.filters.add(f2);
SelectQuery query = new SelectQuery(Artist.class);
QueryResponse response = domain.onQuery(context, query);
assertNotNull(response);
assertEquals(4, results.size());
assertEquals("f2start", results.get(0));
assertEquals("f1start", results.get(1));
assertEquals("f1end", results.get(2));