### Question:
ResourceControllerService implements Service { public DataSet queryResource(Resource resource, Query query, WriteSessionConfiguration configuration) throws FeatureException { return adapter(resource, configuration).query(query); } private  ResourceControllerService(WriteSessionService writeSessionService, TemplateManagementService templateManagementService); DataSet getResource(Resource resource, WriteSessionConfiguration configuration); DataSet queryResource(Resource resource, Query query, WriteSessionConfiguration configuration); void updateResource(Resource resource, DataSet dataSet, WriteSessionConfiguration configuration); void deleteResource(Resource resource, WriteSessionConfiguration configuration); Resource createResource(Container container, DataSet dataSet, WriteSessionConfiguration configuration); static ServiceBuilder<ResourceControllerService> serviceBuilder(); static ResourceControllerService defaultService();  }### Answer:
@Test public void testQueryResource() throws Exception { String resourcePath = "querySuccess"; final Name<?> resourceName = name(resourcePath); final DataSet initial = getInitialData(newReference().toLocalIndividual().named("Miguel"), new Date()); final Resource resource = publishResource(Resource.class,QueryableResourceHandler.ID, resourceName, resourcePath); QueryableResourceHandler handler = getHandler(QueryableResourceHandler.class); handler.add(resourceName, initial); transactional( new Callable<Void>() { @Override public Void call() throws Exception { Query query = QueryBuilder.newInstance().withParameter("param1", "value1").build(); DataSet data = sut.queryResource(resource,query,getSessionConfiguration(resource)); assertThat(data,notNullValue()); assertThat(data,not(sameInstance(initial))); return null; } } ); }