Skip to content

Commit 2b6587d

Browse files
committed
Test now uses official callback API
1 parent f86ad96 commit 2b6587d

1 file changed

Lines changed: 4 additions & 10 deletions

File tree

src/test/java/com/dashjoin/jsonata/RuntimeTest.java

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,11 @@ public void testRuntimeBounds() {
3131
public void testCallbacks() {
3232
var expr = jsonata("42");
3333
var frame = expr.createFrame();
34-
frame.bind("__evaluate_entry", new Jsonata.EntryCallback() {
35-
@Override
36-
public void callback(Symbol expr, Object input, Frame environment) {
37-
entered = true;
38-
}
34+
frame.setEvaluateEntryCallback((ast, input, environment) -> {
35+
entered = true;
3936
});
40-
frame.bind("__evaluate_exit", new Jsonata.ExitCallback() {
41-
@Override
42-
public void callback(Symbol expr, Object input, Frame environment, Object result) {
43-
exited = true;
44-
}
37+
frame.setEvaluateExitCallback((ast, input, environment, result) -> {
38+
exited = true;
4539
});
4640
expr.evaluate(null, frame);
4741
Assertions.assertTrue(exited && entered);

0 commit comments

Comments
 (0)