DATAGRAPH-330 : Added test(although ignored) to highlight scenario where current fix does not work - i.e. use of function in Sort.Order

This commit is contained in:
Nicki Watt
2013-07-09 16:52:58 +01:00
parent ac3fcc4190
commit 245d241ff7

View File

@@ -17,6 +17,7 @@
package org.springframework.data.neo4j.repository;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.neo4j.graphdb.GraphDatabaseService;
@@ -157,6 +158,20 @@ public class GraphRepositoryTests {
assertEquals(asList(testTeam.david, testTeam.emil, testTeam.michael), asCollection(allPersons));
}
@Test
@Ignore
public void findAllSortedWithFunction() {
// The case below does not fit into the general sorting and paging fix and will fail, you need to
// know what the prefix is (person in this case) and provide it in order to make
// use i.e. the following would work, but requires internal impl knowledge which is not good
// Sort sort = new Sort(Sort.Direction.ASC, "lower(person.name)");
Sort sort = new Sort(Sort.Direction.ASC, "lower(name)");
Iterable<Person> allPersons = personRepository.findAll(sort);
assertEquals(asList(testTeam.david, testTeam.emil, testTeam.michael), asCollection(allPersons));
}
@Test
public void findAllSortedDescending() {
Sort sort = new Sort(Sort.Direction.DESC, "name");