Skip to content

Commit 1c9e89c

Browse files
fix: v2 compatibility
1 parent abfa6ae commit 1c9e89c

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

src/test/java/io/kestra/plugin/templates/ExampleRunnerTest.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
package io.kestra.plugin.templates;
22

3+
import io.kestra.core.exceptions.InternalException;
34
import io.kestra.core.junit.annotations.ExecuteFlow;
45
import io.kestra.core.junit.annotations.KestraTest;
6+
import io.kestra.core.runners.RunContextFactory;
7+
import io.kestra.core.services.TaskOutputService;
8+
import jakarta.inject.Inject;
59
import org.junit.jupiter.api.Test;
610
import io.kestra.core.models.executions.Execution;
711

@@ -17,10 +21,13 @@
1721
*/
1822
@KestraTest(startRunner = true) // This annotation starts an embedded Kestra for tests
1923
class ExampleRunnerTest {
24+
@Inject
25+
private TaskOutputService taskOutputService;
26+
2027
@Test
2128
@ExecuteFlow("flows/example.yaml")
22-
void flow(Execution execution) {
29+
void flow(Execution execution) throws InternalException {
2330
assertThat(execution.getTaskRunList(), hasSize(3));
24-
assertThat(((Map<String, Object>)execution.getTaskRunList().get(2).getOutputs().get("child")).get("value"), is("task-id"));
31+
assertThat(((Map<String, Object>) taskOutputService.getOutputs(execution.getTaskRunList().get(2)).get("child")).get("value"), is("task-id"));
2532
}
2633
}

0 commit comments

Comments
 (0)