fix(tests): fix StatefulTriggerInterfaceTest

This commit is contained in:
Florian Hussonnois
2025-12-05 17:05:29 +01:00
committed by Florian Hussonnois
parent 760050e9fc
commit 3cbad1ce0d

View File

@@ -1,6 +1,7 @@
package io.kestra.core.models.triggers;
import io.kestra.core.junit.annotations.KestraTest;
import io.kestra.core.models.TenantInterface;
import io.kestra.core.models.flows.Flow;
import io.kestra.core.runners.RunContextFactory;
import jakarta.inject.Inject;
@@ -22,21 +23,15 @@ class StatefulTriggerInterfaceTest {
RunContextFactory runContextFactory;
@Test
void shouldPersistAndReadState() throws Exception {
void shouldPersistAndReadState() {
var flow = Flow.builder()
.tenantId("main")
.namespace("io.kestra.unittest")
.id("test-flow")
.revision(1)
.build();
var runContext = runContextFactory.of(flow, Map.of(
"flow", Map.of(
"tenantId", "main",
"namespace", "io.kestra.unittest",
"id", "test-flow",
"revision", 1
)
));
var runContext = runContextFactory.of(flow, Map.of());
var key = defaultKey("ns", "test-flow", "trigger-persist");
var ttl = Optional.of(Duration.ofMinutes(5));
@@ -59,21 +54,15 @@ class StatefulTriggerInterfaceTest {
}
@Test
void shouldExpireOldEntriesAfterTTL() throws Exception {
void shouldExpireOldEntriesAfterTTL() {
var flow = Flow.builder()
.tenantId("main")
.namespace("io.kestra.unittest")
.id("test-flow")
.revision(1)
.build();
var runContext = runContextFactory.of(flow, Map.of(
"flow", Map.of(
"tenantId", "main",
"namespace", "io.kestra.unittest",
"id", "test-flow",
"revision", 1
)
));
var runContext = runContextFactory.of(flow, Map.of());
var key = defaultKey("ns", "test-flow", "trigger-ttl");
var ttl = Optional.of(Duration.ofMinutes(5));