mirror of
https://github.com/kestra-io/kestra.git
synced 2025-12-19 18:05:41 -05:00
refactor(core): move YamlFlowParser to YamlParser
since it's already able to handle all types with generic
This commit is contained in:
@@ -2,7 +2,7 @@ package io.kestra.cli;
|
||||
|
||||
import io.kestra.core.models.validations.ModelValidator;
|
||||
import io.kestra.core.models.validations.ValidateConstraintViolation;
|
||||
import io.kestra.core.serializers.YamlFlowParser;
|
||||
import io.kestra.core.serializers.YamlParser;
|
||||
import io.micronaut.core.type.Argument;
|
||||
import io.micronaut.http.HttpRequest;
|
||||
import io.micronaut.http.MediaType;
|
||||
@@ -62,7 +62,7 @@ public abstract class AbstractValidateCommand extends AbstractApiCommand {
|
||||
public static String buildYamlBody(Path directory) throws IOException {
|
||||
try(var files = Files.walk(directory)) {
|
||||
return files.filter(Files::isRegularFile)
|
||||
.filter(YamlFlowParser::isValidExtension)
|
||||
.filter(YamlParser::isValidExtension)
|
||||
.map(throwFunction(path -> Files.readString(path, Charset.defaultCharset())))
|
||||
.collect(Collectors.joining("\n---\n"));
|
||||
}
|
||||
@@ -71,7 +71,7 @@ public abstract class AbstractValidateCommand extends AbstractApiCommand {
|
||||
// bug in micronaut, we can't inject YamlFlowParser & ModelValidator, so we inject from implementation
|
||||
public Integer call(
|
||||
Class<?> cls,
|
||||
YamlFlowParser yamlFlowParser,
|
||||
YamlParser yamlParser,
|
||||
ModelValidator modelValidator,
|
||||
Function<Object, String> identity,
|
||||
Function<Object, List<String>> warningsFunction,
|
||||
@@ -85,10 +85,10 @@ public abstract class AbstractValidateCommand extends AbstractApiCommand {
|
||||
if(this.local) {
|
||||
try(var files = Files.walk(directory)) {
|
||||
files.filter(Files::isRegularFile)
|
||||
.filter(YamlFlowParser::isValidExtension)
|
||||
.filter(YamlParser::isValidExtension)
|
||||
.forEach(path -> {
|
||||
try {
|
||||
Object parse = yamlFlowParser.parse(path.toFile(), cls);
|
||||
Object parse = yamlParser.parse(path.toFile(), cls);
|
||||
modelValidator.validate(parse);
|
||||
stdOut("@|green \u2713|@ - " + identity.apply(parse));
|
||||
List<String> warnings = warningsFunction.apply(parse);
|
||||
|
||||
@@ -3,7 +3,7 @@ package io.kestra.cli.commands.flows;
|
||||
import io.kestra.cli.AbstractCommand;
|
||||
import io.kestra.core.models.flows.Flow;
|
||||
import io.kestra.core.models.hierarchies.GraphCluster;
|
||||
import io.kestra.core.serializers.YamlFlowParser;
|
||||
import io.kestra.core.serializers.YamlParser;
|
||||
import io.kestra.core.services.Graph2DotService;
|
||||
import io.kestra.core.utils.GraphUtils;
|
||||
import io.micronaut.context.ApplicationContext;
|
||||
@@ -29,7 +29,7 @@ public class FlowDotCommand extends AbstractCommand {
|
||||
public Integer call() throws Exception {
|
||||
super.call();
|
||||
|
||||
YamlFlowParser parser = applicationContext.getBean(YamlFlowParser.class);
|
||||
YamlParser parser = applicationContext.getBean(YamlParser.class);
|
||||
Flow flow = parser.parse(file.toFile(), Flow.class);
|
||||
|
||||
GraphCluster graph = GraphUtils.of(flow, null);
|
||||
|
||||
@@ -3,7 +3,7 @@ package io.kestra.cli.commands.flows;
|
||||
import io.kestra.cli.AbstractCommand;
|
||||
import io.kestra.core.models.flows.Flow;
|
||||
import io.kestra.core.models.validations.ModelValidator;
|
||||
import io.kestra.core.serializers.YamlFlowParser;
|
||||
import io.kestra.core.serializers.YamlParser;
|
||||
import jakarta.inject.Inject;
|
||||
import picocli.CommandLine;
|
||||
|
||||
@@ -21,7 +21,7 @@ public class FlowExpandCommand extends AbstractCommand {
|
||||
private Path file;
|
||||
|
||||
@Inject
|
||||
private YamlFlowParser yamlFlowParser;
|
||||
private YamlParser yamlParser;
|
||||
|
||||
@Inject
|
||||
private ModelValidator modelValidator;
|
||||
@@ -31,7 +31,7 @@ public class FlowExpandCommand extends AbstractCommand {
|
||||
super.call();
|
||||
stdErr("Warning, this functionality is deprecated and will be removed at some point.");
|
||||
String content = IncludeHelperExpander.expand(Files.readString(file), file.getParent());
|
||||
Flow flow = yamlFlowParser.parse(content, Flow.class);
|
||||
Flow flow = yamlParser.parse(content, Flow.class);
|
||||
modelValidator.validate(flow);
|
||||
stdOut(content);
|
||||
return 0;
|
||||
|
||||
@@ -2,7 +2,7 @@ package io.kestra.cli.commands.flows;
|
||||
|
||||
import io.kestra.cli.AbstractApiCommand;
|
||||
import io.kestra.cli.AbstractValidateCommand;
|
||||
import io.kestra.core.serializers.YamlFlowParser;
|
||||
import io.kestra.core.serializers.YamlParser;
|
||||
import io.micronaut.core.type.Argument;
|
||||
import io.micronaut.http.HttpRequest;
|
||||
import io.micronaut.http.MediaType;
|
||||
@@ -41,7 +41,7 @@ public class FlowUpdatesCommand extends AbstractApiCommand {
|
||||
try (var files = Files.walk(directory)) {
|
||||
List<String> flows = files
|
||||
.filter(Files::isRegularFile)
|
||||
.filter(YamlFlowParser::isValidExtension)
|
||||
.filter(YamlParser::isValidExtension)
|
||||
.map(path -> {
|
||||
try {
|
||||
return IncludeHelperExpander.expand(Files.readString(path, Charset.defaultCharset()), path.getParent());
|
||||
|
||||
@@ -3,7 +3,7 @@ package io.kestra.cli.commands.flows;
|
||||
import io.kestra.cli.AbstractValidateCommand;
|
||||
import io.kestra.core.models.flows.Flow;
|
||||
import io.kestra.core.models.validations.ModelValidator;
|
||||
import io.kestra.core.serializers.YamlFlowParser;
|
||||
import io.kestra.core.serializers.YamlParser;
|
||||
import io.kestra.core.services.FlowService;
|
||||
import jakarta.inject.Inject;
|
||||
import picocli.CommandLine;
|
||||
@@ -17,7 +17,7 @@ import java.util.List;
|
||||
)
|
||||
public class FlowValidateCommand extends AbstractValidateCommand {
|
||||
@Inject
|
||||
private YamlFlowParser yamlFlowParser;
|
||||
private YamlParser yamlParser;
|
||||
|
||||
@Inject
|
||||
private ModelValidator modelValidator;
|
||||
@@ -29,7 +29,7 @@ public class FlowValidateCommand extends AbstractValidateCommand {
|
||||
public Integer call() throws Exception {
|
||||
return this.call(
|
||||
Flow.class,
|
||||
yamlFlowParser,
|
||||
yamlParser,
|
||||
modelValidator,
|
||||
(Object object) -> {
|
||||
Flow flow = (Flow) object;
|
||||
|
||||
@@ -3,7 +3,7 @@ package io.kestra.cli.commands.flows.namespaces;
|
||||
import io.kestra.cli.AbstractValidateCommand;
|
||||
import io.kestra.cli.commands.AbstractServiceNamespaceUpdateCommand;
|
||||
import io.kestra.cli.commands.flows.IncludeHelperExpander;
|
||||
import io.kestra.core.serializers.YamlFlowParser;
|
||||
import io.kestra.core.serializers.YamlParser;
|
||||
import io.micronaut.core.type.Argument;
|
||||
import io.micronaut.http.HttpRequest;
|
||||
import io.micronaut.http.MediaType;
|
||||
@@ -28,7 +28,7 @@ import java.util.List;
|
||||
@Slf4j
|
||||
public class FlowNamespaceUpdateCommand extends AbstractServiceNamespaceUpdateCommand {
|
||||
@Inject
|
||||
public YamlFlowParser yamlFlowParser;
|
||||
public YamlParser yamlParser;
|
||||
|
||||
@CommandLine.Option(names = {"--override-namespaces"}, negatable = true, description = "replace namespace of all flows by the one provided")
|
||||
public boolean override = false;
|
||||
@@ -41,7 +41,7 @@ public class FlowNamespaceUpdateCommand extends AbstractServiceNamespaceUpdateCo
|
||||
try (var files = Files.walk(directory)) {
|
||||
List<String> flows = files
|
||||
.filter(Files::isRegularFile)
|
||||
.filter(YamlFlowParser::isValidExtension)
|
||||
.filter(YamlParser::isValidExtension)
|
||||
.map(path -> {
|
||||
try {
|
||||
return IncludeHelperExpander.expand(Files.readString(path, Charset.defaultCharset()), path.getParent());
|
||||
|
||||
@@ -4,7 +4,7 @@ import io.kestra.cli.AbstractValidateCommand;
|
||||
import io.kestra.core.models.templates.Template;
|
||||
import io.kestra.core.models.templates.TemplateEnabled;
|
||||
import io.kestra.core.models.validations.ModelValidator;
|
||||
import io.kestra.core.serializers.YamlFlowParser;
|
||||
import io.kestra.core.serializers.YamlParser;
|
||||
import jakarta.inject.Inject;
|
||||
import picocli.CommandLine;
|
||||
|
||||
@@ -17,7 +17,7 @@ import java.util.Collections;
|
||||
@TemplateEnabled
|
||||
public class TemplateValidateCommand extends AbstractValidateCommand {
|
||||
@Inject
|
||||
private YamlFlowParser yamlFlowParser;
|
||||
private YamlParser yamlParser;
|
||||
|
||||
@Inject
|
||||
private ModelValidator modelValidator;
|
||||
@@ -26,7 +26,7 @@ public class TemplateValidateCommand extends AbstractValidateCommand {
|
||||
public Integer call() throws Exception {
|
||||
return this.call(
|
||||
Template.class,
|
||||
yamlFlowParser,
|
||||
yamlParser,
|
||||
modelValidator,
|
||||
(Object object) -> {
|
||||
Template template = (Template) object;
|
||||
|
||||
@@ -2,10 +2,9 @@ package io.kestra.cli.commands.templates.namespaces;
|
||||
|
||||
import io.kestra.cli.AbstractValidateCommand;
|
||||
import io.kestra.cli.commands.AbstractServiceNamespaceUpdateCommand;
|
||||
import io.kestra.cli.commands.templates.TemplateValidateCommand;
|
||||
import io.kestra.core.models.templates.Template;
|
||||
import io.kestra.core.models.templates.TemplateEnabled;
|
||||
import io.kestra.core.serializers.YamlFlowParser;
|
||||
import io.kestra.core.serializers.YamlParser;
|
||||
import io.micronaut.core.type.Argument;
|
||||
import io.micronaut.http.HttpRequest;
|
||||
import io.micronaut.http.MutableHttpRequest;
|
||||
@@ -17,7 +16,7 @@ import picocli.CommandLine;
|
||||
|
||||
import java.nio.file.Files;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import jakarta.validation.ConstraintViolationException;
|
||||
|
||||
@CommandLine.Command(
|
||||
@@ -29,7 +28,7 @@ import jakarta.validation.ConstraintViolationException;
|
||||
@TemplateEnabled
|
||||
public class TemplateNamespaceUpdateCommand extends AbstractServiceNamespaceUpdateCommand {
|
||||
@Inject
|
||||
public YamlFlowParser yamlFlowParser;
|
||||
public YamlParser yamlParser;
|
||||
|
||||
@Override
|
||||
public Integer call() throws Exception {
|
||||
@@ -38,8 +37,8 @@ public class TemplateNamespaceUpdateCommand extends AbstractServiceNamespaceUpda
|
||||
try (var files = Files.walk(directory)) {
|
||||
List<Template> templates = files
|
||||
.filter(Files::isRegularFile)
|
||||
.filter(YamlFlowParser::isValidExtension)
|
||||
.map(path -> yamlFlowParser.parse(path.toFile(), Template.class))
|
||||
.filter(YamlParser::isValidExtension)
|
||||
.map(path -> yamlParser.parse(path.toFile(), Template.class))
|
||||
.toList();
|
||||
|
||||
if (templates.isEmpty()) {
|
||||
|
||||
@@ -5,7 +5,7 @@ import io.kestra.core.models.flows.FlowWithPath;
|
||||
import io.kestra.core.models.flows.FlowWithSource;
|
||||
import io.kestra.core.models.validations.ModelValidator;
|
||||
import io.kestra.core.repositories.FlowRepositoryInterface;
|
||||
import io.kestra.core.serializers.YamlFlowParser;
|
||||
import io.kestra.core.serializers.YamlParser;
|
||||
import io.kestra.core.services.FlowListenersInterface;
|
||||
import io.micronaut.context.annotation.Requires;
|
||||
import io.micronaut.context.annotation.Value;
|
||||
@@ -37,7 +37,7 @@ public class FileChangedEventListener {
|
||||
private FlowRepositoryInterface flowRepositoryInterface;
|
||||
|
||||
@Inject
|
||||
private YamlFlowParser yamlFlowParser;
|
||||
private YamlParser yamlParser;
|
||||
|
||||
@Inject
|
||||
private ModelValidator modelValidator;
|
||||
@@ -229,7 +229,7 @@ public class FileChangedEventListener {
|
||||
|
||||
private Optional<Flow> parseFlow(String content, Path entry) {
|
||||
try {
|
||||
Flow flow = yamlFlowParser.parse(content, Flow.class);
|
||||
Flow flow = yamlParser.parse(content, Flow.class);
|
||||
modelValidator.validate(flow);
|
||||
return Optional.of(flow);
|
||||
} catch (ConstraintViolationException e) {
|
||||
|
||||
@@ -2,7 +2,7 @@ package io.kestra.core.repositories;
|
||||
|
||||
import io.kestra.core.models.flows.Flow;
|
||||
import io.kestra.core.models.validations.ModelValidator;
|
||||
import io.kestra.core.serializers.YamlFlowParser;
|
||||
import io.kestra.core.serializers.YamlParser;
|
||||
import io.kestra.core.services.PluginDefaultService;
|
||||
import jakarta.inject.Inject;
|
||||
import jakarta.inject.Singleton;
|
||||
@@ -19,7 +19,6 @@ import java.nio.file.*;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -31,7 +30,7 @@ import static io.kestra.core.utils.Rethrow.throwConsumer;
|
||||
@Slf4j
|
||||
public class LocalFlowRepositoryLoader {
|
||||
@Inject
|
||||
private YamlFlowParser yamlFlowParser;
|
||||
private YamlParser yamlParser;
|
||||
|
||||
@Inject
|
||||
private FlowRepositoryInterface flowRepository;
|
||||
@@ -72,13 +71,13 @@ public class LocalFlowRepositoryLoader {
|
||||
Map<String, Flow> flowByUidInRepository = flowRepository.findAllForAllTenants().stream()
|
||||
.collect(Collectors.toMap(Flow::uidWithoutRevision, Function.identity()));
|
||||
List<Path> list = Files.walk(basePath.toPath())
|
||||
.filter(YamlFlowParser::isValidExtension)
|
||||
.filter(YamlParser::isValidExtension)
|
||||
.toList();
|
||||
|
||||
for (Path file : list) {
|
||||
try {
|
||||
String flowSource = Files.readString(Path.of(file.toFile().getPath()), Charset.defaultCharset());
|
||||
Flow parse = yamlFlowParser.parse(file.toFile(), Flow.class);
|
||||
Flow parse = yamlParser.parse(file.toFile(), Flow.class);
|
||||
modelValidator.validate(parse);
|
||||
|
||||
Flow inRepository = flowByUidInRepository.get(parse.uidWithoutRevision());
|
||||
|
||||
@@ -21,7 +21,7 @@ import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
@Singleton
|
||||
public class YamlFlowParser {
|
||||
public class YamlParser {
|
||||
private static final ObjectMapper STRICT_MAPPER = JacksonMapper.ofYaml()
|
||||
.enable(JsonParser.Feature.STRICT_DUPLICATE_DETECTION)
|
||||
.disable(DeserializationFeature.ADJUST_DATES_TO_CONTEXT_TIME_ZONE);
|
||||
@@ -34,7 +34,7 @@ public class YamlFlowParser {
|
||||
}
|
||||
|
||||
public <T> T parse(String input, Class<T> cls) {
|
||||
return readFlow(input, cls, type(cls));
|
||||
return read(input, cls, type(cls));
|
||||
}
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ public class YamlFlowParser {
|
||||
public <T> T parse(File file, Class<T> cls) throws ConstraintViolationException {
|
||||
try {
|
||||
String input = IOUtils.toString(file.toURI(), StandardCharsets.UTF_8);
|
||||
return readFlow(input, cls, type(cls));
|
||||
return read(input, cls, type(cls));
|
||||
|
||||
} catch (IOException e) {
|
||||
throw new ConstraintViolationException(
|
||||
@@ -77,7 +77,7 @@ public class YamlFlowParser {
|
||||
}
|
||||
}
|
||||
|
||||
private <T> T readFlow(String input, Class<T> objectClass, String resource) {
|
||||
private <T> T read(String input, Class<T> objectClass, String resource) {
|
||||
try {
|
||||
return STRICT_MAPPER.readValue(input, objectClass);
|
||||
} catch (JsonProcessingException e) {
|
||||
@@ -91,8 +91,7 @@ public class YamlFlowParser {
|
||||
private static <T> void jsonProcessingExceptionHandler(T target, String resource, JsonProcessingException e) throws ConstraintViolationException {
|
||||
if (e.getCause() instanceof ConstraintViolationException constraintViolationException) {
|
||||
throw constraintViolationException;
|
||||
}
|
||||
else if (e instanceof InvalidTypeIdException invalidTypeIdException) {
|
||||
} else if (e instanceof InvalidTypeIdException invalidTypeIdException) {
|
||||
// This error is thrown when a non-existing task is used
|
||||
throw new ConstraintViolationException(
|
||||
"Invalid type: " + invalidTypeIdException.getTypeId(),
|
||||
@@ -113,8 +112,7 @@ public class YamlFlowParser {
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
else if (e instanceof UnrecognizedPropertyException unrecognizedPropertyException) {
|
||||
} else if (e instanceof UnrecognizedPropertyException unrecognizedPropertyException) {
|
||||
var message = unrecognizedPropertyException.getOriginalMessage() + unrecognizedPropertyException.getMessageSuffix();
|
||||
throw new ConstraintViolationException(
|
||||
message,
|
||||
@@ -127,8 +125,7 @@ public class YamlFlowParser {
|
||||
null
|
||||
)
|
||||
));
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
throw new ConstraintViolationException(
|
||||
"Illegal "+ resource +" yaml: " + e.getMessage(),
|
||||
Collections.singleton(
|
||||
@@ -136,7 +133,7 @@ public class YamlFlowParser {
|
||||
e.getCause() == null ? e.getMessage() : e.getMessage() + "\nCaused by: " + e.getCause().getMessage(),
|
||||
target,
|
||||
(Class<T>) target.getClass(),
|
||||
"flow",
|
||||
"yaml",
|
||||
null
|
||||
)
|
||||
)
|
||||
@@ -11,7 +11,7 @@ import io.kestra.core.models.triggers.AbstractTrigger;
|
||||
import io.kestra.core.plugins.PluginRegistry;
|
||||
import io.kestra.core.repositories.FlowRepositoryInterface;
|
||||
import io.kestra.core.serializers.JacksonMapper;
|
||||
import io.kestra.core.serializers.YamlFlowParser;
|
||||
import io.kestra.core.serializers.YamlParser;
|
||||
import io.kestra.core.utils.ListUtils;
|
||||
import io.micronaut.core.annotation.Nullable;
|
||||
import jakarta.inject.Inject;
|
||||
@@ -54,7 +54,7 @@ public class FlowService {
|
||||
Optional<FlowRepositoryInterface> flowRepository;
|
||||
|
||||
@Inject
|
||||
YamlFlowParser yamlFlowParser;
|
||||
YamlParser yamlParser;
|
||||
|
||||
@Inject
|
||||
PluginDefaultService pluginDefaultService;
|
||||
@@ -71,7 +71,7 @@ public class FlowService {
|
||||
throw noRepositoryException();
|
||||
}
|
||||
|
||||
FlowWithSource withTenant = yamlFlowParser.parse(source, Flow.class).toBuilder()
|
||||
FlowWithSource withTenant = yamlParser.parse(source, Flow.class).toBuilder()
|
||||
.tenantId(tenantId)
|
||||
.build()
|
||||
.withSource(source);
|
||||
|
||||
@@ -17,7 +17,7 @@ import io.kestra.core.queues.QueueFactoryInterface;
|
||||
import io.kestra.core.queues.QueueInterface;
|
||||
import io.kestra.core.runners.RunContextLogger;
|
||||
import io.kestra.core.serializers.JacksonMapper;
|
||||
import io.kestra.core.serializers.YamlFlowParser;
|
||||
import io.kestra.core.serializers.YamlParser;
|
||||
import io.kestra.core.utils.MapUtils;
|
||||
import io.micronaut.core.annotation.Nullable;
|
||||
import jakarta.annotation.PostConstruct;
|
||||
@@ -54,7 +54,7 @@ public class PluginDefaultService {
|
||||
protected PluginGlobalDefaultConfiguration pluginGlobalDefault;
|
||||
|
||||
@Inject
|
||||
protected YamlFlowParser yamlFlowParser;
|
||||
protected YamlParser yamlParser;
|
||||
|
||||
@Inject
|
||||
@Named(QueueFactoryInterface.WORKERTASKLOG_NAMED)
|
||||
@@ -224,7 +224,7 @@ public class PluginDefaultService {
|
||||
flowAsMap.put("pluginDefaults", pluginDefaults);
|
||||
}
|
||||
|
||||
return yamlFlowParser.parse(flowAsMap, Flow.class, false);
|
||||
return yamlParser.parse(flowAsMap, Flow.class, false);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -3,7 +3,7 @@ package io.kestra.core.models.flows;
|
||||
import io.kestra.core.exceptions.InternalException;
|
||||
import io.kestra.core.models.tasks.Task;
|
||||
import io.kestra.core.models.validations.ModelValidator;
|
||||
import io.kestra.core.serializers.YamlFlowParser;
|
||||
import io.kestra.core.serializers.YamlParser;
|
||||
import io.kestra.plugin.core.debug.Return;
|
||||
import io.kestra.core.utils.TestsUtils;
|
||||
import io.kestra.core.junit.annotations.KestraTest;
|
||||
@@ -22,7 +22,7 @@ import static org.hamcrest.Matchers.*;
|
||||
@KestraTest
|
||||
class FlowTest {
|
||||
@Inject
|
||||
YamlFlowParser yamlFlowParser = new YamlFlowParser();
|
||||
YamlParser yamlParser = new YamlParser();
|
||||
|
||||
@Inject
|
||||
ModelValidator modelValidator;
|
||||
@@ -160,6 +160,6 @@ class FlowTest {
|
||||
|
||||
File file = new File(resource.getFile());
|
||||
|
||||
return yamlFlowParser.parse(file, Flow.class);
|
||||
return yamlParser.parse(file, Flow.class);
|
||||
}
|
||||
}
|
||||
@@ -11,7 +11,7 @@ import io.kestra.core.runners.RunnerUtils;
|
||||
import io.kestra.plugin.core.trigger.Schedule;
|
||||
import io.kestra.core.repositories.TriggerRepositoryInterface;
|
||||
import io.kestra.core.runners.AbstractMemoryRunnerTest;
|
||||
import io.kestra.core.serializers.YamlFlowParser;
|
||||
import io.kestra.core.serializers.YamlParser;
|
||||
import io.kestra.core.services.GraphService;
|
||||
import io.kestra.plugin.core.flow.Switch;
|
||||
import io.kestra.core.utils.GraphUtils;
|
||||
@@ -34,7 +34,7 @@ import static org.hamcrest.Matchers.*;
|
||||
|
||||
class FlowGraphTest extends AbstractMemoryRunnerTest {
|
||||
@Inject
|
||||
private YamlFlowParser yamlFlowParser = new YamlFlowParser();
|
||||
private YamlParser yamlParser = new YamlParser();
|
||||
|
||||
@Inject
|
||||
private GraphService graphService;
|
||||
@@ -296,7 +296,7 @@ class FlowGraphTest extends AbstractMemoryRunnerTest {
|
||||
|
||||
File file = new File(resource.getFile());
|
||||
|
||||
return yamlFlowParser.parse(file, Flow.class).withSource(Files.readString(file.toPath()));
|
||||
return yamlParser.parse(file, Flow.class).withSource(Files.readString(file.toPath()));
|
||||
}
|
||||
|
||||
private AbstractGraph node(FlowGraph flowGraph, String taskId) {
|
||||
|
||||
@@ -31,11 +31,11 @@ import static org.hamcrest.Matchers.*;
|
||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||
|
||||
@KestraTest
|
||||
class YamlFlowParserTest {
|
||||
class YamlParserTest {
|
||||
private static ObjectMapper mapper = JacksonMapper.ofJson();
|
||||
|
||||
@Inject
|
||||
private YamlFlowParser yamlFlowParser;
|
||||
private YamlParser yamlParser;
|
||||
|
||||
@Inject
|
||||
private ModelValidator modelValidator;
|
||||
@@ -212,7 +212,7 @@ class YamlFlowParserTest {
|
||||
TypeReference<Map<String, Object>> TYPE_REFERENCE = new TypeReference<>() {};
|
||||
Map<String, Object> flow = JacksonMapper.ofYaml().readValue(flowSource, TYPE_REFERENCE);
|
||||
|
||||
Flow parse = yamlFlowParser.parse(flow, Flow.class, false);
|
||||
Flow parse = yamlParser.parse(flow, Flow.class, false);
|
||||
|
||||
assertThat(parse.getId(), is("duplicate"));
|
||||
}
|
||||
@@ -244,7 +244,7 @@ class YamlFlowParserTest {
|
||||
|
||||
File file = new File(resource.getFile());
|
||||
|
||||
return yamlFlowParser.parse(file, Flow.class);
|
||||
return yamlParser.parse(file, Flow.class);
|
||||
}
|
||||
|
||||
private Flow parseString(String path) throws IOException {
|
||||
@@ -253,6 +253,6 @@ class YamlFlowParserTest {
|
||||
|
||||
String input = Files.readString(Path.of(resource.getPath()), Charset.defaultCharset());
|
||||
|
||||
return yamlFlowParser.parse(input, Flow.class);
|
||||
return yamlParser.parse(input, Flow.class);
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,7 @@ import io.kestra.plugin.core.condition.ExpressionCondition;
|
||||
import io.kestra.core.models.flows.Flow;
|
||||
import io.kestra.core.models.flows.State;
|
||||
import io.kestra.core.models.topologies.FlowRelation;
|
||||
import io.kestra.core.serializers.YamlFlowParser;
|
||||
import io.kestra.core.serializers.YamlParser;
|
||||
import io.kestra.plugin.core.debug.Return;
|
||||
import io.kestra.plugin.core.flow.Parallel;
|
||||
import io.kestra.plugin.core.flow.Subflow;
|
||||
@@ -33,7 +33,7 @@ class FlowTopologyServiceTest {
|
||||
private FlowTopologyService flowTopologyService;
|
||||
|
||||
@Inject
|
||||
private YamlFlowParser yamlFlowParser = new YamlFlowParser();
|
||||
private YamlParser yamlParser = new YamlParser();
|
||||
|
||||
@Test
|
||||
public void flowTask() {
|
||||
@@ -210,6 +210,6 @@ class FlowTopologyServiceTest {
|
||||
|
||||
File file = new File(resource.getFile());
|
||||
|
||||
return yamlFlowParser.parse(file, Flow.class);
|
||||
return yamlParser.parse(file, Flow.class);
|
||||
}
|
||||
}
|
||||
@@ -16,14 +16,12 @@ import io.kestra.core.models.triggers.PollingTriggerInterface;
|
||||
import io.kestra.core.models.triggers.TriggerContext;
|
||||
import io.kestra.core.models.triggers.TriggerOutput;
|
||||
import io.kestra.core.runners.RunContext;
|
||||
import io.kestra.core.serializers.YamlFlowParser;
|
||||
import io.kestra.core.serializers.YamlParser;
|
||||
import io.kestra.plugin.core.condition.ExpressionCondition;
|
||||
import io.kestra.plugin.core.log.Log;
|
||||
import io.kestra.plugin.core.trigger.Schedule;
|
||||
import jakarta.inject.Inject;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import io.kestra.core.runners.RunContext;
|
||||
import io.kestra.core.junit.annotations.KestraTest;
|
||||
import lombok.*;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
@@ -58,7 +56,7 @@ class PluginDefaultServiceTest {
|
||||
private PluginDefaultService pluginDefaultService;
|
||||
|
||||
@Inject
|
||||
private YamlFlowParser yamlFlowParser;
|
||||
private YamlParser yamlParser;
|
||||
|
||||
@Test
|
||||
void shouldInjectGivenDefaultsIncludingType() {
|
||||
@@ -174,7 +172,7 @@ class PluginDefaultServiceTest {
|
||||
type: io.kestra.core.services.PluginDefaultServiceTest$DefaultTester
|
||||
set: 666""";
|
||||
|
||||
FlowWithSource flow = yamlFlowParser.parse(source, Flow.class)
|
||||
FlowWithSource flow = yamlParser.parse(source, Flow.class)
|
||||
.withSource(source)
|
||||
.toBuilder()
|
||||
.pluginDefaults(List.of(
|
||||
@@ -218,7 +216,7 @@ class PluginDefaultServiceTest {
|
||||
type: io.kestra.core.services.PluginDefaultServiceTest$DefaultTester
|
||||
set: 666""";
|
||||
|
||||
FlowWithSource flow = yamlFlowParser.parse(source, Flow.class)
|
||||
FlowWithSource flow = yamlParser.parse(source, Flow.class)
|
||||
.withSource(source)
|
||||
.toBuilder()
|
||||
.pluginDefaults(List.of(
|
||||
@@ -258,7 +256,7 @@ class PluginDefaultServiceTest {
|
||||
type: io.kestra.core.services.PluginDefaultServiceTest$DefaultTester
|
||||
set: 666""";
|
||||
|
||||
FlowWithSource flow = yamlFlowParser.parse(source, Flow.class)
|
||||
FlowWithSource flow = yamlParser.parse(source, Flow.class)
|
||||
.withSource(source)
|
||||
.toBuilder()
|
||||
.pluginDefaults(List.of(
|
||||
@@ -293,7 +291,7 @@ class PluginDefaultServiceTest {
|
||||
type: io.kestra.core.services.PluginDefaultServiceTest$DefaultTester
|
||||
set: 666""";
|
||||
|
||||
FlowWithSource flow = yamlFlowParser.parse(source, Flow.class)
|
||||
FlowWithSource flow = yamlParser.parse(source, Flow.class)
|
||||
.withSource(source)
|
||||
.toBuilder()
|
||||
.pluginDefaults(List.of(
|
||||
@@ -319,7 +317,7 @@ class PluginDefaultServiceTest {
|
||||
type: io.kestra.core.services.PluginDefaultServiceTest$DefaultTester
|
||||
set: 666""";
|
||||
|
||||
FlowWithSource flow = yamlFlowParser.parse(source, Flow.class)
|
||||
FlowWithSource flow = yamlParser.parse(source, Flow.class)
|
||||
.withSource(source)
|
||||
.toBuilder()
|
||||
.pluginDefaults(List.of(
|
||||
@@ -346,7 +344,7 @@ class PluginDefaultServiceTest {
|
||||
message: testing
|
||||
level: INFO""";
|
||||
|
||||
FlowWithSource flow = yamlFlowParser.parse(source, Flow.class)
|
||||
FlowWithSource flow = yamlParser.parse(source, Flow.class)
|
||||
.withSource(source)
|
||||
.toBuilder()
|
||||
.pluginDefaults(List.of(
|
||||
|
||||
@@ -2,7 +2,7 @@ package io.kestra.core.validations;
|
||||
|
||||
import io.kestra.core.models.flows.Flow;
|
||||
import io.kestra.core.models.validations.ModelValidator;
|
||||
import io.kestra.core.serializers.YamlFlowParser;
|
||||
import io.kestra.core.serializers.YamlParser;
|
||||
import io.kestra.core.utils.TestsUtils;
|
||||
import io.kestra.core.junit.annotations.KestraTest;
|
||||
import jakarta.inject.Inject;
|
||||
@@ -22,7 +22,7 @@ class FlowValidationTest {
|
||||
@Inject
|
||||
private ModelValidator modelValidator;
|
||||
@Inject
|
||||
private YamlFlowParser yamlFlowParser = new YamlFlowParser();
|
||||
private YamlParser yamlParser = new YamlParser();
|
||||
|
||||
@Test
|
||||
void invalidRecursiveFlow() {
|
||||
@@ -57,6 +57,6 @@ class FlowValidationTest {
|
||||
|
||||
File file = new File(resource.getFile());
|
||||
|
||||
return yamlFlowParser.parse(file, Flow.class);
|
||||
return yamlParser.parse(file, Flow.class);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import io.kestra.core.models.flows.State;
|
||||
import io.kestra.core.models.validations.ModelValidator;
|
||||
import io.kestra.core.queues.QueueException;
|
||||
import io.kestra.core.runners.AbstractMemoryRunnerTest;
|
||||
import io.kestra.core.serializers.YamlFlowParser;
|
||||
import io.kestra.core.serializers.YamlParser;
|
||||
import io.kestra.core.utils.TestsUtils;
|
||||
import jakarta.inject.Inject;
|
||||
import org.junit.jupiter.api.Test;
|
||||
@@ -23,7 +23,7 @@ import static org.hamcrest.Matchers.is;
|
||||
|
||||
public class DagTest extends AbstractMemoryRunnerTest {
|
||||
@Inject
|
||||
YamlFlowParser yamlFlowParser = new YamlFlowParser();
|
||||
YamlParser yamlParser = new YamlParser();
|
||||
|
||||
@Inject
|
||||
ModelValidator modelValidator;
|
||||
@@ -70,6 +70,6 @@ public class DagTest extends AbstractMemoryRunnerTest {
|
||||
|
||||
File file = new File(resource.getFile());
|
||||
|
||||
return yamlFlowParser.parse(file, Flow.class);
|
||||
return yamlParser.parse(file, Flow.class);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -21,7 +21,7 @@ import io.kestra.core.models.validations.ValidateConstraintViolation;
|
||||
import io.kestra.core.repositories.FlowRepositoryInterface;
|
||||
import io.kestra.core.repositories.FlowTopologyRepositoryInterface;
|
||||
import io.kestra.core.serializers.JacksonMapper;
|
||||
import io.kestra.core.serializers.YamlFlowParser;
|
||||
import io.kestra.core.serializers.YamlParser;
|
||||
import io.kestra.core.services.FlowService;
|
||||
import io.kestra.core.services.GraphService;
|
||||
import io.kestra.core.services.PluginDefaultService;
|
||||
@@ -90,7 +90,7 @@ public class FlowController {
|
||||
private FlowService flowService;
|
||||
|
||||
@Inject
|
||||
private YamlFlowParser yamlFlowParser;
|
||||
private YamlParser yamlParser;
|
||||
|
||||
@Inject
|
||||
private GraphService graphService;
|
||||
@@ -135,7 +135,7 @@ public class FlowController {
|
||||
@Parameter(description = "The flow") @Body String flow,
|
||||
@Parameter(description = "The subflow tasks to display") @Nullable @QueryValue List<String> subflows
|
||||
) throws ConstraintViolationException, IllegalVariableEvaluationException {
|
||||
FlowWithSource flowParsed = yamlFlowParser.parse(flow, Flow.class).withSource(flow);
|
||||
FlowWithSource flowParsed = yamlParser.parse(flow, Flow.class).withSource(flow);
|
||||
|
||||
return graphService.flowGraph(flowParsed, subflows);
|
||||
}
|
||||
@@ -248,7 +248,7 @@ public class FlowController {
|
||||
public HttpResponse<FlowWithSource> create(
|
||||
@Parameter(description = "The flow") @Body String flow
|
||||
) throws ConstraintViolationException {
|
||||
Flow flowParsed = yamlFlowParser.parse(flow, Flow.class);
|
||||
Flow flowParsed = yamlParser.parse(flow, Flow.class);
|
||||
|
||||
return HttpResponse.ok(doCreate(flowParsed, flow));
|
||||
}
|
||||
@@ -291,7 +291,7 @@ public class FlowController {
|
||||
namespace,
|
||||
sources
|
||||
.stream()
|
||||
.map(flow -> FlowWithSource.of(yamlFlowParser.parse(flow, Flow.class), flow.trim()))
|
||||
.map(flow -> FlowWithSource.of(yamlParser.parse(flow, Flow.class), flow.trim()))
|
||||
.toList(),
|
||||
delete
|
||||
);
|
||||
@@ -419,7 +419,7 @@ public class FlowController {
|
||||
|
||||
return HttpResponse.status(HttpStatus.NOT_FOUND);
|
||||
}
|
||||
Flow flowParsed = yamlFlowParser.parse(flow, Flow.class);
|
||||
Flow flowParsed = yamlParser.parse(flow, Flow.class);
|
||||
|
||||
return HttpResponse.ok(update(flowParsed, existingFlow.get(), flow));
|
||||
}
|
||||
@@ -468,7 +468,7 @@ public class FlowController {
|
||||
null,
|
||||
sources
|
||||
.stream()
|
||||
.map(flow -> FlowWithSource.of(yamlFlowParser.parse(flow, Flow.class), flow.trim()))
|
||||
.map(flow -> FlowWithSource.of(yamlParser.parse(flow, Flow.class), flow.trim()))
|
||||
.toList(),
|
||||
delete
|
||||
);
|
||||
@@ -566,7 +566,7 @@ public class FlowController {
|
||||
validateConstraintViolationBuilder.index(index.getAndIncrement());
|
||||
|
||||
try {
|
||||
Flow flowParse = yamlFlowParser.parse(flow, Flow.class);
|
||||
Flow flowParse = yamlParser.parse(flow, Flow.class);
|
||||
Integer sentRevision = flowParse.getRevision();
|
||||
if (sentRevision != null) {
|
||||
Integer lastRevision = Optional.ofNullable(flowRepository.lastRevision(tenantService.resolveTenant(), flowParse.getNamespace(), flowParse.getId()))
|
||||
@@ -656,10 +656,10 @@ public class FlowController {
|
||||
|
||||
try {
|
||||
if (section == TaskValidationType.TASKS) {
|
||||
Task taskParse = yamlFlowParser.parse(task, Task.class);
|
||||
Task taskParse = yamlParser.parse(task, Task.class);
|
||||
modelValidator.validate(taskParse);
|
||||
} else if (section == TaskValidationType.TRIGGERS) {
|
||||
AbstractTrigger triggerParse = yamlFlowParser.parse(task, AbstractTrigger.class);
|
||||
AbstractTrigger triggerParse = yamlParser.parse(task, AbstractTrigger.class);
|
||||
modelValidator.validate(triggerParse);
|
||||
}
|
||||
} catch (ConstraintViolationException e) {
|
||||
|
||||
@@ -6,7 +6,7 @@ import io.kestra.core.models.validations.ManualConstraintViolation;
|
||||
import io.kestra.core.models.validations.ModelValidator;
|
||||
import io.kestra.core.models.validations.ValidateConstraintViolation;
|
||||
import io.kestra.core.repositories.TemplateRepositoryInterface;
|
||||
import io.kestra.core.serializers.YamlFlowParser;
|
||||
import io.kestra.core.serializers.YamlParser;
|
||||
import io.kestra.core.tenant.TenantService;
|
||||
import io.kestra.webserver.controllers.domain.IdWithNamespace;
|
||||
import io.kestra.webserver.responses.BulkResponse;
|
||||
@@ -244,7 +244,7 @@ public class TemplateController {
|
||||
ValidateConstraintViolation.ValidateConstraintViolationBuilder<?, ?> validateConstraintViolationBuilder = ValidateConstraintViolation.builder();
|
||||
validateConstraintViolationBuilder.index(index.getAndIncrement());
|
||||
try {
|
||||
Template templateParse = new YamlFlowParser().<Template>parse(template, Template.class);
|
||||
Template templateParse = new YamlParser().<Template>parse(template, Template.class);
|
||||
|
||||
validateConstraintViolationBuilder.flow(templateParse.getId());
|
||||
validateConstraintViolationBuilder.namespace(templateParse.getNamespace());
|
||||
@@ -354,7 +354,7 @@ public class TemplateController {
|
||||
if (fileName.endsWith(".yaml") || fileName.endsWith(".yml")) {
|
||||
List<String> sources = List.of(new String(fileUpload.getBytes()).split("---"));
|
||||
for (String source : sources) {
|
||||
Template parsed = new YamlFlowParser().parse(source, Template.class);
|
||||
Template parsed = new YamlParser().parse(source, Template.class);
|
||||
importTemplate(parsed);
|
||||
}
|
||||
} else if (fileName.endsWith(".zip")) {
|
||||
@@ -366,7 +366,7 @@ public class TemplateController {
|
||||
}
|
||||
|
||||
String source = new String(archive.readAllBytes());
|
||||
Template parsed = new YamlFlowParser().parse(source, Template.class);
|
||||
Template parsed = new YamlParser().parse(source, Template.class);
|
||||
importTemplate(parsed);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ package io.kestra.webserver.services;
|
||||
|
||||
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.services.PluginDefaultService;
|
||||
import io.kestra.core.utils.NamespaceUtils;
|
||||
import io.kestra.core.utils.VersionProvider;
|
||||
@@ -46,7 +46,7 @@ public class FlowAutoLoaderService {
|
||||
protected HttpClient httpClient;
|
||||
|
||||
@Inject
|
||||
private YamlFlowParser yamlFlowParser;
|
||||
private YamlParser yamlParser;
|
||||
|
||||
@Inject
|
||||
private NamespaceUtils namespaceUtils;
|
||||
@@ -78,7 +78,7 @@ public class FlowAutoLoaderService {
|
||||
})
|
||||
)
|
||||
.map(source -> {
|
||||
Flow flow = yamlFlowParser.parse(source, Flow.class);
|
||||
Flow flow = yamlParser.parse(source, Flow.class);
|
||||
repository.create(flow, source, pluginDefaultService.injectDefaults(flow.withSource(source)));
|
||||
log.debug("Loaded flow '{}/{}'.", flow.getNamespace(), flow.getId());
|
||||
return 1;
|
||||
|
||||
@@ -11,7 +11,7 @@ import io.kestra.core.models.hierarchies.FlowGraph;
|
||||
import io.kestra.core.models.tasks.Task;
|
||||
import io.kestra.core.models.validations.ValidateConstraintViolation;
|
||||
import io.kestra.core.serializers.JacksonMapper;
|
||||
import io.kestra.core.serializers.YamlFlowParser;
|
||||
import io.kestra.core.serializers.YamlParser;
|
||||
import io.kestra.plugin.core.debug.Return;
|
||||
import io.kestra.plugin.core.flow.Sequential;
|
||||
import io.kestra.core.utils.IdUtils;
|
||||
@@ -33,7 +33,6 @@ import org.hamcrest.Matchers;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.platform.commons.annotation.Testable;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
@@ -78,7 +77,7 @@ class FlowControllerTest extends JdbcH2ControllerTest {
|
||||
@Test
|
||||
void id() {
|
||||
String result = client.toBlocking().retrieve(HttpRequest.GET("/api/v1/flows/io.kestra.tests/full"), String.class);
|
||||
Flow flow = new YamlFlowParser().parse(result, Flow.class);
|
||||
Flow flow = new YamlParser().parse(result, Flow.class);
|
||||
assertThat(flow.getId(), is("full"));
|
||||
assertThat(flow.getTasks().size(), is(5));
|
||||
}
|
||||
@@ -315,7 +314,7 @@ class FlowControllerTest extends JdbcH2ControllerTest {
|
||||
assertThat(e.getStatus(), is(NOT_FOUND));
|
||||
|
||||
String deletedResult = client.toBlocking().retrieve(HttpRequest.GET("/api/v1/flows/" + flow.getNamespace() + "/" + flow.getId() + "?allowDeleted=true"), String.class);
|
||||
Flow deletedFlow = new YamlFlowParser().parse(deletedResult, Flow.class);
|
||||
Flow deletedFlow = new YamlParser().parse(deletedResult, Flow.class);
|
||||
|
||||
assertThat(deletedFlow.isDeleted(), is(true));
|
||||
}
|
||||
@@ -926,7 +925,7 @@ class FlowControllerTest extends JdbcH2ControllerTest {
|
||||
}
|
||||
|
||||
private Flow parseFlow(String flow) {
|
||||
return new YamlFlowParser().parse(flow, Flow.class);
|
||||
return new YamlParser().parse(flow, Flow.class);
|
||||
}
|
||||
|
||||
private String generateFlowAsString(String friendlyId, String namespace, String format) {
|
||||
|
||||
Reference in New Issue
Block a user