diff --git a/src/test/java/io/kestra/plugin/templates/ExampleRunnerTest.java b/src/test/java/io/kestra/plugin/templates/ExampleRunnerTest.java index bc47411..e452654 100644 --- a/src/test/java/io/kestra/plugin/templates/ExampleRunnerTest.java +++ b/src/test/java/io/kestra/plugin/templates/ExampleRunnerTest.java @@ -1,5 +1,6 @@ package io.kestra.plugin.templates; +import io.kestra.core.junit.annotations.ExecuteFlow; import io.kestra.core.junit.annotations.KestraTest; import io.kestra.core.queues.QueueException; import org.junit.jupiter.api.BeforeEach; @@ -26,28 +27,12 @@ * configuration file in `src/test/resources/application.yml` that is only for the full runner * test to configure in-memory runner. */ -@KestraTest +@KestraTest(startRunner = true) class ExampleRunnerTest { - @Inject - protected StandAloneRunner runner; - - @Inject - protected RunnerUtils runnerUtils; - - @Inject - protected LocalFlowRepositoryLoader repositoryLoader; - - @BeforeEach - protected void init() throws IOException, URISyntaxException { - repositoryLoader.load(Objects.requireNonNull(ExampleRunnerTest.class.getClassLoader().getResource("flows"))); - this.runner.run(); - } - @SuppressWarnings("unchecked") @Test - void flow() throws TimeoutException, QueueException { - Execution execution = runnerUtils.runOne(null, "io.kestra.templates", "example"); - + @ExecuteFlow("flows/example.yaml") + void flow(Execution execution) throws TimeoutException, QueueException { assertThat(execution.getTaskRunList(), hasSize(3)); assertThat(((Map)execution.getTaskRunList().get(2).getOutputs().get("child")).get("value"), is("task-id")); }