Skip to content

Commit 0fe48a7

Browse files
committed
Fix tests - HSQLDB change default sort order
1 parent c0634e7 commit 0fe48a7

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

src/test/java/examples/joins/JoinMapperTest.java

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -680,36 +680,36 @@ void testFullJoin() {
680680
SelectStatementProvider selectStatement = select(orderLine.orderId, orderLine.quantity, orderLine.itemId.as("ol_itemid"), itemMaster.itemId.as("im_itemid"), itemMaster.description)
681681
.from(itemMaster, "im")
682682
.fullJoin(orderLine, "ol").on(itemMaster.itemId, equalTo(orderLine.itemId))
683-
.orderBy(sortColumn("im_itemid"))
683+
.orderBy(orderLine.orderId, sortColumn("im_itemid"))
684684
.build()
685685
.render(RenderingStrategies.MYBATIS3);
686686

687687
String expectedStatement = "select ol.order_id, ol.quantity, ol.item_id as ol_itemid, im.item_id as im_itemid, im.description"
688688
+ " from ItemMaster im full join OrderLine ol on im.item_id = ol.item_id"
689-
+ " order by im_itemid";
689+
+ " order by order_id, im_itemid";
690690
assertThat(selectStatement.getSelectStatement()).isEqualTo(expectedStatement);
691691

692692
List<Map<String, Object>> rows = mapper.selectManyMappedRows(selectStatement);
693693

694694
assertThat(rows).hasSize(6);
695695
Map<String, Object> row = rows.get(0);
696-
assertThat(row).containsEntry("ORDER_ID", 2);
697-
assertThat(row).containsEntry("QUANTITY", 6);
698-
assertThat(row).containsEntry("OL_ITEMID", 66);
699-
assertThat(row).doesNotContainKey("DESCRIPTION");
700-
assertThat(row).doesNotContainKey("IM_ITEMID");
696+
assertThat(row).doesNotContainKey("ORDER_ID");
697+
assertThat(row).doesNotContainKey("QUANTITY");
698+
assertThat(row).containsEntry("DESCRIPTION", "Catcher Glove");
699+
assertThat(row).containsEntry("IM_ITEMID", 55);
701700

702-
row = rows.get(3);
701+
row = rows.get(2);
703702
assertThat(row).containsEntry("ORDER_ID", 1);
704703
assertThat(row).containsEntry("QUANTITY", 1);
705704
assertThat(row).containsEntry("DESCRIPTION", "First Base Glove");
706705
assertThat(row).containsEntry("IM_ITEMID", 33);
707706

708-
row = rows.get(5);
709-
assertThat(row).doesNotContainKey("ORDER_ID");
710-
assertThat(row).doesNotContainKey("QUANTITY");
711-
assertThat(row).containsEntry("DESCRIPTION", "Catcher Glove");
712-
assertThat(row).containsEntry("IM_ITEMID", 55);
707+
row = rows.get(3);
708+
assertThat(row).containsEntry("ORDER_ID", 2);
709+
assertThat(row).containsEntry("QUANTITY", 6);
710+
assertThat(row).containsEntry("OL_ITEMID", 66);
711+
assertThat(row).doesNotContainKey("DESCRIPTION");
712+
assertThat(row).doesNotContainKey("IM_ITEMID");
713713
}
714714
}
715715

0 commit comments

Comments
 (0)