File tree Expand file tree Collapse file tree 1 file changed +8
-9
lines changed
ebean-test/src/test/java/org/tests/query Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Original file line number Diff line number Diff line change 1414import java .util .List ;
1515
1616import static org .assertj .core .api .Assertions .assertThat ;
17- import static org .junit .jupiter .api .Assertions .assertEquals ;
1817
1918class TestQueryMultiJoinFetchPath extends BaseTestCase {
2019
@@ -108,24 +107,24 @@ public void test_manyNonRoot_RootHasNoMany() {
108107 .where ().gt ("id" , 0 )
109108 .findList ();
110109
111- assertEquals ( 2 , list1 .get (0 ).orderItems . size () );
112- assertEquals ( 2 , list1 .get (0 ).orderDetails . size () );
110+ assertThat ( list1 .get (0 ).orderItems ). hasSize ( 2 );
111+ assertThat ( list1 .get (0 ).orderDetails ). hasSize ( 2 );
113112
114- List <String > sql1 = LoggedSql .stop ();
115- assertEquals ( 2 , sql1 . size () );
113+ List <String > sql1 = LoggedSql .collect ();
114+ assertThat ( sql1 ). hasSize ( 2 );
116115
117116 // This query does not eager fetch invoices. We get an NPE on orderInvoices. Only the main query is executed.
118- LoggedSql .start ();
117+ LoggedSql .collect ();
119118 List <Order > list2 = DB .find (Order .class )
120119 .fetch ("orderItems" )
121120 .fetch ("orderInvoices" )
122121 .where ().gt ("id" , 0 )
123122 .findList ();
124123
125- assertEquals ( 2 , list2 .get (0 ).orderItems . size () );
126- assertEquals ( 2 , list2 .get (0 ).orderInvoices . size () );
124+ assertThat ( list2 .get (0 ).orderItems ). hasSize ( 2 );
125+ assertThat ( list2 .get (0 ).orderInvoices ). hasSize ( 2 );
127126
128127 List <String > sql2 = LoggedSql .stop ();
129- assertEquals ( 2 , sql2 . size () );
128+ assertThat ( sql2 ). hasSize ( 2 );
130129 }
131130}
You can’t perform that action at this time.
0 commit comments