Skip to content

Commit 34606b7

Browse files
committed
[Fix #1198] Fixing details comparison typo
1 parent d576f6c commit 34606b7

File tree

3 files changed

+30
-5
lines changed

3 files changed

+30
-5
lines changed

impl/core/src/main/java/io/serverlessworkflow/impl/executors/TryExecutor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ private static boolean filterError(WorkflowError error, ErrorFilter errorFilter)
206206
&& (errorFilter.getStatus() <= 0 || error.status() == errorFilter.getStatus())
207207
&& compareString(errorFilter.getInstance(), error.instance())
208208
&& compareString(errorFilter.getTitle(), error.title())
209-
&& compareString(errorFilter.getDetails(), errorFilter.getDetails());
209+
&& compareString(errorFilter.getDetails(), error.details());
210210
}
211211

212212
private static boolean compareString(String one, String other) {

impl/test/src/test/java/io/serverlessworkflow/impl/test/RetryTimeoutTest.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,12 +122,16 @@ void testTimeout() throws IOException {
122122
assertThat(result.get("message")).isEqualTo("Viva er Beti Balompie");
123123
}
124124

125-
@Test
126-
void testDoesNotMatch() {
125+
@ParameterizedTest
126+
@ValueSource(
127+
strings = {
128+
"workflows-samples/try-catch-not-match.yaml",
129+
"workflows-samples/try-catch-not-match-details.yaml"
130+
})
131+
void testDoesNotMatch(String path) {
127132
assertThatThrownBy(
128133
() ->
129-
app.workflowDefinition(
130-
readWorkflowFromClasspath("workflows-samples/try-catch-not-match.yaml"))
134+
app.workflowDefinition(readWorkflowFromClasspath(path))
131135
.instance(Map.of())
132136
.start()
133137
.join())
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
document:
2+
dsl: '1.0.0'
3+
namespace: test
4+
name: try-catch-not-match-details
5+
version: '0.1.0'
6+
do:
7+
- attemptTask:
8+
try:
9+
- failingTask:
10+
raise:
11+
error:
12+
type: https://example.com/errors/security
13+
status: 403
14+
detail: Enforcement Failure - invalid email
15+
catch:
16+
errors:
17+
with:
18+
type: https://example.com/errors/security
19+
status: 403
20+
details: User not found in tenant catalog
21+

0 commit comments

Comments
 (0)