File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
hibernate-search-orm/src/test/java/org/hibernate/search/test/query Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -83,16 +83,16 @@ public void tearDown() throws Exception {
83
83
}
84
84
85
85
@ SuppressWarnings ("unchecked" )
86
- public void testResultOrderedByIdPerDefault () throws Exception {
86
+ public void testResultOrderedById () throws Exception {
87
87
Transaction tx = fullTextSession .beginTransaction ();
88
88
89
89
Query query = queryParser .parse ( "summary:lucene" );
90
90
FullTextQuery hibQuery = fullTextSession .createFullTextQuery ( query , Book .class );
91
+ Sort sort = new Sort ( new SortField ( "id" , SortField .STRING , false ) );
92
+ hibQuery .setSort ( sort );
91
93
List <Book > result = hibQuery .list ();
92
94
assertNotNull ( result );
93
95
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.
96
96
int id = 1 ;
97
97
for ( Book b : result ) {
98
98
assertEquals ( "Expected another id" , Integer .valueOf ( id ), b .getId () );
You can’t perform that action at this time.
0 commit comments