Skip to content

Commit e09ee33

Browse files
committed
1 parent 7362c9c commit e09ee33

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/main/java/com/api/jsonata4java/expressions/OrderByOperator.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,10 @@ private List<OrderByField> extractOrderByFields(Op_orderbyContext ctx) {
8181
order = defaultOrder;
8282
break;
8383
case MappingExpressionParser.GT:
84-
order = OrderByOrder.ASC;
84+
order = OrderByOrder.DESC;
8585
break;
8686
case MappingExpressionParser.LT:
87-
order = OrderByOrder.DESC;
87+
order = OrderByOrder.ASC;
8888
break;
8989
}
9090
}

src/test/java/com/api/jsonata4java/test/expressions/OpOrderByTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,21 +36,21 @@ public void testOrdered() throws Exception {
3636

3737
@Test
3838
public void testOrderedAscending() throws Exception {
39-
test("$^(>id, >content)",
39+
test("$^(<id, <content)",
4040
"[{\"id\":\"1\",\"content\":\"1\"},{\"id\":\"2\",\"content\":\"1\"},{\"id\":\"2\",\"content\":\"2\"}]", null,
4141
"[{\"id\":\"2\",\"content\":\"2\"},{\"id\":\"2\",\"content\":\"1\"},{\"id\":\"1\",\"content\":\"1\"}]");
4242
}
4343

4444
@Test
4545
public void testOrderedDescending() throws Exception {
46-
test("$^(<id, <content)",
46+
test("$^(>id, >content)",
4747
"[{\"id\":\"2\",\"content\":\"2\"},{\"id\":\"2\",\"content\":\"1\"},{\"id\":\"1\",\"content\":\"1\"}]", null,
4848
"[{\"id\":\"2\",\"content\":\"1\"},{\"id\":\"2\",\"content\":\"2\"},{\"id\":\"1\",\"content\":\"1\"}]");
4949
}
5050

5151
@Test
5252
public void testOrderedMixed() throws Exception {
53-
test("$^(<id, content)",
53+
test("$^(>id, content)",
5454
"[{\"id\":\"2\",\"content\":\"1\"},{\"id\":\"2\",\"content\":\"2\"},{\"id\":\"1\",\"content\":\"1\"}]", null,
5555
"[{\"id\":\"1\",\"content\":\"1\"},{\"id\":\"2\",\"content\":\"1\"},{\"id\":\"2\",\"content\":\"2\"}]");
5656
}

0 commit comments

Comments
 (0)