refactor(core): move YamlFlowParser to YamlParser

since it's already able to handle all types with generic
This commit is contained in:
Ludovic DEHON
2024-11-04 08:19:23 +01:00
parent 93ff17a0ca
commit 6e58b3fe18
26 changed files with 102 additions and 110 deletions

View File

@@ -2,7 +2,7 @@ package io.kestra.repository.memory;
import io.kestra.core.models.flows.Flow;
import io.kestra.core.repositories.FlowRepositoryInterface;
import io.kestra.core.serializers.YamlFlowParser;
import io.kestra.core.serializers.YamlParser;
import io.kestra.core.junit.annotations.KestraTest;
import jakarta.inject.Inject;
import org.junit.jupiter.api.Test;
@@ -14,7 +14,7 @@ import static org.hamcrest.Matchers.is;
public class MemoryRepositoryTest {
@Inject
private YamlFlowParser yamlFlowParser;
private YamlParser yamlParser;
@Inject
private FlowRepositoryInterface flowRepositoryInterface;
@@ -30,7 +30,7 @@ public class MemoryRepositoryTest {
- id: some-task
type: io.kestra.core.tasks.debugs.Return
format: "Hello, World!\"""";
Flow flow = yamlFlowParser.parse(flowSource, Flow.class);
Flow flow = yamlParser.parse(flowSource, Flow.class);
flowRepositoryInterface.create(flow, flowSource, flow);
assertThat(flowRepositoryInterface.findAll(null).size(), is(1));