### Question:
QueryableResourceHandler extends InMemoryResourceHandler implements Queryable { @Override public DataSet query(ResourceSnapshot resource, Query query, ReadSession session) throws InvalidQueryException { return QuerySupport.getDescription(resource.name(), query); } QueryableResourceHandler(); @Override DataSet query(ResourceSnapshot resource, Query query, ReadSession session); static final String ID; static final String FAILURE; }### Answer:
@Test public void testQuery(@Mocked final ResourceSnapshot snapshot, @Mocked final Name<?> name, @Mocked final Query query) throws Exception { QueryableResourceHandler sut = new QueryableResourceHandler(); new Expectations() {{ snapshot.name();result=name; QuerySupport.getDescription(name, query); }}; sut.query(snapshot, query, null); }