diff --git a/core/src/test/java/io/kestra/plugin/core/http/RequestRunnerTest.java b/core/src/test/java/io/kestra/plugin/core/http/RequestRunnerTest.java new file mode 100644 index 00000000000..6ec9e5bc421 --- /dev/null +++ b/core/src/test/java/io/kestra/plugin/core/http/RequestRunnerTest.java @@ -0,0 +1,23 @@ +package io.kestra.plugin.core.http; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.hasSize; +import static org.hamcrest.Matchers.is; + +import io.kestra.core.junit.annotations.ExecuteFlow; +import io.kestra.core.junit.annotations.KestraTest; +import io.kestra.core.models.executions.Execution; +import io.kestra.core.models.flows.State; +import org.junit.jupiter.api.Test; + +@KestraTest(startRunner = true) +public class RequestRunnerTest { + + @Test + @ExecuteFlow("sanity-checks/request.yaml") + void logExporter(Execution execution) { + assertThat(execution.getTaskRunList(), hasSize(2)); + assertThat(execution.getState().getCurrent(), is(State.Type.SUCCESS)); + } + +} diff --git a/core/src/test/resources/sanity-checks/request.yaml b/core/src/test/resources/sanity-checks/request.yaml new file mode 100644 index 00000000000..78fa84de25d --- /dev/null +++ b/core/src/test/resources/sanity-checks/request.yaml @@ -0,0 +1,16 @@ +id: request +namespace: sanitycheck.plugin.core.http + +tasks: + - id: request + type: io.kestra.plugin.core.http.Request + uri: https://www.google.com + method: GET + options: + connectionPoolIdleTimeout: PT1M + + - id: assert + type: io.kestra.plugin.core.execution.Assert + errorMessage: "Invalid response code {{ outputs.request.code }}" + conditions: + - "{{ outputs.request.code == 200 }}" \ No newline at end of file