Skip to content

Commit

Permalink
fix(tests): introduce @KestraTest (linked to kestra-io/kestra#3948)
Browse files Browse the repository at this point in the history
  • Loading branch information
brian-mulier-p committed Jun 12, 2024
1 parent 159f253 commit a7c279a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ dependencies {
// test deps needed only for to have a runner
testAnnotationProcessor group: "io.kestra", name: "processor", version: kestraVersion
testImplementation group: "io.kestra", name: "core", version: kestraVersion
testImplementation group: "io.kestra", name: "core", version: kestraVersion, classifier: "tests"
testImplementation group: "io.kestra", name: "repository-memory", version: kestraVersion
testImplementation group: "io.kestra", name: "runner-memory", version: kestraVersion
testImplementation group: "io.kestra", name: "storage-local", version: kestraVersion
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package io.kestra.plugin.templates;

import io.micronaut.test.extensions.junit5.annotation.MicronautTest;
import io.kestra.core.junit.annotations.KestraTest;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import io.kestra.core.models.executions.Execution;
import io.kestra.core.repositories.LocalFlowRepositoryLoader;
import io.kestra.core.runners.RunnerUtils;
import io.kestra.runner.memory.MemoryRunner;
import io.kestra.core.runners.StandAloneRunner;

import jakarta.inject.Inject;
import java.io.IOException;
Expand All @@ -25,10 +25,10 @@
* configuration file in `src/test/resources/application.yml` that is only for the full runner
* test to configure in-memory runner.
*/
@MicronautTest
@KestraTest
class ExampleRunnerTest {
@Inject
protected MemoryRunner runner;
protected StandAloneRunner runner;

@Inject
protected RunnerUtils runnerUtils;
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/io/kestra/plugin/templates/ExampleTest.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package io.kestra.plugin.templates;

import com.google.common.collect.ImmutableMap;
import io.micronaut.test.extensions.junit5.annotation.MicronautTest;
import io.kestra.core.junit.annotations.KestraTest;
import org.apache.commons.lang3.StringUtils;
import org.junit.jupiter.api.Test;
import io.kestra.core.runners.RunContext;
Expand All @@ -16,7 +16,7 @@
* This test will only test the main task, this allow you to send any input
* parameters to your task and test the returning behaviour easily.
*/
@MicronautTest
@KestraTest
class ExampleTest {
@Inject
private RunContextFactory runContextFactory;
Expand Down

0 comments on commit a7c279a

Please sign in to comment.