Skip to content

Commit e530328

Browse files
Change to sort by id test in SortTest (was erroneously testing "default" ordering)
1 parent 14b5503 commit e530328

File tree

1 file changed

+3
-3
lines changed
  • hibernate-search-orm/src/test/java/org/hibernate/search/test/query

1 file changed

+3
-3
lines changed

hibernate-search-orm/src/test/java/org/hibernate/search/test/query/SortTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,16 +83,16 @@ public void tearDown() throws Exception {
8383
}
8484

8585
@SuppressWarnings("unchecked")
86-
public void testResultOrderedByIdPerDefault() throws Exception {
86+
public void testResultOrderedById() throws Exception {
8787
Transaction tx = fullTextSession.beginTransaction();
8888

8989
Query query = queryParser.parse( "summary:lucene" );
9090
FullTextQuery hibQuery = fullTextSession.createFullTextQuery( query, Book.class );
91+
Sort sort = new Sort( new SortField( "id", SortField.STRING, false ) );
92+
hibQuery.setSort( sort );
9193
List<Book> result = hibQuery.list();
9294
assertNotNull( result );
9395
assertEquals( "Wrong number of test results.", 3, result.size() );
94-
// make sure that the order is according to in which order the books got inserted
95-
// into the index.
9696
int id = 1;
9797
for ( Book b : result ) {
9898
assertEquals( "Expected another id", Integer.valueOf( id ), b.getId() );

0 commit comments

Comments
 (0)