Skip to content

Commit 943e3f5

Browse files
committed
Incorrect result for transform expression #96
1 parent b3b19f9 commit 943e3f5

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package com.dashjoin.jsonata;
2+
3+
import org.junit.jupiter.api.Assertions;
4+
import org.junit.jupiter.api.Disabled;
5+
import org.junit.jupiter.api.Test;
6+
import com.dashjoin.jsonata.json.Json;
7+
8+
public class VariableTest {
9+
10+
@Disabled
11+
@Test
12+
public void testContextVariable() {
13+
var input = Json.parseJson("{\n"
14+
+ " \"model\": {\n"
15+
+ " \"customer\": {\n"
16+
+ " \"identityDocumentNumber\": \"ABC123456\",\n"
17+
+ " \"identityDocumentType\": \"ID_CARD\"\n"
18+
+ " }\n"
19+
+ " }\n"
20+
+ " }");
21+
var e = Jsonata.jsonata("($~>|$|$.model|)@$.\n"
22+
+ " ({\n"
23+
+ " \"documentIdentityNumber\": customer.identityDocumentNumber,\n"
24+
+ " \"documentIdentityType\": customer.identityDocumentType\n"
25+
+ " })");
26+
Assertions.assertEquals("{documentIdentityNumber=ABC123456, documentIdentityType=ID_CARD}", e.evaluate(input) + "");
27+
}
28+
}

0 commit comments

Comments
 (0)