Skip to content

Commit 86a2ff7

Browse files
committed
add test
1 parent a1c7305 commit 86a2ff7

File tree

3 files changed

+37
-0
lines changed

3 files changed

+37
-0
lines changed

runtime/v2/runner-test/src/test/java/com/walmartlabs/concord/runtime/v2/runner/MainTest.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1746,6 +1746,20 @@ public void flowCallOutExpressionCompat() throws Exception {
17461746
assertLog(runtime.allLogs(), ".*" + Pattern.quote("out as map with loop: [abc_0, abc_1]") + ".*");
17471747
}
17481748

1749+
@Test
1750+
public void prefixedFunctionsInExpressions() throws Exception {
1751+
deploy("prefixedFunctions");
1752+
1753+
save(ProcessConfiguration.builder()
1754+
.putArguments("name", "world")
1755+
.build());
1756+
1757+
run();
1758+
1759+
assertLog(runtime.allLogs(), ".*Hi, world!.*");
1760+
assertLog(runtime.allLogs(), ".*Hello, world!.*");
1761+
}
1762+
17491763
private void deploy(String name) throws URISyntaxException, IOException {
17501764
runtime.deploy(name);
17511765
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package com.walmartlabs.concord.runtime.v2.runner.functions;
2+
3+
import com.walmartlabs.concord.runtime.v2.sdk.ELFunction;
4+
5+
import javax.inject.Named;
6+
7+
@Named
8+
public class TestFunction {
9+
10+
@ELFunction("testGreet")
11+
public static String regularGreet(String name) {
12+
return "Hi, " + name + "!";
13+
}
14+
15+
@ELFunction("testFunction:greet")
16+
public static String prefixedGreet(String name) {
17+
return "Hello, " + name + "!";
18+
}
19+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
flows:
2+
default:
3+
- log: "${testGreet(name)}"
4+
- log: "${testFunction:greet(name)}"

0 commit comments

Comments
 (0)