* @see DATAMONGO-534
*/
@Test
public void considersSortWhenQueryingFiles() throws IOException {
GridFSFile second = operations.store(resource.getInputStream(), "foo.xml");
GridFSFile third = operations.store(resource.getInputStream(), "foobar.xml");
GridFSFile first = operations.store(resource.getInputStream(), "bar.xml");
Query query = new Query().with(new Sort(Direction.ASC, "filename"));
List<GridFSDBFile> result = operations.find(query);
assertThat(result, hasSize(3));