@Test
public void testGetSortByFollowersCountDescendingFromOverride()
{
// setup the override as followersCount, descending
List<ResourceSortCriterion> overridingSortCrit = new ArrayList<ResourceSortCriterion>();
overridingSortCrit.add(new ResourceSortCriterion(SortField.FOLLOWERS_COUNT, SortDirection.DESCENDING));
sut.setOverridingSortCriteria(new ResourceSortCriteria(overridingSortCrit));
// now try different input criteria - name
List<ResourceSortCriterion> sortCrit = new ArrayList<ResourceSortCriterion>();
sortCrit.add(new ResourceSortCriterion(SortField.NAME, SortDirection.ASCENDING));
ResourceSortCriteria criteria = new ResourceSortCriteria(sortCrit);
// sort should come back as followers count, descending, ignoring the input criteria
Sort sort = sut.getSort(criteria);
assertEquals(1, sort.getSort().length);