feat(build): fix some sonar alert

This commit is contained in:
Ludovic DEHON
2025-04-20 00:46:54 +02:00
parent a7836ca673
commit b2ae2ff6f7
127 changed files with 512 additions and 535 deletions

View File

@@ -31,6 +31,8 @@ jobs:
steps:
- uses: actions/checkout@v4
name: Checkout - Current ref
with:
fetch-depth: 0
# Setup build
- uses: kestra-io/actions/.github/actions/setup-build@main

View File

@@ -129,7 +129,7 @@ class FlowCreateOrUpdateCommandTest {
};
Integer call = PicocliRunner.call(FlowUpdatesCommand.class, ctx, args);
assertThat(call).isEqualTo(0);
assertThat(call).isZero();
assertThat(out.toString()).contains("1 flow(s)");
}
}

View File

@@ -24,7 +24,7 @@ class FlowDotCommandTest {
};
Integer call = PicocliRunner.call(FlowDotCommand.class, ctx, args);
assertThat(call).isEqualTo(0);
assertThat(call).isZero();
assertThat(out.toString()).contains("\"root.date\"[shape=box];");
}
}

View File

@@ -22,7 +22,7 @@ class FlowExpandCommandTest {
};
Integer call = PicocliRunner.call(FlowExpandCommand.class, ctx, args);
assertThat(call).isEqualTo(0);
assertThat(call).isZero();
assertThat(out.toString()).isEqualTo("id: include\n" +
"namespace: io.kestra.cli\n" +
"\n" +

View File

@@ -55,7 +55,7 @@ class FlowExportCommandTest {
};
PicocliRunner.call(FlowExportCommand.class, ctx, exportArgs);
File file = new File("/tmp/flows.zip");
assertThat(file.exists()).isEqualTo(true);
assertThat(file.exists()).isTrue();
ZipFile zipFile = new ZipFile(file);
// When launching the test in a suite, there is 4 flows but when lauching individualy there is only 3

View File

@@ -169,7 +169,7 @@ class FlowUpdatesCommandTest {
};
Integer call = PicocliRunner.call(FlowUpdatesCommand.class, ctx, args);
assertThat(call).isEqualTo(0);
assertThat(call).isZero();
assertThat(out.toString()).contains("1 flow(s)");
}
}

View File

@@ -22,7 +22,7 @@ class FlowValidateCommandTest {
};
Integer call = PicocliRunner.call(FlowValidateCommand.class, ctx, args);
assertThat(call).isEqualTo(0);
assertThat(call).isZero();
assertThat(out.toString()).contains("✓ - io.kestra.cli / include");
}
}
@@ -39,7 +39,7 @@ class FlowValidateCommandTest {
};
Integer call = PicocliRunner.call(FlowValidateCommand.class, ctx, args);
assertThat(call).isEqualTo(0);
assertThat(call).isZero();
assertThat(out.toString()).contains("✓ - system / warning");
assertThat(out.toString()).contains("⚠ - tasks[0] is deprecated");
assertThat(out.toString()).contains(" - io.kestra.core.tasks.log.Log is replaced by io.kestra.plugin.core.log.Log");

View File

@@ -19,7 +19,7 @@ class FlowNamespaceCommandTest {
String[] args = {};
Integer call = PicocliRunner.call(FlowNamespaceCommand.class, ctx, args);
assertThat(call).isEqualTo(0);
assertThat(call).isZero();
assertThat(out.toString()).contains("Usage: kestra flow namespace");
}
}

View File

@@ -162,7 +162,7 @@ class FlowNamespaceUpdateCommandTest {
};
Integer call = PicocliRunner.call(FlowNamespaceUpdateCommand.class, ctx, args);
assertThat(call).isEqualTo(0);
assertThat(call).isZero();
assertThat(out.toString()).contains("1 flow(s)");
}
}

View File

@@ -19,7 +19,7 @@ class NamespaceCommandTest {
String[] args = {};
Integer call = PicocliRunner.call(NamespaceCommand.class, ctx, args);
assertThat(call).isEqualTo(0);
assertThat(call).isZero();
assertThat(out.toString()).contains("Usage: kestra namespace");
}
}

View File

@@ -19,7 +19,7 @@ class NamespaceFilesCommandTest {
String[] args = {};
Integer call = PicocliRunner.call(NamespaceFilesCommand.class, ctx, args);
assertThat(call).isEqualTo(0);
assertThat(call).isZero();
assertThat(out.toString()).contains("Usage: kestra namespace files");
}
}

View File

@@ -19,7 +19,7 @@ class KvCommandTest {
String[] args = {};
Integer call = PicocliRunner.call(KvCommand.class, ctx, args);
assertThat(call).isEqualTo(0);
assertThat(call).isZero();
assertThat(out.toString()).contains("Usage: kestra namespace kv");
}
}

View File

@@ -46,7 +46,7 @@ class PluginDocCommandTest {
assertThat(files.size()).isEqualTo(1);
assertThat(files.getFirst().getFileName().toString()).isEqualTo("plugin-template-test");
var directory = files.getFirst().toFile();
assertThat(directory.isDirectory()).isEqualTo(true);
assertThat(directory.isDirectory()).isTrue();
assertThat(directory.listFiles().length).isEqualTo(3);
var readme = directory.toPath().resolve("index.md");

View File

@@ -42,7 +42,7 @@ class ReindexCommandTest {
"flow",
};
Integer call = PicocliRunner.call(ReindexCommand.class, ctx, reindexArgs);
assertThat(call).isEqualTo(0);
assertThat(call).isZero();
// in local it reindex 3 flows and in CI 4 for an unknown reason
assertThat(out.toString()).contains("Successfully reindex");
}

View File

@@ -19,7 +19,7 @@ class DatabaseCommandTest {
String[] args = {};
Integer call = PicocliRunner.call(DatabaseCommand.class, ctx, args);
assertThat(call).isEqualTo(0);
assertThat(call).isZero();
assertThat(out.toString()).contains("Usage: kestra sys database");
}
}

View File

@@ -20,7 +20,7 @@ class StateStoreCommandTest {
String[] args = {};
Integer call = PicocliRunner.call(StateStoreCommand.class, ctx, args);
assertThat(call).isEqualTo(0);
assertThat(call).isZero();
assertThat(out.toString()).contains("Usage: kestra sys state-store");
}
}

View File

@@ -53,7 +53,7 @@ class StateStoreMigrateCommandTest {
oldStateStoreUri,
new ByteArrayInputStream("my-value".getBytes())
);
assertThat(storage.exists(tenantId, flow.getNamespace(), oldStateStoreUri)).isEqualTo(true);
assertThat(storage.exists(tenantId, flow.getNamespace(), oldStateStoreUri)).isTrue();
RunContext runContext = ctx.getBean(RunContextFactory.class).of(flow, Map.of("flow", Map.of(
"tenantId", tenantId,
@@ -67,9 +67,9 @@ class StateStoreMigrateCommandTest {
Integer call = PicocliRunner.call(StateStoreMigrateCommand.class, ctx, args);
assertThat(new String(stateStore.getState(true, "my-state", "sub-name", "my-taskrun-value").readAllBytes())).isEqualTo("my-value");
assertThat(storage.exists(tenantId, flow.getNamespace(), oldStateStoreUri)).isEqualTo(false);
assertThat(storage.exists(tenantId, flow.getNamespace(), oldStateStoreUri)).isFalse();
assertThat(call).isEqualTo(0);
assertThat(call).isZero();
}
}
}

View File

@@ -54,7 +54,7 @@ class TemplateExportCommandTest {
};
PicocliRunner.call(TemplateExportCommand.class, ctx, exportArgs);
File file = new File("/tmp/templates.zip");
assertThat(file.exists()).isEqualTo(true);
assertThat(file.exists()).isTrue();
ZipFile zipFile = new ZipFile(file);
assertThat(zipFile.stream().count()).isEqualTo(3L);

View File

@@ -13,7 +13,7 @@ import java.util.Map;
import static org.assertj.core.api.Assertions.assertThat;
public class TemplateValidateCommandTest {
class TemplateValidateCommandTest {
@Test
void runLocal() {
URL directory = TemplateValidateCommandTest.class.getClassLoader().getResource("invalidsTemplates/template.yml");

View File

@@ -19,7 +19,7 @@ class TemplateNamespaceCommandTest {
String[] args = {};
Integer call = PicocliRunner.call(TemplateNamespaceCommand.class, ctx, args);
assertThat(call).isEqualTo(0);
assertThat(call).isZero();
assertThat(out.toString()).contains("Usage: kestra template namespace");
}
}

View File

@@ -27,7 +27,7 @@ class DeleteConfigurationApplicationListenersTest {
);
try (ApplicationContext ctx = ApplicationContext.run(mapPropertySource, Environment.CLI, Environment.TEST)) {
assertThat(tempFile.exists()).isEqualTo(false);
assertThat(tempFile.exists()).isFalse();
}
}
}

View File

@@ -39,30 +39,6 @@ import java.util.Optional;
@NoArgsConstructor
@JsonDeserialize
public class GenericFlow extends AbstractFlow implements HasUID {
private String id;
private String namespace;
private Integer revision;
private List<Input<?>> inputs;
private Map<String, Object> variables;
@Builder.Default
private boolean disabled = false;
@Builder.Default
private boolean deleted = false;
@JsonSerialize(using = ListOrMapOfLabelSerializer.class)
@JsonDeserialize(using = ListOrMapOfLabelDeserializer.class)
@Schema(implementation = Object.class, oneOf = {List.class, Map.class})
private List<Label> labels;
private String tenantId;
private String source;
private List<SLA> sla;
@@ -84,7 +60,6 @@ public class GenericFlow extends AbstractFlow implements HasUID {
* @return a new {@link GenericFlow}
* @throws DeserializationException if source cannot be deserialized.
*/
@VisibleForTesting
public static GenericFlow of(final FlowInterface flow) throws DeserializationException {
return fromYaml(flow.getTenantId(), flow.sourceOrGenerateIfNull());
}

View File

@@ -71,7 +71,7 @@ class ClassPluginDocumentationTest {
// map
Map<String, Object> childInputMap = (Map<String, Object>) childInput.get("map");
assertThat((String) (childInputMap).get("type")).isEqualTo("object");
assertThat((Boolean) (childInputMap).get("$dynamic")).isEqualTo(true);
assertThat((Boolean) (childInputMap).get("$dynamic")).isTrue();
assertThat(((Map<String, String>) (childInputMap).get("additionalProperties")).get("type")).isEqualTo("number");
// output
@@ -151,18 +151,18 @@ class ClassPluginDocumentationTest {
List<Map<String, Object>> anyOf = (List<Map<String, Object>>) number.get("anyOf");
assertThat(anyOf).hasSize(2);
assertThat(anyOf.getFirst().get("type")).isEqualTo("integer");
assertThat(anyOf.getFirst().get("$dynamic")).isEqualTo(true);
assertThat((Boolean) anyOf.getFirst().get("$dynamic")).isTrue();
assertThat(anyOf.get(1).get("type")).isEqualTo("string");
// assertThat(anyOf.get(1).get("pattern"), is(".*{{.*}}.*"));
Map<String, Object> withDefault = (Map<String, Object>) properties.get("withDefault");
assertThat(withDefault.get("type")).isEqualTo("string");
assertThat(withDefault.get("default")).isEqualTo("Default Value");
assertThat(withDefault.get("$dynamic")).isEqualTo(true);
assertThat((Boolean) withDefault.get("$dynamic")).isTrue();
Map<String, Object> internalStorageURI = (Map<String, Object>) properties.get("uri");
assertThat(internalStorageURI.get("type")).isEqualTo("string");
assertThat(internalStorageURI.get("$internalStorageURI")).isEqualTo(true);
assertThat((Boolean) internalStorageURI.get("$internalStorageURI")).isTrue();
}));
}
}

View File

@@ -29,7 +29,7 @@ class ExecutionTest {
.withState(State.Type.RUNNING)
))
.build()
)).isEqualTo(true);
)).isTrue();
}
@Test
@@ -44,7 +44,7 @@ class ExecutionTest {
assertThat(execution.hasTaskRunJoinable(TASK_RUN
.state(new State())
.build()
)).isEqualTo(false);
)).isFalse();
}
@Test
@@ -61,7 +61,7 @@ class ExecutionTest {
assertThat(execution.hasTaskRunJoinable(TASK_RUN
.state(new State(State.Type.RUNNING, new State()))
.build()
)).isEqualTo(false);
)).isFalse();
}
@Test
@@ -81,7 +81,7 @@ class ExecutionTest {
.withState(State.Type.RUNNING)
))
.build()
)).isEqualTo(false);
)).isFalse();
}
@Test
@@ -102,7 +102,7 @@ class ExecutionTest {
.withState(State.Type.SUCCESS)
))
.build()
)).isEqualTo(true);
)).isTrue();
}
@Test
@@ -125,7 +125,7 @@ class ExecutionTest {
.withState(State.Type.RUNNING)
))
.build()
)).isEqualTo(true);
)).isTrue();
}
@Test

View File

@@ -33,7 +33,7 @@ class FlowTest {
Flow flow = this.parse("flows/invalids/duplicate.yaml");
Optional<ConstraintViolationException> validate = modelValidator.isValid(flow);
assertThat(validate.isPresent()).isEqualTo(true);
assertThat(validate.isPresent()).isTrue();
assertThat(validate.get().getConstraintViolations().size()).isEqualTo(1);
assertThat(validate.get().getMessage()).contains("Duplicate task id with name [date, listen]");
@@ -45,7 +45,7 @@ class FlowTest {
Flow flow = this.parse("flows/invalids/duplicate-inputs.yaml");
Optional<ConstraintViolationException> validate = modelValidator.isValid(flow);
assertThat(validate.isPresent()).isEqualTo(true);
assertThat(validate.isPresent()).isTrue();
assertThat(validate.get().getConstraintViolations().size()).isEqualTo(1);
assertThat(validate.get().getMessage()).contains("Duplicate input with name [first_input]");
@@ -56,7 +56,7 @@ class FlowTest {
Flow flow = this.parse("flows/invalids/duplicate-parallel.yaml");
Optional<ConstraintViolationException> validate = modelValidator.isValid(flow);
assertThat(validate.isPresent()).isEqualTo(true);
assertThat(validate.isPresent()).isTrue();
assertThat(validate.get().getConstraintViolations().size()).isEqualTo(1);
assertThat(validate.get().getMessage()).contains("Duplicate task id with name [t3]");
@@ -68,7 +68,7 @@ class FlowTest {
Flow updated = this.parse("flows/invalids/duplicate.yaml");
Optional<ConstraintViolationException> validate = flow.validateUpdate(updated);
assertThat(validate.isPresent()).isEqualTo(true);
assertThat(validate.isPresent()).isTrue();
assertThat(validate.get().getConstraintViolations().size()).isEqualTo(1);
assertThat(validate.get().getMessage()).contains("Illegal flow id update");
@@ -80,7 +80,7 @@ class FlowTest {
Flow flow = this.parse("flows/invalids/switch-invalid.yaml");
Optional<ConstraintViolationException> validate = modelValidator.isValid(flow);
assertThat(validate.isPresent()).isEqualTo(true);
assertThat(validate.isPresent()).isTrue();
assertThat(validate.get().getConstraintViolations().size()).isEqualTo(1);
assertThat(validate.get().getMessage()).contains("impossible: No task defined, neither cases or default have any tasks");
@@ -91,7 +91,7 @@ class FlowTest {
Flow flow = this.parse("flows/invalids/workingdirectory-invalid.yaml");
Optional<ConstraintViolationException> validate = modelValidator.isValid(flow);
assertThat(validate.isPresent()).isEqualTo(true);
assertThat(validate.isPresent()).isTrue();
assertThat(validate.get().getConstraintViolations().size()).isEqualTo(1);
assertThat(validate.get().getMessage()).contains("impossible: Only runnable tasks are allowed as children of a WorkingDirectory task");
@@ -102,7 +102,7 @@ class FlowTest {
Flow flow = this.parse("flows/invalids/workingdirectory-no-tasks.yaml");
Optional<ConstraintViolationException> validate = modelValidator.isValid(flow);
assertThat(validate.isPresent()).isEqualTo(true);
assertThat(validate.isPresent()).isTrue();
assertThat(validate.get().getConstraintViolations().size()).isEqualTo(2);
assertThat(validate.get().getMessage()).contains("impossible: The 'tasks' property cannot be empty");
@@ -129,7 +129,7 @@ class FlowTest {
Flow flow = this.parse("flows/invalids/worker-group.yaml");
Optional<ConstraintViolationException> validate = modelValidator.isValid(flow);
assertThat(validate.isPresent()).isEqualTo(true);
assertThat(validate.isPresent()).isTrue();
assertThat(validate.get().getConstraintViolations().size()).isEqualTo(1);
assertThat(validate.get().getMessage()).isEqualTo("tasks[0].workerGroup: Worker Group is an Enterprise Edition functionality\n");
@@ -148,7 +148,7 @@ class FlowTest {
Flow flow = this.parse("flows/invalids/inputs-validation.yaml");
Optional<ConstraintViolationException> validate = modelValidator.isValid(flow);
assertThat(validate.isPresent()).isEqualTo(true);
assertThat(validate.isPresent()).isTrue();
assertThat(validate.get().getConstraintViolations().size()).isEqualTo(2);
assertThat(validate.get().getMessage()).contains("file: no `defaults` can be set for inputs of type 'FILE'");
@@ -164,13 +164,13 @@ class FlowTest {
triggerInputsReverseOrder.put("c", "d");
triggerInputsReverseOrder.put("a", "b");
Flow flowABis = baseFlow().toBuilder().revision(2).triggers(List.of(io.kestra.plugin.core.trigger.Flow.builder().inputs(triggerInputsReverseOrder).build())).build();
assertThat(flowA.equalsWithoutRevision(flowABis)).isEqualTo(true);
assertThat(flowA.equalsWithoutRevision(flowABis)).isTrue();
Flow flowB = baseFlow().toBuilder().id("b").build();
assertThat(flowA.equalsWithoutRevision(flowB)).isEqualTo(false);
assertThat(flowA.equalsWithoutRevision(flowB)).isFalse();
Flow flowAnotherTenant = baseFlow().toBuilder().tenantId("b").build();
assertThat(flowA.equalsWithoutRevision(flowAnotherTenant)).isEqualTo(false);
assertThat(flowA.equalsWithoutRevision(flowAnotherTenant)).isFalse();
}
private static Flow baseFlow() {

View File

@@ -134,7 +134,7 @@ class FlowWithSourceTest {
String expectedSource = flow.sourceOrGenerateIfNull() + " # additional comment";
FlowWithSource of = FlowWithSource.of(flow, expectedSource);
assertThat(of.equalsWithoutRevision(flow)).isEqualTo(true);
assertThat(of.equalsWithoutRevision(flow)).isTrue();
assertThat(of.getSource()).isEqualTo(expectedSource);
}
}

View File

@@ -53,7 +53,7 @@ class FlowGraphTest {
assertThat(flowGraph.getNodes().size()).isEqualTo(5);
assertThat(flowGraph.getEdges().size()).isEqualTo(4);
assertThat(flowGraph.getClusters().size()).isEqualTo(0);
assertThat(flowGraph.getClusters().size()).isZero();
assertThat(((AbstractGraphTask) flowGraph.getNodes().get(2)).getTask().getId()).isEqualTo("date");
assertThat(((AbstractGraphTask) flowGraph.getNodes().get(2)).getRelationType()).isEqualTo(RelationType.SEQUENTIAL);
@@ -228,7 +228,7 @@ class FlowGraphTest {
assertThat(flowGraph.getEdges().size()).isEqualTo(5);
assertThat(flowGraph.getClusters().size()).isEqualTo(1);
AbstractGraph triggerGraph = flowGraph.getNodes().stream().filter(e -> e instanceof GraphTrigger).findFirst().orElseThrow();
assertThat(((GraphTrigger) triggerGraph).getTrigger().getDisabled()).isEqualTo(true);
assertThat(((GraphTrigger) triggerGraph).getTrigger().getDisabled()).isTrue();
}
@Test

View File

@@ -50,17 +50,17 @@ class ScriptServiceTest {
command = ScriptService.replaceInternalStorage(runContext, "my command with an internal storage file: " + internalStorageUri, false);
Matcher matcher = COMMAND_PATTERN_CAPTURE_LOCAL_PATH.matcher(command);
assertThat(matcher.matches()).isEqualTo(true);
assertThat(matcher.matches()).isTrue();
Path absoluteLocalFilePath = Path.of(matcher.group(1));
localFile = absoluteLocalFilePath.toFile();
assertThat(localFile.exists()).isEqualTo(true);
assertThat(localFile.exists()).isTrue();
command = ScriptService.replaceInternalStorage(runContext, "my command with an internal storage file: " + internalStorageUri, true);
matcher = COMMAND_PATTERN_CAPTURE_LOCAL_PATH.matcher(command);
assertThat(matcher.matches()).isEqualTo(true);
assertThat(matcher.matches()).isTrue();
String relativePath = matcher.group(1);
assertThat(relativePath).doesNotStartWith("/");
assertThat(runContext.workingDir().resolve(Path.of(relativePath)).toFile().exists()).isEqualTo(true);
assertThat(runContext.workingDir().resolve(Path.of(relativePath)).toFile().exists()).isTrue();
} finally {
localFile.delete();
path.toFile().delete();
@@ -94,18 +94,18 @@ class ScriptServiceTest {
assertThat(commands.getFirst(), not(is("my command with an internal storage file: " + internalStorageUri)));
Matcher matcher = COMMAND_PATTERN_CAPTURE_LOCAL_PATH.matcher(commands.getFirst());
assertThat(matcher.matches()).isEqualTo(true);
assertThat(matcher.matches()).isTrue();
File file = Path.of(matcher.group(1)).toFile();
assertThat(file.exists()).isEqualTo(true);
assertThat(file.exists()).isTrue();
filesToDelete.add(file);
assertThat(commands.get(1)).isEqualTo("my command with some additional var usage: " + wdir);
commands = ScriptService.replaceInternalStorage(runContext, Collections.emptyMap(), List.of("my command with an internal storage file: " + internalStorageUri), true);
matcher = COMMAND_PATTERN_CAPTURE_LOCAL_PATH.matcher(commands.getFirst());
assertThat(matcher.matches()).isEqualTo(true);
assertThat(matcher.matches()).isTrue();
file = runContext.workingDir().resolve(Path.of(matcher.group(1))).toFile();
assertThat(file.exists()).isEqualTo(true);
assertThat(file.exists()).isTrue();
filesToDelete.add(file);
} catch (IllegalVariableEvaluationException e) {
throw new RuntimeException(e);

View File

@@ -123,14 +123,14 @@ public abstract class AbstractMultipleConditionStorageTest {
assertThat(window.getFlowId()).isEqualTo(pair.getLeft().getId());
window = multipleConditionStorage.getOrCreate(pair.getKey(), pair.getRight(), Collections.emptyMap());
assertThat(window.getResults().get("a")).isEqualTo(true);
assertThat(window.getResults().get("a")).isTrue();
Thread.sleep(2005);
MultipleConditionWindow next = multipleConditionStorage.getOrCreate(pair.getKey(), pair.getRight(), Collections.emptyMap());
assertThat(next.getStart().format(DateTimeFormatter.ISO_DATE_TIME)).isNotEqualTo(window.getStart().format(DateTimeFormatter.ISO_DATE_TIME));
assertThat(next.getResults().containsKey("a")).isEqualTo(false);
assertThat(next.getResults().containsKey("a")).isFalse();
}
@Test
@@ -144,10 +144,10 @@ public abstract class AbstractMultipleConditionStorageTest {
assertThat(window.getFlowId()).isEqualTo(pair.getLeft().getId());
window = multipleConditionStorage.getOrCreate(pair.getKey(), pair.getRight(), Collections.emptyMap());
assertThat(window.getResults().get("a")).isEqualTo(true);
assertThat(window.getResults().get("a")).isTrue();
List<MultipleConditionWindow> expired = multipleConditionStorage.expired(null);
assertThat(expired.size()).isEqualTo(0);
assertThat(expired.size()).isZero();
Thread.sleep(2005);
@@ -166,10 +166,10 @@ public abstract class AbstractMultipleConditionStorageTest {
assertThat(window.getFlowId()).isEqualTo(pair.getLeft().getId());
window = multipleConditionStorage.getOrCreate(pair.getKey(), pair.getRight(), Collections.emptyMap());
assertThat(window.getResults().get("a")).isEqualTo(true);
assertThat(window.getResults().get("a")).isTrue();
List<MultipleConditionWindow> expired = multipleConditionStorage.expired(null);
assertThat(expired.size()).isEqualTo(0);
assertThat(expired.size()).isZero();
Thread.sleep(2005);
@@ -206,10 +206,10 @@ public abstract class AbstractMultipleConditionStorageTest {
assertThat(window.getFlowId()).isEqualTo(pair.getLeft().getId());
window = multipleConditionStorage.getOrCreate(pair.getKey(), pair.getRight(), Collections.emptyMap());
assertThat(window.getResults().get("a")).isEqualTo(true);
assertThat(window.getResults().get("a")).isTrue();
List<MultipleConditionWindow> expired = multipleConditionStorage.expired(null);
assertThat(expired.size()).isEqualTo(0);
assertThat(expired.size()).isZero();
}
@Test
@@ -223,10 +223,10 @@ public abstract class AbstractMultipleConditionStorageTest {
assertThat(window.getFlowId()).isEqualTo(pair.getLeft().getId());
window = multipleConditionStorage.getOrCreate(pair.getKey(), pair.getRight(), Collections.emptyMap());
assertThat(window.getResults().get("a")).isEqualTo(true);
assertThat(window.getResults().get("a")).isTrue();
List<MultipleConditionWindow> expired = multipleConditionStorage.expired(null);
assertThat(expired.size()).isEqualTo(0);
assertThat(expired.size()).isZero();
}
private static Pair<Flow, MultipleCondition> mockFlow(TimeWindow sla) {

View File

@@ -297,7 +297,7 @@ public abstract class AbstractExecutionRepositoryTest {
executionRepository.save(ExecutionFixture.EXECUTION_1);
Optional<Execution> full = executionRepository.findById(null, ExecutionFixture.EXECUTION_1.getId());
assertThat(full.isPresent()).isEqualTo(true);
assertThat(full.isPresent()).isTrue();
full.ifPresent(current -> {
assertThat(full.get().getId()).isEqualTo(ExecutionFixture.EXECUTION_1.getId());
@@ -309,12 +309,12 @@ public abstract class AbstractExecutionRepositoryTest {
executionRepository.save(ExecutionFixture.EXECUTION_1);
Optional<Execution> full = executionRepository.findById(null, ExecutionFixture.EXECUTION_1.getId());
assertThat(full.isPresent()).isEqualTo(true);
assertThat(full.isPresent()).isTrue();
executionRepository.purge(ExecutionFixture.EXECUTION_1);
full = executionRepository.findById(null, ExecutionFixture.EXECUTION_1.getId());
assertThat(full.isPresent()).isEqualTo(false);
assertThat(full.isPresent()).isFalse();
}
@Test
@@ -322,12 +322,12 @@ public abstract class AbstractExecutionRepositoryTest {
executionRepository.save(ExecutionFixture.EXECUTION_1);
Optional<Execution> full = executionRepository.findById(null, ExecutionFixture.EXECUTION_1.getId());
assertThat(full.isPresent()).isEqualTo(true);
assertThat(full.isPresent()).isTrue();
executionRepository.delete(ExecutionFixture.EXECUTION_1);
full = executionRepository.findById(null, ExecutionFixture.EXECUTION_1.getId());
assertThat(full.isPresent()).isEqualTo(false);
assertThat(full.isPresent()).isFalse();
}
@Test
@@ -720,7 +720,7 @@ public abstract class AbstractExecutionRepositoryTest {
executionRepository.update(updated);
Optional<Execution> validation = executionRepository.findById(null, updated.getId());
assertThat(validation.isPresent()).isEqualTo(true);
assertThat(validation.isPresent()).isTrue();
assertThat(validation.get().getLabels().size()).isEqualTo(1);
assertThat(validation.get().getLabels().getFirst()).isEqualTo(label);
}
@@ -734,7 +734,7 @@ public abstract class AbstractExecutionRepositoryTest {
executionRepository.save(latest);
Optional<Execution> result = executionRepository.findLatestForStates(null, "io.kestra.unittest", "full", List.of(State.Type.CREATED));
assertThat(result.isPresent()).isEqualTo(true);
assertThat(result.isPresent()).isTrue();
assertThat(result.get().getId()).isEqualTo(latest.getId());
}

View File

@@ -134,6 +134,6 @@ public abstract class AbstractExecutionServiceTest {
null
);
assertThat(purge.getExecutionsCount()).isEqualTo(0);
assertThat(purge.getExecutionsCount()).isZero();
}
}

View File

@@ -82,11 +82,11 @@ public abstract class AbstractFlowRepositoryTest {
flow = flowRepository.create(GenericFlow.of(flow));
try {
Optional<Flow> full = flowRepository.findById(null, flow.getNamespace(), flow.getId());
assertThat(full.isPresent()).isEqualTo(true);
assertThat(full.isPresent()).isTrue();
assertThat(full.get().getRevision()).isEqualTo(1);
full = flowRepository.findById(null, flow.getNamespace(), flow.getId(), Optional.empty());
assertThat(full.isPresent()).isEqualTo(true);
assertThat(full.isPresent()).isTrue();
} finally {
deleteFlow(flow);
}
@@ -100,11 +100,11 @@ public abstract class AbstractFlowRepositoryTest {
flow = flowRepository.create(GenericFlow.of(flow));
try {
Optional<Flow> full = flowRepository.findByIdWithoutAcl(null, flow.getNamespace(), flow.getId(), Optional.empty());
assertThat(full.isPresent()).isEqualTo(true);
assertThat(full.isPresent()).isTrue();
assertThat(full.get().getRevision()).isEqualTo(1);
full = flowRepository.findByIdWithoutAcl(null, flow.getNamespace(), flow.getId(), Optional.empty());
assertThat(full.isPresent()).isEqualTo(true);
assertThat(full.isPresent()).isTrue();
} finally {
deleteFlow(flow);
}
@@ -120,7 +120,7 @@ public abstract class AbstractFlowRepositoryTest {
try {
Optional<FlowWithSource> full = flowRepository.findByIdWithSource(null, flow.getNamespace(), flow.getId());
assertThat(full.isPresent()).isEqualTo(true);
assertThat(full.isPresent()).isTrue();
full.ifPresent(current -> {
assertThat(full.get().getRevision()).isEqualTo(1);
@@ -273,7 +273,7 @@ public abstract class AbstractFlowRepositoryTest {
FlowWithSource save = flowRepository.create(GenericFlow.of(flow));
try {
assertThat(flowRepository.findById(null, save.getNamespace(), save.getId()).isPresent()).isEqualTo(true);
assertThat(flowRepository.findById(null, save.getNamespace(), save.getId()).isPresent()).isTrue();
} catch (Throwable e) {
deleteFlow(save);
throw e;
@@ -281,8 +281,8 @@ public abstract class AbstractFlowRepositoryTest {
Flow delete = flowRepository.delete(save);
assertThat(flowRepository.findById(null, flow.getNamespace(), flow.getId()).isPresent()).isEqualTo(false);
assertThat(flowRepository.findById(null, flow.getNamespace(), flow.getId(), Optional.of(save.getRevision())).isPresent()).isEqualTo(true);
assertThat(flowRepository.findById(null, flow.getNamespace(), flow.getId()).isPresent()).isFalse();
assertThat(flowRepository.findById(null, flow.getNamespace(), flow.getId(), Optional.of(save.getRevision())).isPresent()).isTrue();
List<FlowWithSource> revisions = flowRepository.findRevisions(null, flow.getNamespace(), flow.getId());
assertThat(revisions.getLast().getRevision()).isEqualTo(delete.getRevision());
@@ -302,7 +302,7 @@ public abstract class AbstractFlowRepositoryTest {
Flow save = flowRepository.create(GenericFlow.of(flow));
try {
assertThat(flowRepository.findById(null, flow.getNamespace(), flow.getId()).isPresent()).isEqualTo(true);
assertThat(flowRepository.findById(null, flow.getNamespace(), flow.getId()).isPresent()).isTrue();
Flow update = Flow.builder()
.id(IdUtils.create())
@@ -339,7 +339,7 @@ public abstract class AbstractFlowRepositoryTest {
flow = flowRepository.create(GenericFlow.of(flow));
try {
assertThat(flowRepository.findById(null, flow.getNamespace(), flow.getId()).isPresent()).isEqualTo(true);
assertThat(flowRepository.findById(null, flow.getNamespace(), flow.getId()).isPresent()).isTrue();
Flow update = Flow.builder()
.id(flowId)
@@ -377,7 +377,7 @@ public abstract class AbstractFlowRepositoryTest {
Flow save = flowRepository.create(GenericFlow.of(flow));
try {
assertThat(flowRepository.findById(null, flow.getNamespace(), flow.getId()).isPresent()).isEqualTo(true);
assertThat(flowRepository.findById(null, flow.getNamespace(), flow.getId()).isPresent()).isTrue();
} finally {
deleteFlow(save);
}
@@ -420,8 +420,8 @@ public abstract class AbstractFlowRepositoryTest {
try {
Optional<Flow> found = flowRepository.findById(null, flow.getNamespace(), flow.getId());
assertThat(found.isPresent()).isEqualTo(true);
assertThat(found.get() instanceof FlowWithException).isEqualTo(true);
assertThat(found.isPresent()).isTrue();
assertThat(found.get() instanceof FlowWithException).isTrue();
assertThat(((FlowWithException) found.get()).getException()).contains("Templates are disabled");
} finally {
deleteFlow(flow);

View File

@@ -44,7 +44,7 @@ public abstract class AbstractLogRepositoryTest {
LogEntry.LogEntryBuilder builder = logEntry(Level.INFO);
ArrayListTotal<LogEntry> find = logRepository.find(Pageable.UNPAGED, null, null);
assertThat(find.size()).isEqualTo(0);
assertThat(find.size()).isZero();
LogEntry save = logRepository.save(builder.build());
@@ -63,7 +63,7 @@ public abstract class AbstractLogRepositoryTest {
.value(Instant.now().minus(1, ChronoUnit.HOURS))
.build());
find = logRepository.find(Pageable.UNPAGED, "doe", filters);
assertThat(find.size()).isEqualTo(0);
assertThat(find.size()).isZero();
find = logRepository.find(Pageable.UNPAGED, null, null);
assertThat(find.size()).isEqualTo(1);
@@ -101,7 +101,7 @@ public abstract class AbstractLogRepositoryTest {
assertThat(countDeleted).isEqualTo(1);
list = logRepository.findByExecutionIdAndTaskId(null, save.getExecutionId(), save.getTaskId(), null);
assertThat(list.size()).isEqualTo(0);
assertThat(list.size()).isZero();
}
@Test
@@ -147,7 +147,7 @@ public abstract class AbstractLogRepositoryTest {
find = logRepository.findByExecutionIdAndTaskRunId(null, executionId, logEntry2.getTaskRunId(), null, Pageable.from(10, 10));
assertThat(find.size()).isEqualTo(0);
assertThat(find.size()).isZero();
}
@Test
@@ -158,14 +158,14 @@ public abstract class AbstractLogRepositoryTest {
logRepository.deleteByQuery(null, log1.getExecutionId(), null, (String) null, null, null);
ArrayListTotal<LogEntry> find = logRepository.findByExecutionId(null, log1.getExecutionId(), null, Pageable.from(1, 50));
assertThat(find.size()).isEqualTo(0);
assertThat(find.size()).isZero();
logRepository.save(log1);
logRepository.deleteByQuery(null, "io.kestra.unittest", "flowId", List.of(Level.TRACE, Level.DEBUG, Level.INFO), null, ZonedDateTime.now().plusMinutes(1));
find = logRepository.findByExecutionId(null, log1.getExecutionId(), null, Pageable.from(1, 50));
assertThat(find.size()).isEqualTo(0);
assertThat(find.size()).isZero();
}
@Test
@@ -176,14 +176,14 @@ public abstract class AbstractLogRepositoryTest {
logRepository.deleteByQuery(null, log1.getExecutionId(), null, (String) null, null, null);
ArrayListTotal<LogEntry> find = logRepository.findByExecutionId(null, log1.getExecutionId(), null, Pageable.from(1, 50));
assertThat(find.size()).isEqualTo(0);
assertThat(find.size()).isZero();
logRepository.save(log1);
logRepository.deleteByQuery(null, "io.kestra.unittest", "flowId", null);
find = logRepository.findByExecutionId(null, log1.getExecutionId(), null, Pageable.from(1, 50));
assertThat(find.size()).isEqualTo(0);
assertThat(find.size()).isZero();
}
@Test

View File

@@ -24,13 +24,13 @@ public abstract class AbstractSettingRepositoryTest {
.build();
Optional<Setting> find = settingRepository.findByKey(setting.getKey());
assertThat(find.isPresent()).isEqualTo(false);
assertThat(find.isPresent()).isFalse();
Setting save = settingRepository.save(setting);
find = settingRepository.findByKey(save.getKey());
assertThat(find.isPresent()).isEqualTo(true);
assertThat(find.isPresent()).isTrue();
assertThat(find.get().getValue()).isEqualTo(save.getValue());
List<Setting> all = settingRepository.findAll();
@@ -41,9 +41,9 @@ public abstract class AbstractSettingRepositoryTest {
assertThat(delete.getValue()).isEqualTo(setting.getValue());
all = settingRepository.findAll();
assertThat(all.size()).isEqualTo(0);
assertThat(all.size()).isZero();
find = settingRepository.findByKey(setting.getKey());
assertThat(find.isPresent()).isEqualTo(false);
assertThat(find.isPresent()).isFalse();
}
}

View File

@@ -50,11 +50,11 @@ public abstract class AbstractTemplateRepositoryTest {
templateRepository.create(template);
Optional<Template> full = templateRepository.findById(null, template.getNamespace(), template.getId());
assertThat(full.isPresent()).isEqualTo(true);
assertThat(full.isPresent()).isTrue();
assertThat(full.get().getId()).isEqualTo(template.getId());
full = templateRepository.findById(null, template.getNamespace(), template.getId());
assertThat(full.isPresent()).isEqualTo(true);
assertThat(full.isPresent()).isTrue();
assertThat(full.get().getId()).isEqualTo(template.getId());
}
@@ -133,7 +133,7 @@ public abstract class AbstractTemplateRepositoryTest {
Template save = templateRepository.create(template);
templateRepository.delete(save);
assertThat(templateRepository.findById(null, template.getNamespace(), template.getId()).isPresent()).isEqualTo(false);
assertThat(templateRepository.findById(null, template.getNamespace(), template.getId()).isPresent()).isFalse();
assertThat(TemplateListener.getEmits().size()).isEqualTo(2);
assertThat(TemplateListener.getEmits().stream().filter(r -> r.getType() == CrudEventType.CREATE).count()).isEqualTo(1L);

View File

@@ -35,20 +35,20 @@ public abstract class AbstractTriggerRepositoryTest {
Trigger.TriggerBuilder<?, ?> builder = trigger();
Optional<Trigger> findLast = triggerRepository.findLast(builder.build());
assertThat(findLast.isPresent()).isEqualTo(false);
assertThat(findLast.isPresent()).isFalse();
Trigger save = triggerRepository.save(builder.build());
findLast = triggerRepository.findLast(save);
assertThat(findLast.isPresent()).isEqualTo(true);
assertThat(findLast.isPresent()).isTrue();
assertThat(findLast.get().getExecutionId()).isEqualTo(save.getExecutionId());
save = triggerRepository.save(builder.executionId(IdUtils.create()).build());
findLast = triggerRepository.findLast(save);
assertThat(findLast.isPresent()).isEqualTo(true);
assertThat(findLast.isPresent()).isTrue();
assertThat(findLast.get().getExecutionId()).isEqualTo(save.getExecutionId());

View File

@@ -54,7 +54,7 @@ public class ChangeStateTestCase {
Execution markedAs = executionService.markAs(execution, flow, execution.getTaskRunList().getFirst().getId(), State.Type.SUCCESS);
executionQueue.emit(markedAs);
assertThat(latch.await(10, TimeUnit.SECONDS)).isEqualTo(true);
assertThat(latch.await(10, TimeUnit.SECONDS)).isTrue();
receivedExecutions.blockLast();
assertThat(lastExecution.get().getState().getCurrent()).isEqualTo(State.Type.SUCCESS);
assertThat(lastExecution.get().getTaskRunList()).hasSize(2);
@@ -80,7 +80,7 @@ public class ChangeStateTestCase {
assertThat(execution.getTaskRunList().getFirst().getState().getCurrent()).isEqualTo(State.Type.FAILED);
// assert on the subflow
assertThat(latch.await(10, TimeUnit.SECONDS)).isEqualTo(true);
assertThat(latch.await(10, TimeUnit.SECONDS)).isTrue();
receivedExecutions.blockLast();
assertThat(lastExecution.get().getState().getCurrent()).isEqualTo(State.Type.FAILED);
assertThat(lastExecution.get().getTaskRunList()).hasSize(1);
@@ -103,7 +103,7 @@ public class ChangeStateTestCase {
executionQueue.emit(markedAs);
// assert for the parent flow
assertThat(parentLatch.await(10, TimeUnit.SECONDS)).isEqualTo(true);
assertThat(parentLatch.await(10, TimeUnit.SECONDS)).isTrue();
receivedExecutions.blockLast();
assertThat(lastParentExecution.get().getState().getCurrent()).isEqualTo(State.Type.FAILED); // FIXME should be success but it's FAILED on unit tests
assertThat(lastParentExecution.get().getTaskRunList()).hasSize(1);

View File

@@ -40,7 +40,7 @@ public class FlowConcurrencyCaseTest {
Execution execution1 = runnerUtils.runOneUntilRunning(null, "io.kestra.tests", "flow-concurrency-cancel", null, null, Duration.ofSeconds(30));
Execution execution2 = runnerUtils.runOne(null, "io.kestra.tests", "flow-concurrency-cancel");
assertThat(execution1.getState().isRunning()).isEqualTo(true);
assertThat(execution1.getState().isRunning()).isTrue();
assertThat(execution2.getState().getCurrent()).isEqualTo(State.Type.CANCELLED);
CountDownLatch latch1 = new CountDownLatch(1);
@@ -63,7 +63,7 @@ public class FlowConcurrencyCaseTest {
Execution execution1 = runnerUtils.runOneUntilRunning(null, "io.kestra.tests", "flow-concurrency-fail", null, null, Duration.ofSeconds(30));
Execution execution2 = runnerUtils.runOne(null, "io.kestra.tests", "flow-concurrency-fail");
assertThat(execution1.getState().isRunning()).isEqualTo(true);
assertThat(execution1.getState().isRunning()).isTrue();
assertThat(execution2.getState().getCurrent()).isEqualTo(State.Type.FAILED);
CountDownLatch latch1 = new CountDownLatch(1);
@@ -90,7 +90,7 @@ public class FlowConcurrencyCaseTest {
Execution execution2 = Execution.newExecution(flow, null, null, Optional.empty());
executionQueue.emit(execution2);
assertThat(execution1.getState().isRunning()).isEqualTo(true);
assertThat(execution1.getState().isRunning()).isTrue();
assertThat(execution2.getState().getCurrent()).isEqualTo(State.Type.CREATED);
var executionResult1 = new AtomicReference<Execution>();
@@ -170,7 +170,7 @@ public class FlowConcurrencyCaseTest {
Execution execution2 = Execution.newExecution(flow, null, null, Optional.empty());
executionQueue.emit(execution2);
assertThat(execution1.getState().isPaused()).isEqualTo(true);
assertThat(execution1.getState().isPaused()).isTrue();
assertThat(execution2.getState().getCurrent()).isEqualTo(State.Type.CREATED);
assertTrue(firstExecutionLatch.await(10, TimeUnit.SECONDS));
@@ -222,7 +222,7 @@ public class FlowConcurrencyCaseTest {
Execution execution2 = Execution.newExecution(flow, null, null, Optional.empty());
executionQueue.emit(execution2);
assertThat(execution1.getState().isPaused()).isEqualTo(true);
assertThat(execution1.getState().isPaused()).isTrue();
assertThat(execution2.getState().getCurrent()).isEqualTo(State.Type.CREATED);
assertTrue(firstExecLatch.await(10, TimeUnit.SECONDS));

View File

@@ -51,15 +51,15 @@ abstract public class FlowListenersTest {
// initial state
wait(ref, () -> {
assertThat(count.get()).isEqualTo(0);
assertThat(flowListenersService.flows().size()).isEqualTo(0);
assertThat(count.get()).isZero();
assertThat(flowListenersService.flows().size()).isZero();
});
// resend on startup done for kafka
if (flowListenersService.getClass().getName().equals("io.kestra.ee.runner.kafka.KafkaFlowListeners")) {
wait(ref, () -> {
assertThat(count.get()).isEqualTo(0);
assertThat(flowListenersService.flows().size()).isEqualTo(0);
assertThat(count.get()).isZero();
assertThat(flowListenersService.flows().size()).isZero();
});
}

View File

@@ -119,7 +119,7 @@ public class InputsTest {
HashMap<String, Object> inputsWithMissingOptionalInput = new HashMap<>(inputs);
inputsWithMissingOptionalInput.remove("bool");
assertThat(typedInputs(inputsWithMissingOptionalInput).containsKey("bool")).isEqualTo(true);
assertThat(typedInputs(inputsWithMissingOptionalInput).containsKey("bool")).isTrue();
assertThat(typedInputs(inputsWithMissingOptionalInput).get("bool")).isNull();
}
@@ -132,7 +132,7 @@ public class InputsTest {
assertThat(typeds.get("string")).isEqualTo("myString");
assertThat(typeds.get("int")).isEqualTo(42);
assertThat(typeds.get("float")).isEqualTo(42.42F);
assertThat(typeds.get("bool")).isEqualTo(false);
assertThat((Boolean) typeds.get("bool")).isFalse();
assertThat(typeds.get("instant")).isEqualTo(Instant.parse("2019-10-06T18:27:49Z"));
assertThat(typeds.get("instantDefaults")).isEqualTo(Instant.parse("2013-08-09T14:19:00Z"));
assertThat(typeds.get("date")).isEqualTo(LocalDate.parse("2019-10-06"));
@@ -143,7 +143,7 @@ public class InputsTest {
assertThat(typeds.get("json")).isEqualTo(Map.of("a", "b"));
assertThat(typeds.get("uri")).isEqualTo("https://www.google.com");
assertThat(((Map<String, Object>) typeds.get("nested")).get("string")).isEqualTo("a string");
assertThat(((Map<String, Object>) typeds.get("nested")).get("bool")).isEqualTo(true);
assertThat((Boolean) ((Map<String, Object>) typeds.get("nested")).get("bool")).isTrue();
assertThat(((Map<String, Object>) ((Map<String, Object>) typeds.get("nested")).get("more")).get("int")).isEqualTo(123);
assertThat(typeds.get("validatedString")).isEqualTo("A123");
assertThat(typeds.get("validatedInt")).isEqualTo(12);
@@ -173,7 +173,7 @@ public class InputsTest {
assertThat(typeds.get("enum")).isEqualTo("ENUM_VALUE");
assertThat(typeds.get("int")).isEqualTo(42);
assertThat(typeds.get("float")).isEqualTo(42.42F);
assertThat(typeds.get("bool")).isEqualTo(false);
assertThat((Boolean) typeds.get("bool")).isFalse();
}
@Test
@@ -345,7 +345,7 @@ public class InputsTest {
Map<String, Object> typeds = typedInputs(map);
assertThat(typeds.get("json")).isInstanceOf(Map.class);
assertThat(((Map<?, ?>) typeds.get("json")).size()).isEqualTo(0);
assertThat(((Map<?, ?>) typeds.get("json")).size()).isZero();
}
@Test
@@ -366,7 +366,7 @@ public class InputsTest {
assertThat(execution.getState().getCurrent()).isEqualTo(State.Type.SUCCESS);
assertThat(execution.getInputs().get("json")).isInstanceOf(Map.class);
assertThat(((Map<?, ?>) execution.getInputs().get("json")).size()).isEqualTo(0);
assertThat(((Map<?, ?>) execution.getInputs().get("json")).size()).isZero();
assertThat((String) execution.findTaskRunsByTaskId("jsonOutput").getFirst().getOutputs().get("value")).isEqualTo("{}");
}

View File

@@ -52,7 +52,7 @@ class LocalWorkingDirTest {
String workingDirId = IdUtils.create();
TestWorkingDir workingDirectory = new TestWorkingDir(workingDirId, new LocalWorkingDir(Path.of("/tmp/sub/dir/tmp/"), workingDirId));
Path tempFile = workingDirectory.createTempFile();
assertThat(tempFile.toFile().getAbsolutePath().startsWith("/tmp/sub/dir/tmp/")).isEqualTo(true);
assertThat(tempFile.toFile().getAbsolutePath().startsWith("/tmp/sub/dir/tmp/")).isTrue();
assertThat(workingDirectory.getAllCreatedTempFiles().size()).isEqualTo(1);
}
@@ -62,8 +62,8 @@ class LocalWorkingDirTest {
TestWorkingDir workingDirectory = new TestWorkingDir(workingDirId, new LocalWorkingDir(Path.of("/tmp/sub/dir/tmp/"), workingDirId));
Path path = workingDirectory.createFile("folder/file.txt");
assertThat(path.toFile().getAbsolutePath().startsWith("/tmp/sub/dir/tmp/")).isEqualTo(true);
assertThat(path.toFile().getAbsolutePath().endsWith("/folder/file.txt")).isEqualTo(true);
assertThat(path.toFile().getAbsolutePath().startsWith("/tmp/sub/dir/tmp/")).isTrue();
assertThat(path.toFile().getAbsolutePath().endsWith("/folder/file.txt")).isTrue();
assertThat(workingDirectory.getAllCreatedFiles().size()).isEqualTo(1);
}
@@ -111,13 +111,13 @@ class LocalWorkingDirTest {
workingDir.cleanup();
// Then
assertThat(file.toFile().exists()).isEqualTo(false);
assertThat(firtPath.toFile().exists()).isEqualTo(false);
assertThat(file.toFile().exists()).isFalse();
assertThat(firtPath.toFile().exists()).isFalse();
// When
Path secondPath = workingDir.path(true);
// Then
assertThat(secondPath.toFile().exists()).isEqualTo(true);
assertThat(secondPath.toFile().exists()).isTrue();
assertThat(firtPath).isEqualTo(secondPath);
}

View File

@@ -59,7 +59,7 @@ public class NoEncryptionConfiguredTest implements TestPropertyProvider {
@Test
@LoadFlows({"flows/valids/inputs.yaml"})
void secretInput() {
assertThat(flowRepository.findById(null, "io.kestra.tests", "inputs").isPresent()).isEqualTo(true);
assertThat(flowRepository.findById(null, "io.kestra.tests", "inputs").isPresent()).isTrue();
Flow flow = flowRepository.findById(null, "io.kestra.tests", "inputs").get();
Execution execution = Execution.builder()

View File

@@ -39,6 +39,6 @@ public class NullOutputTest {
assertThat(execution.getState().getCurrent()).isEqualTo(State.Type.SUCCESS);
assertThat(execution.getTaskRunList()).hasSize(1);
assertThat(execution.getTaskRunList().getFirst().getOutputs()).hasSize(1);
assertThat(execution.getTaskRunList().getFirst().getOutputs().containsKey("value")).isEqualTo(true);
assertThat(execution.getTaskRunList().getFirst().getOutputs().containsKey("value")).isTrue();
}
}

View File

@@ -23,6 +23,6 @@ class WorkingDirFactoryTest {
// When
Path path = workingDirectory.path();
// Then
assertThat(path.toFile().getAbsolutePath().startsWith("/tmp/sub/dir/tmp/")).isEqualTo(true);
assertThat(path.toFile().getAbsolutePath().startsWith("/tmp/sub/dir/tmp/")).isTrue();
}
}

View File

@@ -21,6 +21,6 @@ class EndsWithFilterTest {
variableRenderer.render("{{ \"Hello World\" | endsWith(\"World\") }}", Map.of())
);
assertThat(render).isEqualTo(true);
assertThat(render).isTrue();
}
}

View File

@@ -19,6 +19,6 @@ public class Md5FilterTest {
void out() throws IllegalVariableEvaluationException {
String render = variableRenderer.render("{{ \"hello\" | md5 }}", Map.of());
assertThat(render.equals("hello")).isEqualTo(false);
assertThat(render.equals("hello")).isFalse();
}
}

View File

@@ -19,6 +19,6 @@ public class Sha1FilterTest {
void out() throws IllegalVariableEvaluationException {
String render = variableRenderer.render("{{ \"hello\" | sha1 }}", Map.of());
assertThat(render.equals("hello")).isEqualTo(false);
assertThat(render.equals("hello")).isFalse();
}
}

View File

@@ -19,6 +19,6 @@ public class Sha512FilterTest {
void out() throws IllegalVariableEvaluationException {
String render = variableRenderer.render("{{ \"hello\" | sha512 }}", Map.of());
assertThat(render.equals("hello")).isEqualTo(false);
assertThat(render.equals("hello")).isFalse();
}
}

View File

@@ -21,6 +21,6 @@ class StartsWithFilterTest {
variableRenderer.render("{{ \"Hello World\" | startsWith(\"Hello\") }}", Map.of())
);
assertThat(render).isEqualTo(true);
assertThat(render).isTrue();
}
}

View File

@@ -194,7 +194,7 @@ public class SchedulerScheduleTest extends AbstractSchedulerTest {
return optionalTrigger.filter(value -> value.getNextExecutionDate() != null).isPresent();
}, Duration.ofSeconds(1), Duration.ofSeconds(60));
assertThat(this.triggerState.findLast(trigger).get().getNextExecutionDate().isAfter(trigger.getDate())).isEqualTo(true);
assertThat(this.triggerState.findLast(trigger).get().getNextExecutionDate().isAfter(trigger.getDate())).isTrue();
}
}
@@ -412,7 +412,7 @@ public class SchedulerScheduleTest extends AbstractSchedulerTest {
Trigger lastTrigger = this.triggerState.findLast(trigger).get();
// Nothing changed because nothing happened
assertThat(lastTrigger.getNextExecutionDate().truncatedTo(ChronoUnit.HOURS).isEqual(now)).isEqualTo(true);
assertThat(lastTrigger.getNextExecutionDate().truncatedTo(ChronoUnit.HOURS).isEqual(now)).isTrue();
}
}

View File

@@ -30,20 +30,20 @@ public abstract class SchedulerTriggerStateInterfaceTest {
Trigger.TriggerBuilder<?, ?> builder = trigger();
Optional<Trigger> find = triggerState.findLast(builder.build());
assertThat(find.isPresent()).isEqualTo(false);
assertThat(find.isPresent()).isFalse();
Trigger save = triggerState.update(builder.build());
find = triggerState.findLast(save);
assertThat(find.isPresent()).isEqualTo(true);
assertThat(find.isPresent()).isTrue();
assertThat(find.get().getExecutionId()).isEqualTo(save.getExecutionId());
save = triggerState.update(builder.executionId(IdUtils.create()).build());
find = triggerState.findLast(save);
assertThat(find.isPresent()).isEqualTo(true);
assertThat(find.isPresent()).isTrue();
assertThat(find.get().getExecutionId()).isEqualTo(save.getExecutionId());
}
}

View File

@@ -104,25 +104,25 @@ class ObjectMapperFactoryTest {
Bean.class
);
assertThat(bean.intNull).isEqualTo(0);
assertThat(bean.intDefault).isEqualTo(0);
assertThat(bean.intNull).isZero();
assertThat(bean.intDefault).isZero();
assertThat(bean.intChange).isEqualTo(1);
assertThat(bean.integerNull).isNull();
assertThat(bean.integerDefault).isEqualTo(0);
assertThat(bean.integerDefault).isZero();
assertThat(bean.integerChange).isEqualTo(1);
assertThat(bean.boolNull).isEqualTo(false);
assertThat(bean.boolDefaultTrue).isEqualTo(true);
assertThat(bean.boolChangeTrue).isEqualTo(false);
assertThat(bean.boolDefaultFalse).isEqualTo(false);
assertThat(bean.boolChangeFalse).isEqualTo(true);
assertThat(bean.boolNull).isFalse();
assertThat(bean.boolDefaultTrue).isTrue();
assertThat(bean.boolChangeTrue).isFalse();
assertThat(bean.boolDefaultFalse).isFalse();
assertThat(bean.boolChangeFalse).isTrue();
assertThat(bean.booleanNull).isNull();
assertThat(bean.booleanDefaultTrue).isEqualTo(true);
assertThat(bean.booleanChangeTrue).isEqualTo(false);
assertThat(bean.booleanDefaultFalse).isEqualTo(false);
assertThat(bean.booleanChangeFalse).isEqualTo(true);
assertThat(bean.booleanDefaultTrue).isTrue();
assertThat(bean.booleanChangeTrue).isFalse();
assertThat(bean.booleanDefaultFalse).isFalse();
assertThat(bean.booleanChangeFalse).isTrue();
assertThat(bean.stringNull).isNull();
assertThat(bean.stringDefault).isEqualTo("bla");

View File

@@ -220,7 +220,7 @@ class YamlParserTest {
Flow parse = this.parse("flows/invalids/invalid-parallel.yaml");
Optional<ConstraintViolationException> valid = modelValidator.isValid(parse);
assertThat(valid.isPresent()).isEqualTo(true);
assertThat(valid.isPresent()).isTrue();
assertThat(valid.get().getConstraintViolations().size()).isEqualTo(10);
assertThat(new ArrayList<>(valid.get().getConstraintViolations()).stream().filter(r -> r.getMessage().contains("must not be empty")).count()).isEqualTo(3L);
}

View File

@@ -61,7 +61,7 @@ class ConditionServiceTest {
boolean valid = conditionService.valid(flow, conditions, conditionContext);
assertThat(valid).isEqualTo(true);
assertThat(valid).isTrue();
}
@Test

View File

@@ -69,7 +69,7 @@ class FlowServiceTest {
assertThat(importFlow.getTasks().getFirst().getId()).isEqualTo("task");
Optional<FlowWithSource> fromDb = flowRepository.findByIdWithSource("my-tenant", "some.namespace", "import", Optional.empty());
assertThat(fromDb.isPresent()).isEqualTo(true);
assertThat(fromDb.isPresent()).isTrue();
assertThat(fromDb.get().getRevision()).isEqualTo(1);
assertThat(fromDb.get().getSource()).isEqualTo(source);
@@ -80,7 +80,7 @@ class FlowServiceTest {
assertThat(importFlow.getTasks().getFirst().getId()).isEqualTo("replaced_task");
fromDb = flowRepository.findByIdWithSource("my-tenant", "some.namespace", "import", Optional.empty());
assertThat(fromDb.isPresent()).isEqualTo(true);
assertThat(fromDb.isPresent()).isTrue();
assertThat(fromDb.get().getRevision()).isEqualTo(2);
assertThat(fromDb.get().getSource()).isEqualTo(source);
}
@@ -103,7 +103,7 @@ class FlowServiceTest {
assertThat(importFlow.getTasks().getFirst().getId()).isEqualTo("task");
Optional<FlowWithSource> fromDb = flowRepository.findByIdWithSource("my-tenant", "some.namespace", "import_dry", Optional.empty());
assertThat(fromDb.isPresent()).isEqualTo(true);
assertThat(fromDb.isPresent()).isTrue();
assertThat(fromDb.get().getRevision()).isEqualTo(1);
assertThat(fromDb.get().getSource()).isEqualTo(oldSource);
@@ -114,7 +114,7 @@ class FlowServiceTest {
assertThat(importFlow.getTasks().getFirst().getId()).isEqualTo("replaced_task");
fromDb = flowRepository.findByIdWithSource("my-tenant", "some.namespace", "import_dry", Optional.empty());
assertThat(fromDb.isPresent()).isEqualTo(true);
assertThat(fromDb.isPresent()).isTrue();
assertThat(fromDb.get().getRevision()).isEqualTo(1);
assertThat(fromDb.get().getSource()).isEqualTo(oldSource);
}
@@ -131,7 +131,7 @@ class FlowServiceTest {
List<FlowInterface> collect = flowService.keepLastVersion(stream).toList();
assertThat(collect.size()).isEqualTo(1);
assertThat(collect.getFirst().isDeleted()).isEqualTo(false);
assertThat(collect.getFirst().isDeleted()).isFalse();
assertThat(collect.getFirst().getRevision()).isEqualTo(4);
}
@@ -149,7 +149,7 @@ class FlowServiceTest {
List<FlowInterface> collect = flowService.keepLastVersion(stream).toList();
assertThat(collect.size()).isEqualTo(1);
assertThat(collect.getFirst().isDeleted()).isEqualTo(false);
assertThat(collect.getFirst().isDeleted()).isFalse();
assertThat(collect.getFirst().getId()).isEqualTo("test2");
}
@@ -166,7 +166,7 @@ class FlowServiceTest {
List<FlowInterface> collect = flowService.keepLastVersion(stream).toList();
assertThat(collect.size()).isEqualTo(1);
assertThat(collect.getFirst().isDeleted()).isEqualTo(false);
assertThat(collect.getFirst().isDeleted()).isFalse();
assertThat(collect.getFirst().getRevision()).isEqualTo(4);
}
@@ -287,9 +287,9 @@ class FlowServiceTest {
void delete() {
FlowWithSource flow = create("deleteTest", "test", 1);
FlowWithSource saved = flowRepository.create(GenericFlow.of(flow));
assertThat(flowRepository.findById(flow.getTenantId(), flow.getNamespace(), flow.getId()).isPresent()).isEqualTo(true);
assertThat(flowRepository.findById(flow.getTenantId(), flow.getNamespace(), flow.getId()).isPresent()).isTrue();
flowService.delete(saved);
assertThat(flowRepository.findById(flow.getTenantId(), flow.getNamespace(), flow.getId()).isPresent()).isEqualTo(false);
assertThat(flowRepository.findById(flow.getTenantId(), flow.getNamespace(), flow.getId()).isPresent()).isFalse();
}
@Test
@@ -303,7 +303,7 @@ class FlowServiceTest {
void findById() {
FlowWithSource flow = create("findByIdTest", "test", 1);
FlowWithSource saved = flowRepository.create(GenericFlow.of(flow));
assertThat(flowService.findById(null, saved.getNamespace(), saved.getId()).isPresent()).isEqualTo(true);
assertThat(flowService.findById(null, saved.getNamespace(), saved.getId()).isPresent()).isTrue();
}
@Test
@@ -343,6 +343,6 @@ class FlowServiceTest {
List<String> exceptions = flowService.checkValidSubflows(flow, null);
assertThat(exceptions.size()).isEqualTo(0);
assertThat(exceptions.size()).isZero();
}
}

View File

@@ -31,8 +31,8 @@ class SkipExecutionServiceTest {
skipExecutionService.setSkipExecutions(List.of(executionToSkip));
assertThat(skipExecutionService.skipExecution(executionToSkip)).isEqualTo(true);
assertThat(skipExecutionService.skipExecution(executionNotToSkip)).isEqualTo(false);
assertThat(skipExecutionService.skipExecution(executionToSkip)).isTrue();
assertThat(skipExecutionService.skipExecution(executionNotToSkip)).isFalse();
}
@Test
@@ -43,8 +43,8 @@ class SkipExecutionServiceTest {
skipExecutionService.setSkipExecutions(List.of("skip"));
skipExecutionService.setSkipFlows(List.of("namespace|skip"));
assertThat(skipExecutionService.skipExecution(executionToSkip)).isEqualTo(true);
assertThat(skipExecutionService.skipExecution(executionToSkipByFlow)).isEqualTo(true);
assertThat(skipExecutionService.skipExecution(executionToSkip)).isTrue();
assertThat(skipExecutionService.skipExecution(executionToSkipByFlow)).isTrue();
}
@Test
@@ -55,8 +55,8 @@ class SkipExecutionServiceTest {
skipExecutionService.setSkipExecutions(List.of("skip"));
skipExecutionService.setSkipFlows(List.of("namespace|skip"));
assertThat(skipExecutionService.skipExecution(taskRunToSkip)).isEqualTo(true);
assertThat(skipExecutionService.skipExecution(taskRunToSkipByFlow)).isEqualTo(true);
assertThat(skipExecutionService.skipExecution(taskRunToSkip)).isTrue();
assertThat(skipExecutionService.skipExecution(taskRunToSkipByFlow)).isTrue();
}
@Test
@@ -66,32 +66,32 @@ class SkipExecutionServiceTest {
skipExecutionService.setSkipFlows(List.of(flowToSkip, flowToSkipWithTenant));
assertThat(skipExecutionService.skipExecution(null, "namespace", "skip", "random")).isEqualTo(true);
assertThat(skipExecutionService.skipExecution(null, "wrong", "skip", "random")).isEqualTo(false);
assertThat(skipExecutionService.skipExecution("tenant", "namespace", "skip", "random")).isEqualTo(true);
assertThat(skipExecutionService.skipExecution("wrong", "namespace", "skip", "random")).isEqualTo(false);
assertThat(skipExecutionService.skipExecution(null, "namespace", "not_skipped", "random")).isEqualTo(false);
assertThat(skipExecutionService.skipExecution("tenant", "namespace", "not_skipped", "random")).isEqualTo(false);
assertThat(skipExecutionService.skipExecution(null, "namespace", "skip", "random")).isTrue();
assertThat(skipExecutionService.skipExecution(null, "wrong", "skip", "random")).isFalse();
assertThat(skipExecutionService.skipExecution("tenant", "namespace", "skip", "random")).isTrue();
assertThat(skipExecutionService.skipExecution("wrong", "namespace", "skip", "random")).isFalse();
assertThat(skipExecutionService.skipExecution(null, "namespace", "not_skipped", "random")).isFalse();
assertThat(skipExecutionService.skipExecution("tenant", "namespace", "not_skipped", "random")).isFalse();
}
@Test
void skipExecutionByNamespace() {
skipExecutionService.setSkipNamespaces(List.of("tenant|namespace"));
assertThat(skipExecutionService.skipExecution("tenant", "namespace", "someFlow", "someExecution")).isEqualTo(true);
assertThat(skipExecutionService.skipExecution(null, "namespace", "someFlow", "someExecution")).isEqualTo(false);
assertThat(skipExecutionService.skipExecution("anotherTenant", "namespace", "someFlow", "someExecution")).isEqualTo(false);
assertThat(skipExecutionService.skipExecution("tenant", "namespace", "anotherFlow", "anotherExecution")).isEqualTo(true);
assertThat(skipExecutionService.skipExecution("tenant", "other.namespace", "someFlow", "someExecution")).isEqualTo(false);
assertThat(skipExecutionService.skipExecution("tenant", "namespace", "someFlow", "someExecution")).isTrue();
assertThat(skipExecutionService.skipExecution(null, "namespace", "someFlow", "someExecution")).isFalse();
assertThat(skipExecutionService.skipExecution("anotherTenant", "namespace", "someFlow", "someExecution")).isFalse();
assertThat(skipExecutionService.skipExecution("tenant", "namespace", "anotherFlow", "anotherExecution")).isTrue();
assertThat(skipExecutionService.skipExecution("tenant", "other.namespace", "someFlow", "someExecution")).isFalse();
}
@Test
void skipExecutionByTenantId() {
skipExecutionService.setSkipTenants(List.of("tenant"));
assertThat(skipExecutionService.skipExecution("tenant", "namespace", "someFlow", "someExecution")).isEqualTo(true);
assertThat(skipExecutionService.skipExecution("anotherTenant", "namespace", "someFlow", "someExecution")).isEqualTo(false);
assertThat(skipExecutionService.skipExecution("tenant", "another.namespace", "someFlow", "someExecution")).isEqualTo(true);
assertThat(skipExecutionService.skipExecution("anotherTenant", "another.namespace", "someFlow", "someExecution")).isEqualTo(false);
assertThat(skipExecutionService.skipExecution("tenant", "namespace", "someFlow", "someExecution")).isTrue();
assertThat(skipExecutionService.skipExecution("anotherTenant", "namespace", "someFlow", "someExecution")).isFalse();
assertThat(skipExecutionService.skipExecution("tenant", "another.namespace", "someFlow", "someExecution")).isTrue();
assertThat(skipExecutionService.skipExecution("anotherTenant", "another.namespace", "someFlow", "someExecution")).isFalse();
}
}

View File

@@ -49,7 +49,7 @@ class InternalKVStoreTest {
Instant before = Instant.now().minusMillis(100);
InternalKVStore kv = kv();
assertThat(kv.list().size()).isEqualTo(0);
assertThat(kv.list().size()).isZero();
kv.put(TEST_KV_KEY, new KVValueAndMetadata(new KVMetadata(Duration.ofMinutes(5)), complexValue));
kv.put("my-second-key", new KVValueAndMetadata(new KVMetadata(Duration.ofMinutes(10)), complexValue));
@@ -60,8 +60,8 @@ class InternalKVStoreTest {
assertThat(list.size()).isEqualTo(2);
list.forEach(kvEntry -> {
assertThat(kvEntry.creationDate().isAfter(before) && kvEntry.creationDate().isBefore(after)).isEqualTo(true);
assertThat(kvEntry.updateDate().isAfter(before) && kvEntry.updateDate().isBefore(after)).isEqualTo(true);
assertThat(kvEntry.creationDate().isAfter(before) && kvEntry.creationDate().isBefore(after)).isTrue();
assertThat(kvEntry.updateDate().isAfter(before) && kvEntry.updateDate().isBefore(after)).isTrue();
});
Map<String, KVEntry> map = list.stream().collect(Collectors.toMap(KVEntry::key, Function.identity()));
@@ -70,11 +70,11 @@ class InternalKVStoreTest {
KVEntry myKeyValue = map.get(TEST_KV_KEY);
assertThat(myKeyValue.creationDate().plus(Duration.ofMinutes(4)).isBefore(myKeyValue.expirationDate()) &&
myKeyValue.creationDate().plus(Duration.ofMinutes(6)).isAfter(myKeyValue.expirationDate())).isEqualTo(true);
myKeyValue.creationDate().plus(Duration.ofMinutes(6)).isAfter(myKeyValue.expirationDate())).isTrue();
KVEntry mySecondKeyValue = map.get("my-second-key");
assertThat(mySecondKeyValue.creationDate().plus(Duration.ofMinutes(9)).isBefore(mySecondKeyValue.expirationDate()) &&
mySecondKeyValue.creationDate().plus(Duration.ofMinutes(11)).isAfter(mySecondKeyValue.expirationDate())).isEqualTo(true);
mySecondKeyValue.creationDate().plus(Duration.ofMinutes(11)).isAfter(mySecondKeyValue.expirationDate())).isTrue();
}
@Test
@@ -90,7 +90,7 @@ class InternalKVStoreTest {
StorageObject withMetadata = storageInterface.getWithMetadata(null, kv.namespace(), URI.create("/" + kv.namespace().replace(".", "/") + "/_kv/my-key.ion"));
String valueFile = new String(withMetadata.inputStream().readAllBytes());
Instant expirationDate = Instant.parse(withMetadata.metadata().get("expirationDate"));
assertThat(expirationDate.isAfter(before.plus(Duration.ofMinutes(4))) && expirationDate.isBefore(before.plus(Duration.ofMinutes(6)))).isEqualTo(true);
assertThat(expirationDate.isAfter(before.plus(Duration.ofMinutes(4))) && expirationDate.isBefore(before.plus(Duration.ofMinutes(6)))).isTrue();
assertThat(valueFile).isEqualTo(JacksonMapper.ofIon().writeValueAsString(complexValue));
// Re-When
@@ -100,7 +100,7 @@ class InternalKVStoreTest {
withMetadata = storageInterface.getWithMetadata(null, kv.namespace(), URI.create("/" + kv.namespace().replace(".", "/") + "/_kv/my-key.ion"));
valueFile = new String(withMetadata.inputStream().readAllBytes());
expirationDate = Instant.parse(withMetadata.metadata().get("expirationDate"));
assertThat(expirationDate.isAfter(before.plus(Duration.ofMinutes(9))) && expirationDate.isBefore(before.plus(Duration.ofMinutes(11)))).isEqualTo(true);
assertThat(expirationDate.isAfter(before.plus(Duration.ofMinutes(9))) && expirationDate.isBefore(before.plus(Duration.ofMinutes(11)))).isTrue();
assertThat(valueFile).isEqualTo("\"some-value\"");
}
@@ -139,7 +139,7 @@ class InternalKVStoreTest {
Optional<KVValue> value = kv.getValue(TEST_KV_KEY);
// Then
assertThat(value.isEmpty()).isEqualTo(true);
assertThat(value.isEmpty()).isTrue();
}
@Test

View File

@@ -173,6 +173,6 @@ class InternalNamespaceTest {
final String namespaceId = "io.kestra." + IdUtils.create();
final InternalNamespace namespace = new InternalNamespace(logger, null, namespaceId, storageInterface);
List<NamespaceFile> namespaceFiles = namespace.findAllFilesMatching((unused) -> true);
assertThat(namespaceFiles.size()).isEqualTo(0);
assertThat(namespaceFiles.size()).isZero();
}
}

View File

@@ -60,7 +60,7 @@ public class StateStoreTest {
MigrationRequiredException migrationRequiredException = Assertions.assertThrows(MigrationRequiredException.class, () -> runContext.stateStore().getState(state, "some-name", "my-taskrun-value"));
assertThat(migrationRequiredException.getMessage()).isEqualTo("It looks like the State Store migration hasn't been run, please run the `/app/kestra sys state-store migrate` command before.");
assertThat(runContext.namespaceKv(flowInfo.namespace()).getValue(key).isEmpty()).isEqualTo(true);
assertThat(runContext.namespaceKv(flowInfo.namespace()).getValue(key).isEmpty()).isTrue();
}
@Test

View File

@@ -22,9 +22,9 @@ class ListUtilsTest {
@Test
void isEmpty() {
assertThat(ListUtils.isEmpty(null)).isEqualTo(true);
assertThat(ListUtils.isEmpty(Collections.emptyList())).isEqualTo(true);
assertThat(ListUtils.isEmpty(List.of("1"))).isEqualTo(false);
assertThat(ListUtils.isEmpty(null)).isTrue();
assertThat(ListUtils.isEmpty(Collections.emptyList())).isTrue();
assertThat(ListUtils.isEmpty(List.of("1"))).isFalse();
}
@Test

View File

@@ -105,9 +105,9 @@ class MapUtilsTest {
@Test
void isEmpty() {
assertThat(MapUtils.isEmpty(null)).isEqualTo(true);
assertThat(MapUtils.isEmpty(Collections.emptyMap())).isEqualTo(true);
assertThat(MapUtils.isEmpty(Map.of("key", "value"))).isEqualTo(false);
assertThat(MapUtils.isEmpty(null)).isTrue();
assertThat(MapUtils.isEmpty(Collections.emptyMap())).isTrue();
assertThat(MapUtils.isEmpty(Map.of("key", "value"))).isFalse();
}

View File

@@ -39,7 +39,7 @@ class RetryUtilsTest {
() -> true
);
assertThat(inc.get()).isEqualTo(0);
assertThat(inc.get()).isZero();
});
assertThat(retryFailed.getAttemptCount()).isEqualTo(3);
@@ -55,8 +55,8 @@ class RetryUtilsTest {
() -> inc.getAndDecrement() == 1
);
assertThat(inc.get()).isEqualTo(0);
assertThat(retry).isEqualTo(true);
assertThat(inc.get()).isZero();
assertThat(retry).isTrue();
}
@Test
@@ -72,7 +72,7 @@ class RetryUtilsTest {
}
);
assertThat(inc.get()).isEqualTo(0);
assertThat(inc.get()).isZero();
});
assertThat(retryFailed.getAttemptCount()).isEqualTo(3);
@@ -94,8 +94,8 @@ class RetryUtilsTest {
}
);
assertThat(inc.get()).isEqualTo(0);
assertThat(retry).isEqualTo(true);
assertThat(inc.get()).isZero();
assertThat(retry).isTrue();
}
@Test

View File

@@ -26,7 +26,7 @@ public class ConstantRetryValidationTest {
.build();
Optional<ConstraintViolationException> valid = modelValidator.isValid(retry);
assertThat(valid.isEmpty()).isEqualTo(true);
assertThat(valid.isEmpty()).isTrue();
}
@Test
@@ -38,7 +38,7 @@ public class ConstantRetryValidationTest {
.build();
Optional<ConstraintViolationException> valid = modelValidator.isValid(retry);
assertThat(valid.isEmpty()).isEqualTo(false);
assertThat(valid.isEmpty()).isFalse();
assertThat(valid.get().getConstraintViolations()).hasSize(1);
assertThat(valid.get().getMessage()).isEqualTo(": 'interval' must be less than 'maxDuration' but is PT10S\n");
}

View File

@@ -21,13 +21,13 @@ public class DataValidationTest {
@Test
void valid() throws Exception {
Data<?> data = Data.ofURI(URI.create("kestra:///uri"));
assertThat(modelValidator.isValid(data).isEmpty()).isEqualTo(true);
assertThat(modelValidator.isValid(data).isEmpty()).isTrue();
data = Data.ofMap(Map.of("key", "value"));
assertThat(modelValidator.isValid(data).isEmpty()).isEqualTo(true);
assertThat(modelValidator.isValid(data).isEmpty()).isTrue();
data = Data.ofList(List.of(Map.of("key1", "value11"), Map.of("key2", "value2")));
assertThat(modelValidator.isValid(data).isEmpty()).isEqualTo(true);
assertThat(modelValidator.isValid(data).isEmpty()).isTrue();
}
@Test
@@ -37,7 +37,7 @@ public class DataValidationTest {
.fromList(new Property<>())
.build();
assertThat(modelValidator.isValid(data).isEmpty()).isEqualTo(false);
assertThat(modelValidator.isValid(data).isEmpty()).isFalse();
assertThat(modelValidator.isValid(data).get().getMessage()).contains("Only one of 'fromURI', 'fromMap' or 'fromList' can be set.");
}
}

View File

@@ -27,7 +27,7 @@ public class ExponentialRetryValidationTest {
.build();
Optional<ConstraintViolationException> valid = modelValidator.isValid(retry);
assertThat(valid.isEmpty()).isEqualTo(true);
assertThat(valid.isEmpty()).isTrue();
}
@Test
@@ -40,7 +40,7 @@ public class ExponentialRetryValidationTest {
.build();
Optional<ConstraintViolationException> valid = modelValidator.isValid(retry);
assertThat(valid.isEmpty()).isEqualTo(false);
assertThat(valid.isEmpty()).isFalse();
assertThat(valid.get().getConstraintViolations()).hasSize(1);
assertThat(valid.get().getMessage()).isEqualTo(": 'interval' must be less than 'maxDuration' but is PT2S\n");
@@ -52,7 +52,7 @@ public class ExponentialRetryValidationTest {
.build();
valid = modelValidator.isValid(retry);
assertThat(valid.isEmpty()).isEqualTo(false);
assertThat(valid.isEmpty()).isFalse();
assertThat(valid.get().getConstraintViolations()).hasSize(1);
assertThat(valid.get().getMessage()).isEqualTo(": 'interval' must be less than 'maxInterval' but is PT3S\n");
}

View File

@@ -25,7 +25,7 @@ class FlowValidationTest {
Flow flow = this.parse("flows/invalids/recursive-flow.yaml");
Optional<ConstraintViolationException> validate = modelValidator.isValid(flow);
assertThat(validate.isPresent()).isEqualTo(true);
assertThat(validate.isPresent()).isTrue();
assertThat(validate.get().getMessage()).contains(": Invalid Flow: Recursive call to flow [io.kestra.tests.recursive-flow]");
}
@@ -34,7 +34,7 @@ class FlowValidationTest {
Flow flow = this.parse("flows/invalids/system-labels.yaml");
Optional<ConstraintViolationException> validate = modelValidator.isValid(flow);
assertThat(validate.isPresent()).isEqualTo(true);
assertThat(validate.isPresent()).isTrue();
assertThat(validate.get().getMessage()).contains("System labels can only be set by Kestra itself, offending label: system.label=system_key");
assertThat(validate.get().getMessage()).contains("System labels can only be set by Kestra itself, offending label: system.id=id");
}
@@ -44,7 +44,7 @@ class FlowValidationTest {
Flow flow = this.parse("flows/valids/minimal.yaml");
Optional<ConstraintViolationException> validate = modelValidator.isValid(flow);
assertThat(validate.isPresent()).isEqualTo(false);
assertThat(validate.isPresent()).isFalse();
}
private Flow parse(String path) {

View File

@@ -22,7 +22,7 @@ class InputTest {
.validator("[A-Z]+")
.build();
assertThat(modelValidator.isValid(validInput).isEmpty()).isEqualTo(true);
assertThat(modelValidator.isValid(validInput).isEmpty()).isTrue();
}
@SuppressWarnings("deprecation")

View File

@@ -28,11 +28,11 @@ class JsonStringTest {
void jsonString() throws Exception {
JsonStringCls build = new JsonStringCls("{}");
assertThat(modelValidator.isValid(build).isEmpty()).isEqualTo(true);
assertThat(modelValidator.isValid(build).isEmpty()).isTrue();
build = new JsonStringCls("{\"invalid\"}");
assertThat(modelValidator.isValid(build).isPresent()).isEqualTo(true);
assertThat(modelValidator.isValid(build).isPresent()).isTrue();
assertThat(modelValidator.isValid(build).get().getMessage()).contains("invalid json");
}
}

View File

@@ -32,7 +32,7 @@ class NoSystemLabelValidationTest {
Optional<ConstraintViolationException> valid = modelValidator.isValid(sla);
assertThat(valid.isPresent()).isEqualTo(true);
assertThat(valid.isPresent()).isTrue();
assertThat(valid.get().getMessage()).isEqualTo("labels[0].<list element>: System labels can only be set by Kestra itself, offending label: system.sla=violated.\n");
}
@@ -48,6 +48,6 @@ class NoSystemLabelValidationTest {
Optional<ConstraintViolationException> valid = modelValidator.isValid(sla);
assertThat(valid.isEmpty()).isEqualTo(true);
assertThat(valid.isEmpty()).isTrue();
}
}

View File

@@ -26,7 +26,7 @@ class PluginDefaultValidationTest {
Optional<ConstraintViolationException> validate = modelValidator.isValid(pluginDefault);
assertThat(validate.isPresent()).isEqualTo(true);
assertThat(validate.isPresent()).isTrue();
}
@Test
@@ -40,7 +40,7 @@ class PluginDefaultValidationTest {
Optional<ConstraintViolationException> validate = modelValidator.isValid(pluginDefault);
assertThat(validate.isPresent()).isEqualTo(true);
assertThat(validate.isPresent()).isTrue();
}
@Test
@@ -52,7 +52,7 @@ class PluginDefaultValidationTest {
Optional<ConstraintViolationException> validate = modelValidator.isValid(pluginDefault);
assertThat(validate.isPresent()).isEqualTo(true);
assertThat(validate.isPresent()).isTrue();
}
@Test
@@ -64,7 +64,7 @@ class PluginDefaultValidationTest {
Optional<ConstraintViolationException> validate = modelValidator.isValid(pluginDefault);
assertThat(validate.isEmpty()).isEqualTo(true);
assertThat(validate.isEmpty()).isTrue();
}
@Test
@@ -76,7 +76,7 @@ class PluginDefaultValidationTest {
Optional<ConstraintViolationException> validate = modelValidator.isValid(pluginDefault);
assertThat(validate.isEmpty()).isEqualTo(true);
assertThat(validate.isEmpty()).isTrue();
}
}

View File

@@ -28,7 +28,7 @@ class PreconditionFilterValidationTest {
.build();
Optional<ConstraintViolationException> valid = modelValidator.isValid(condition);
assertThat(valid.isEmpty()).isEqualTo(true);
assertThat(valid.isEmpty()).isTrue();
}
@ParameterizedTest
@@ -41,7 +41,7 @@ class PreconditionFilterValidationTest {
.build();
Optional<ConstraintViolationException> valid = modelValidator.isValid(condition);
assertThat(valid.isEmpty()).isEqualTo(false);
assertThat(valid.isEmpty()).isFalse();
assertThat(valid.get().getConstraintViolations()).hasSize(1);
assertThat(valid.get().getMessage()).isEqualTo(": `value` cannot be null for type " + type.name() + "\n");
}
@@ -57,7 +57,7 @@ class PreconditionFilterValidationTest {
.build();
Optional<ConstraintViolationException> valid = modelValidator.isValid(condition);
assertThat(valid.isEmpty()).isEqualTo(false);
assertThat(valid.isEmpty()).isFalse();
assertThat(valid.get().getConstraintViolations()).hasSize(1);
assertThat(valid.get().getMessage()).isEqualTo(": `values` must be null for type " + type.name() + "\n");
}
@@ -72,7 +72,7 @@ class PreconditionFilterValidationTest {
.build();
Optional<ConstraintViolationException> valid = modelValidator.isValid(condition);
assertThat(valid.isEmpty()).isEqualTo(true);
assertThat(valid.isEmpty()).isTrue();
}
@ParameterizedTest
@@ -85,7 +85,7 @@ class PreconditionFilterValidationTest {
.build();
Optional<ConstraintViolationException> valid = modelValidator.isValid(condition);
assertThat(valid.isEmpty()).isEqualTo(false);
assertThat(valid.isEmpty()).isFalse();
assertThat(valid.get().getConstraintViolations()).hasSize(1);
assertThat(valid.get().getMessage()).isEqualTo(": `value` must be null for type " + type.name() + "\n");
}

View File

@@ -27,7 +27,7 @@ public class RandomRetryValidationTest {
.build();
Optional<ConstraintViolationException> valid = modelValidator.isValid(retry);
assertThat(valid.isEmpty()).isEqualTo(true);
assertThat(valid.isEmpty()).isTrue();
}
@Test
@@ -40,7 +40,7 @@ public class RandomRetryValidationTest {
.build();
Optional<ConstraintViolationException> valid = modelValidator.isValid(retry);
assertThat(valid.isEmpty()).isEqualTo(false);
assertThat(valid.isEmpty()).isFalse();
assertThat(valid.get().getConstraintViolations()).hasSize(1);
assertThat(valid.get().getMessage()).isEqualTo(": 'minInterval' must be less than 'maxDuration' but is PT2S\n");
@@ -52,7 +52,7 @@ public class RandomRetryValidationTest {
.build();
valid = modelValidator.isValid(retry);
assertThat(valid.isEmpty()).isEqualTo(false);
assertThat(valid.isEmpty()).isFalse();
assertThat(valid.get().getConstraintViolations()).hasSize(1);
assertThat(valid.get().getMessage()).isEqualTo(": 'minInterval' must be less than 'maxInterval' but is PT3S\n");
}

View File

@@ -27,11 +27,11 @@ class RegexTest {
void inputValidation() {
final RegexCls validRegex = new RegexCls("[A-Z]+");
assertThat(modelValidator.isValid(validRegex).isEmpty()).isEqualTo(true);
assertThat(modelValidator.isValid(validRegex).isEmpty()).isTrue();
final RegexCls invalidRegex = new RegexCls("\\");
assertThat(modelValidator.isValid(invalidRegex).isPresent()).isEqualTo(true);
assertThat(modelValidator.isValid(invalidRegex).isPresent()).isTrue();
assertThat(modelValidator.isValid(invalidRegex).get().getMessage()).contains("invalid pattern");
}
}

View File

@@ -25,14 +25,14 @@ class ScheduleValidationTest {
.cron("* * * * *")
.build();
assertThat(modelValidator.isValid(build).isEmpty()).isEqualTo(true);
assertThat(modelValidator.isValid(build).isEmpty()).isTrue();
build = Schedule.builder()
.type(Schedule.class.getName())
.cron("$ome Inv@lid Cr0n")
.build();
assertThat(modelValidator.isValid(build).isPresent()).isEqualTo(true);
assertThat(modelValidator.isValid(build).isPresent()).isTrue();
assertThat(modelValidator.isValid(build).get().getMessage()).contains("invalid cron expression");
}
@@ -44,7 +44,7 @@ class ScheduleValidationTest {
.cron("@hourly")
.build();
assertThat(modelValidator.isValid(build).isEmpty()).isEqualTo(true);
assertThat(modelValidator.isValid(build).isEmpty()).isTrue();
}
@Test
@@ -56,7 +56,7 @@ class ScheduleValidationTest {
.cron("* * * * * *")
.build();
assertThat(modelValidator.isValid(build).isEmpty()).isEqualTo(true);
assertThat(modelValidator.isValid(build).isEmpty()).isTrue();
build = Schedule.builder()
.id(IdUtils.create())
@@ -64,7 +64,7 @@ class ScheduleValidationTest {
.cron("* * * * * *")
.build();
assertThat(modelValidator.isValid(build).isPresent()).isEqualTo(true);
assertThat(modelValidator.isValid(build).isPresent()).isTrue();
assertThat(modelValidator.isValid(build).get().getMessage()).contains("invalid cron expression");
}
@@ -77,7 +77,7 @@ class ScheduleValidationTest {
.lateMaximumDelay(Duration.ofSeconds(10))
.build();
assertThat(modelValidator.isValid(build).isPresent()).isEqualTo(false);
assertThat(modelValidator.isValid(build).isPresent()).isFalse();
}
@Test
@@ -90,7 +90,7 @@ class ScheduleValidationTest {
.build();
assertThat(modelValidator.isValid(build).isPresent()).isEqualTo(true);
assertThat(modelValidator.isValid(build).isPresent()).isTrue();
assertThat(modelValidator.isValid(build).get().getMessage()).contains("interval: must be null");
}

View File

@@ -24,7 +24,7 @@ class TimeWindowValidationTest {
var sla = TimeWindow.builder().build();
Optional<ConstraintViolationException> valid = modelValidator.isValid(sla);
assertThat(valid.isEmpty()).isEqualTo(true);
assertThat(valid.isEmpty()).isTrue();
}
@Test
@@ -32,7 +32,7 @@ class TimeWindowValidationTest {
var sla = TimeWindow.builder().type(TimeWindow.Type.DAILY_TIME_DEADLINE).deadline(LocalTime.now()).build();
Optional<ConstraintViolationException> valid = modelValidator.isValid(sla);
assertThat(valid.isEmpty()).isEqualTo(true);
assertThat(valid.isEmpty()).isTrue();
}
@Test
@@ -40,7 +40,7 @@ class TimeWindowValidationTest {
var sla = TimeWindow.builder().type(TimeWindow.Type.DAILY_TIME_DEADLINE).build();
Optional<ConstraintViolationException> valid = modelValidator.isValid(sla);
assertThat(valid.isEmpty()).isEqualTo(false);
assertThat(valid.isEmpty()).isFalse();
assertThat(valid.get().getConstraintViolations()).hasSize(1);
assertThat(valid.get().getMessage()).isEqualTo(": Time window of type `DAILY_TIME_DEADLINE` must have a deadline.\n");
}
@@ -50,7 +50,7 @@ class TimeWindowValidationTest {
var sla = TimeWindow.builder().type(TimeWindow.Type.DAILY_TIME_DEADLINE).deadline(LocalTime.now()).window(Duration.ofHours(1)).build();
Optional<ConstraintViolationException> valid = modelValidator.isValid(sla);
assertThat(valid.isEmpty()).isEqualTo(false);
assertThat(valid.isEmpty()).isFalse();
assertThat(valid.get().getConstraintViolations()).hasSize(1);
assertThat(valid.get().getMessage()).isEqualTo(": Time window of type `DAILY_TIME_DEADLINE` cannot have a window.\n");
}
@@ -60,7 +60,7 @@ class TimeWindowValidationTest {
var sla = TimeWindow.builder().type(TimeWindow.Type.DAILY_TIME_WINDOW).startTime(LocalTime.now()).endTime(LocalTime.now()).build();
Optional<ConstraintViolationException> valid = modelValidator.isValid(sla);
assertThat(valid.isEmpty()).isEqualTo(true);
assertThat(valid.isEmpty()).isTrue();
}
@Test
@@ -68,7 +68,7 @@ class TimeWindowValidationTest {
var sla = TimeWindow.builder().type(TimeWindow.Type.DAILY_TIME_WINDOW).build();
Optional<ConstraintViolationException> valid = modelValidator.isValid(sla);
assertThat(valid.isEmpty()).isEqualTo(false);
assertThat(valid.isEmpty()).isFalse();
assertThat(valid.get().getConstraintViolations()).hasSize(2);
assertThat(valid.get().getMessage()).contains(": Time window of type `DAILY_TIME_WINDOW` must have an end time.\n");
assertThat(valid.get().getMessage()).contains(": Time window of type `DAILY_TIME_WINDOW` must have a start time.\n");
@@ -79,7 +79,7 @@ class TimeWindowValidationTest {
var sla = TimeWindow.builder().type(TimeWindow.Type.DAILY_TIME_WINDOW).startTime(LocalTime.now()).endTime(LocalTime.now()).window(Duration.ofHours(1)).build();
Optional<ConstraintViolationException> valid = modelValidator.isValid(sla);
assertThat(valid.isEmpty()).isEqualTo(false);
assertThat(valid.isEmpty()).isFalse();
assertThat(valid.get().getConstraintViolations()).hasSize(2);
assertThat(valid.get().getMessage()).contains(": Time window of type `DAILY_TIME_WINDOW` cannot have a window.\n");
assertThat(valid.get().getMessage()).contains(": Time window of type `DAILY_TIME_WINDOW` cannot have a deadline.\n");
@@ -90,7 +90,7 @@ class TimeWindowValidationTest {
var sla = TimeWindow.builder().type(TimeWindow.Type.DURATION_WINDOW).window(Duration.ofHours(1)).build();
Optional<ConstraintViolationException> valid = modelValidator.isValid(sla);
assertThat(valid.isEmpty()).isEqualTo(true);
assertThat(valid.isEmpty()).isTrue();
}
@Test
@@ -98,7 +98,7 @@ class TimeWindowValidationTest {
var sla = TimeWindow.builder().type(TimeWindow.Type.DURATION_WINDOW).deadline(LocalTime.now()).window(Duration.ofHours(1)).build();
Optional<ConstraintViolationException> valid = modelValidator.isValid(sla);
assertThat(valid.isEmpty()).isEqualTo(false);
assertThat(valid.isEmpty()).isFalse();
assertThat(valid.get().getConstraintViolations()).hasSize(1);
assertThat(valid.get().getMessage()).isEqualTo(": Time window of type `DURATION_WINDOW` cannot have a deadline.\n");
}
@@ -108,7 +108,7 @@ class TimeWindowValidationTest {
var sla = TimeWindow.builder().type(TimeWindow.Type.SLIDING_WINDOW).window(Duration.ofHours(1)).build();
Optional<ConstraintViolationException> valid = modelValidator.isValid(sla);
assertThat(valid.isEmpty()).isEqualTo(true);
assertThat(valid.isEmpty()).isTrue();
}
@Test
@@ -116,7 +116,7 @@ class TimeWindowValidationTest {
var sla = TimeWindow.builder().type(TimeWindow.Type.SLIDING_WINDOW).deadline(LocalTime.now()).window(Duration.ofHours(1)).build();
Optional<ConstraintViolationException> valid = modelValidator.isValid(sla);
assertThat(valid.isEmpty()).isEqualTo(false);
assertThat(valid.isEmpty()).isFalse();
assertThat(valid.get().getConstraintViolations()).hasSize(1);
assertThat(valid.get().getMessage()).isEqualTo(": Time window of type `SLIDING_WINDOW` cannot have a deadline.\n");
}

View File

@@ -27,11 +27,11 @@ class TimezoneIdTest {
void inputValidation() {
final TimezoneIdCls existingTimezone = new TimezoneIdCls("Europe/Paris");
assertThat(modelValidator.isValid(existingTimezone).isEmpty()).isEqualTo(true);
assertThat(modelValidator.isValid(existingTimezone).isEmpty()).isTrue();
final TimezoneIdCls invalidTimezone = new TimezoneIdCls("Foo/Bar");
assertThat(modelValidator.isValid(invalidTimezone).isPresent()).isEqualTo(true);
assertThat(modelValidator.isValid(invalidTimezone).isPresent()).isTrue();
assertThat(modelValidator.isValid(invalidTimezone).get().getMessage())
.satisfies(
arg -> assertThat(arg).startsWith("timezone"),

View File

@@ -29,7 +29,7 @@ public class WebhookTest {
)
.build();
assertThat(modelValidator.isValid(webhook).isPresent()).isEqualTo(true);
assertThat(modelValidator.isValid(webhook).isPresent()).isTrue();
assertThat(modelValidator.isValid(webhook).get().getMessage()).contains("invalid webhook: conditions of type MultipleCondition are not supported");
}
}

View File

@@ -35,7 +35,7 @@ public class WorkingDirectoryTest {
)
.build();
assertThat(modelValidator.isValid(workingDirectory).isPresent()).isEqualTo(false);
assertThat(modelValidator.isValid(workingDirectory).isPresent()).isFalse();
}
@Test
@@ -46,7 +46,7 @@ public class WorkingDirectoryTest {
.type(WorkingDirectory.class.getName())
.build();
assertThat(modelValidator.isValid(workingDirectory).isPresent()).isEqualTo(true);
assertThat(modelValidator.isValid(workingDirectory).isPresent()).isTrue();
assertThat(modelValidator.isValid(workingDirectory).get().getMessage()).contains("The 'tasks' property cannot be empty");
// flowable task
@@ -63,7 +63,7 @@ public class WorkingDirectoryTest {
)
.build();
assertThat(modelValidator.isValid(workingDirectory).isPresent()).isEqualTo(true);
assertThat(modelValidator.isValid(workingDirectory).isPresent()).isTrue();
assertThat(modelValidator.isValid(workingDirectory).get().getMessage()).contains("Only runnable tasks are allowed as children of a WorkingDirectory task");
// worker group at the subtasks level
@@ -81,7 +81,7 @@ public class WorkingDirectoryTest {
)
.build();
assertThat(modelValidator.isValid(workingDirectory).isPresent()).isEqualTo(true);
assertThat(modelValidator.isValid(workingDirectory).isPresent()).isTrue();
assertThat(modelValidator.isValid(workingDirectory).get().getMessage()).contains("Cannot set a Worker Group in any WorkingDirectory sub-tasks, it is only supported at the WorkingDirectory level");
}

View File

@@ -32,7 +32,7 @@ class ExecutionFlowTest {
boolean test = conditionService.isValid(build, flow, execution);
assertThat(test).isEqualTo(true);
assertThat(test).isTrue();
}
@Test
@@ -47,6 +47,6 @@ class ExecutionFlowTest {
boolean test = conditionService.isValid(build, flow, execution);
assertThat(test).isEqualTo(false);
assertThat(test).isFalse();
}
}

View File

@@ -34,7 +34,7 @@ public class ExecutionLabelsTest {
boolean test = conditionService.isValid(build, flow, execution);
assertThat(test).isEqualTo(true);
assertThat(test).isTrue();
}
@Test
@@ -52,7 +52,7 @@ public class ExecutionLabelsTest {
boolean test = conditionService.isValid(build, flow, execution);
assertThat(test).isEqualTo(true);
assertThat(test).isTrue();
}
@Test
@@ -67,7 +67,7 @@ public class ExecutionLabelsTest {
boolean test = conditionService.isValid(build, flow, execution);
assertThat(test).isEqualTo(false);
assertThat(test).isFalse();
}
@Test
@@ -85,6 +85,6 @@ public class ExecutionLabelsTest {
boolean test = conditionService.isValid(build, flow, execution);
assertThat(test).isEqualTo(false);
assertThat(test).isFalse();
}
}

View File

@@ -32,7 +32,7 @@ class ExecutionNamespaceTest {
boolean test = conditionService.isValid(build, flow, execution);
assertThat(test).isEqualTo(true);
assertThat(test).isTrue();
// Explicit
build = ExecutionNamespace.builder()
@@ -41,7 +41,7 @@ class ExecutionNamespaceTest {
.build();
test = conditionService.isValid(build, flow, execution);
assertThat(test).isEqualTo(true);
assertThat(test).isTrue();
}
@Test
@@ -55,7 +55,7 @@ class ExecutionNamespaceTest {
boolean test = conditionService.isValid(build, flow, execution);
assertThat(test).isEqualTo(false);
assertThat(test).isFalse();
}
@Test
@@ -70,7 +70,7 @@ class ExecutionNamespaceTest {
), ExecutionNamespace.class);
boolean test = conditionService.isValid(build, flow, execution);
assertThat(test).isEqualTo(true);
assertThat(test).isTrue();
build = ExecutionNamespace.builder()
.namespace(Property.of(flow.getNamespace().substring(0, 3)))
@@ -78,7 +78,7 @@ class ExecutionNamespaceTest {
.build();
test = conditionService.isValid(build, flow, execution);
assertThat(test).isEqualTo(true);
assertThat(test).isTrue();
build = ExecutionNamespace.builder()
.namespace(Property.of(flow.getNamespace().substring(0, 3)))
@@ -86,7 +86,7 @@ class ExecutionNamespaceTest {
.build();
test = conditionService.isValid(build, flow, execution);
assertThat(test).isEqualTo(true);
assertThat(test).isTrue();
}
@Test
@@ -100,7 +100,7 @@ class ExecutionNamespaceTest {
.build();
boolean test = conditionService.isValid(build, flow, execution);
assertThat(test).isEqualTo(false);
assertThat(test).isFalse();
}
@Test
@@ -114,7 +114,7 @@ class ExecutionNamespaceTest {
.build();
boolean test = conditionService.isValid(build, flow, execution);
assertThat(test).isEqualTo(true);
assertThat(test).isTrue();
}
@Test
@@ -130,6 +130,6 @@ class ExecutionNamespaceTest {
), ExecutionNamespace.class);
boolean test = conditionService.isValid(build, flow, execution);
assertThat(test).isEqualTo(true);
assertThat(test).isTrue();
}
}

View File

@@ -32,7 +32,7 @@ class ExecutionOutputsTest {
boolean test = conditionService.isValid(build, flow, execution);
assertThat(test).isEqualTo(true);
assertThat(test).isTrue();
}
@Test
@@ -49,7 +49,7 @@ class ExecutionOutputsTest {
boolean test = conditionService.isValid(build, flow, execution);
assertThat(test).isEqualTo(false);
assertThat(test).isFalse();
}
@Test
@@ -63,6 +63,6 @@ class ExecutionOutputsTest {
boolean test = conditionService.isValid(build, flow, execution);
assertThat(test).isEqualTo(false);
assertThat(test).isFalse();
}
}

View File

@@ -32,7 +32,7 @@ class ExecutionStatusTest {
boolean test = conditionService.isValid(build, flow, execution);
assertThat(test).isEqualTo(false);
assertThat(test).isFalse();
}
@Test
@@ -46,7 +46,7 @@ class ExecutionStatusTest {
boolean test = conditionService.isValid(build, flow, execution);
assertThat(test).isEqualTo(true);
assertThat(test).isTrue();
}
@Test
@@ -61,6 +61,6 @@ class ExecutionStatusTest {
boolean test = conditionService.isValid(build, flow, execution);
assertThat(test).isEqualTo(false);
assertThat(test).isFalse();
}
}

View File

@@ -29,7 +29,7 @@ class ExpressionTest {
boolean test = conditionService.isValid(build, flow, execution);
assertThat(test).isEqualTo(true);
assertThat(test).isTrue();
}
@Test
@@ -43,6 +43,6 @@ class ExpressionTest {
boolean test = conditionService.isValid(build, flow, execution);
assertThat(test).isEqualTo(false);
assertThat(test).isFalse();
}
}

View File

@@ -46,7 +46,7 @@ class HasRetryAttemptTest {
boolean test = conditionService.isValid(build, flow, execution);
assertThat(test).isEqualTo(true);
assertThat(test).isTrue();
build = HasRetryAttempt.builder()
.in(Property.of(Collections.singletonList(State.Type.FAILED)))
@@ -54,7 +54,7 @@ class HasRetryAttemptTest {
test = conditionService.isValid(build, flow, execution);
assertThat(test).isEqualTo(false);
assertThat(test).isFalse();
}
@Test
@@ -76,6 +76,6 @@ class HasRetryAttemptTest {
boolean test = conditionService.isValid(build, flow, execution);
assertThat(test).isEqualTo(false);
assertThat(test).isFalse();
}
}

View File

@@ -45,6 +45,6 @@ class MultipleConditionTest {
boolean test = conditionService.isValid((Condition) build, flow, execution, multipleConditionStorage);
assertThat(test).isEqualTo(false);
assertThat(test).isFalse();
}
}

View File

@@ -25,20 +25,20 @@ class PublicHolidayTest {
PublicHoliday publicHoliday = PublicHoliday.builder()
.date(Property.of("2023-01-01"))
.build();
assertThat(conditionService.isValid(publicHoliday, flow, execution)).isEqualTo(true);
assertThat(conditionService.isValid(publicHoliday, flow, execution)).isTrue();
publicHoliday = PublicHoliday.builder()
.date(Property.of("2023-07-14"))
.country(Property.of("FR"))
.build();
assertThat(conditionService.isValid(publicHoliday, flow, execution)).isEqualTo(true);
assertThat(conditionService.isValid(publicHoliday, flow, execution)).isTrue();
publicHoliday = PublicHoliday.builder()
.date(Property.of("2023-03-08"))
.country(Property.of("DE"))
.subDivision(Property.of("BE"))
.build();
assertThat(conditionService.isValid(publicHoliday, flow, execution)).isEqualTo(true);
assertThat(conditionService.isValid(publicHoliday, flow, execution)).isTrue();
}
@Test
@@ -50,12 +50,12 @@ class PublicHolidayTest {
.date(Property.of("2023-01-02"))
.country(Property.of("FR"))
.build();
assertThat(conditionService.isValid(publicHoliday, flow, execution)).isEqualTo(false);
assertThat(conditionService.isValid(publicHoliday, flow, execution)).isFalse();
publicHoliday = PublicHoliday.builder()
.date(Property.of("2023-03-08"))
.country(Property.of("DE"))
.build();
assertThat(conditionService.isValid(publicHoliday, flow, execution)).isEqualTo(false);
assertThat(conditionService.isValid(publicHoliday, flow, execution)).isFalse();
}
}

View File

@@ -71,7 +71,7 @@ class CountTest {
.build()
.run(runContext);
assertThat(run.getResults().size()).isEqualTo(0);
assertThat(run.getResults().size()).isZero();
// non-matching entry
run = Count.builder()

View File

@@ -28,7 +28,7 @@ class AllowFailureTest {
void success(Execution execution) {
assertThat(execution.getTaskRunList()).hasSize(9);
control(execution);
assertThat(execution.findTaskRunsByTaskId("global-error").size()).isEqualTo(0);
assertThat(execution.findTaskRunsByTaskId("global-error").size()).isZero();
assertThat(execution.findTaskRunsByTaskId("last").getFirst().getState().getCurrent()).isEqualTo(State.Type.SUCCESS);
assertThat(execution.getState().getCurrent()).isEqualTo(State.Type.WARNING);
}

View File

@@ -62,13 +62,13 @@ class CorrelationIdTest {
assertThat(child.get()).isNotNull();
assertThat(child.get().getState().getCurrent()).isEqualTo(State.Type.SUCCESS);
Optional<Label> correlationId = child.get().getLabels().stream().filter(label -> label.key().equals(Label.CORRELATION_ID)).findAny();
assertThat(correlationId.isPresent()).isEqualTo(true);
assertThat(correlationId.isPresent()).isTrue();
assertThat(correlationId.get().value()).isEqualTo(execution.getId());
assertThat(grandChild.get()).isNotNull();
assertThat(grandChild.get().getState().getCurrent()).isEqualTo(State.Type.SUCCESS);
correlationId = grandChild.get().getLabels().stream().filter(label -> label.key().equals(Label.CORRELATION_ID)).findAny();
assertThat(correlationId.isPresent()).isEqualTo(true);
assertThat(correlationId.isPresent()).isTrue();
assertThat(correlationId.get().value()).isEqualTo(execution.getId());
}
}

View File

@@ -49,7 +49,7 @@ public class DagTest {
Flow flow = this.parse("flows/invalids/dag-cyclicdependency.yaml");
Optional<ConstraintViolationException> validate = modelValidator.isValid(flow);
assertThat(validate.isPresent()).isEqualTo(true);
assertThat(validate.isPresent()).isTrue();
assertThat(validate.get().getConstraintViolations().size()).isEqualTo(1);
assertThat(validate.get().getMessage()).contains("dag: Cyclic dependency detected: task1, task2");
@@ -60,7 +60,7 @@ public class DagTest {
Flow flow = this.parse("flows/invalids/dag-notexist-task.yaml");
Optional<ConstraintViolationException> validate = modelValidator.isValid(flow);
assertThat(validate.isPresent()).isEqualTo(true);
assertThat(validate.isPresent()).isTrue();
assertThat(validate.get().getConstraintViolations().size()).isEqualTo(1);
assertThat(validate.get().getMessage()).contains("dag: Not existing task id in dependency: taskX");
@@ -83,8 +83,8 @@ public class DagTest {
assertThat(execution.findTaskRunsByTaskId("a2").getFirst().getState().getCurrent()).isEqualTo(State.Type.SUCCESS);
assertThat(execution.findTaskRunsByTaskId("e1").getFirst().getState().getCurrent()).isEqualTo(State.Type.SUCCESS);
assertThat(execution.findTaskRunsByTaskId("e2").getFirst().getState().getCurrent()).isEqualTo(State.Type.SUCCESS);
assertThat(execution.findTaskRunsByTaskId("a2").getFirst().getState().getStartDate().isAfter(execution.findTaskRunsByTaskId("a1").getFirst().getState().getEndDate().orElseThrow())).isEqualTo(true);
assertThat(execution.findTaskRunsByTaskId("e2").getFirst().getState().getStartDate().isAfter(execution.findTaskRunsByTaskId("e1").getFirst().getState().getEndDate().orElseThrow())).isEqualTo(true);
assertThat(execution.findTaskRunsByTaskId("a2").getFirst().getState().getStartDate().isAfter(execution.findTaskRunsByTaskId("a1").getFirst().getState().getEndDate().orElseThrow())).isTrue();
assertThat(execution.findTaskRunsByTaskId("e2").getFirst().getState().getStartDate().isAfter(execution.findTaskRunsByTaskId("e1").getFirst().getState().getEndDate().orElseThrow())).isTrue();
}
private Flow parse(String path) {

View File

@@ -84,7 +84,7 @@ class FinallyTest {
assertThat(execution.getTaskRunList()).hasSize(3);
assertThat(execution.getState().getCurrent()).isEqualTo(State.Type.FAILED);
assertThat(execution.findTaskRunsByTaskId("ko").getFirst().getState().getCurrent()).isEqualTo(State.Type.FAILED);
assertThat(execution.findTaskRunsByTaskId("ok").isEmpty()).isEqualTo(true);
assertThat(execution.findTaskRunsByTaskId("ok").isEmpty()).isTrue();
assertThat(execution.findTaskRunsByTaskId("a1").getFirst().getState().getCurrent()).isEqualTo(State.Type.SUCCESS);
}
@@ -365,7 +365,7 @@ class FinallyTest {
assertThat(execution.getTaskRunList()).hasSize(2);
assertThat(execution.getState().getCurrent()).isEqualTo(State.Type.FAILED);
assertThat(execution.findTaskRunsByTaskId("ko").getFirst().getState().getCurrent()).isEqualTo(State.Type.FAILED);
assertThat(execution.findTaskRunsByTaskId("ok").isEmpty()).isEqualTo(true);
assertThat(execution.findTaskRunsByTaskId("ok").isEmpty()).isTrue();
assertThat(execution.findTaskRunsByTaskId("a1").getFirst().getState().getCurrent()).isEqualTo(State.Type.SUCCESS);
}
}

View File

@@ -83,7 +83,7 @@ public class ForEachItemCaseTest {
Duration.ofSeconds(30));
// we should have triggered 26 subflows
assertThat(countDownLatch.await(1, TimeUnit.MINUTES)).isEqualTo(true);
assertThat(countDownLatch.await(1, TimeUnit.MINUTES)).isTrue();
receive.blockLast();
// assert on the main flow execution
@@ -95,8 +95,8 @@ public class ForEachItemCaseTest {
assertThat(outputs.get("numberOfBatches")).isEqualTo(26);
assertThat(outputs.get("iterations")).isNotNull();
Map<String, Integer> iterations = (Map<String, Integer>) outputs.get("iterations");
assertThat(iterations.get("CREATED")).isEqualTo(0);
assertThat(iterations.get("RUNNING")).isEqualTo(0);
assertThat(iterations.get("CREATED")).isZero();
assertThat(iterations.get("RUNNING")).isZero();
assertThat(iterations.get("SUCCESS")).isEqualTo(26);
// assert on the last subflow execution
@@ -105,7 +105,7 @@ public class ForEachItemCaseTest {
assertThat((String) triggered.get().getInputs().get("items")).matches("kestra:///io/kestra/tests/for-each-item/executions/.*/tasks/each-split/.*\\.txt");
assertThat(triggered.get().getTaskRunList()).hasSize(1);
Optional<Label> correlationId = triggered.get().getLabels().stream().filter(label -> label.key().equals(Label.CORRELATION_ID)).findAny();
assertThat(correlationId.isPresent()).isEqualTo(true);
assertThat(correlationId.isPresent()).isTrue();
assertThat(correlationId.get().value()).isEqualTo(execution.getId());
}
@@ -158,11 +158,11 @@ public class ForEachItemCaseTest {
assertThat(outputs.get("iterations")).isNotNull();
Map<String, Integer> iterations = (Map<String, Integer>) outputs.get("iterations");
assertThat(iterations.get("CREATED")).isNull(); // if we didn't wait we will only observe RUNNING and SUCCESS
assertThat(iterations.get("RUNNING")).isEqualTo(0);
assertThat(iterations.get("RUNNING")).isZero();
assertThat(iterations.get("SUCCESS")).isEqualTo(26);
// wait for the 26 flows to ends
assertThat(countDownLatch.await(1, TimeUnit.MINUTES)).as("Remaining count was " + countDownLatch.getCount()).isEqualTo(true);
assertThat(countDownLatch.await(1, TimeUnit.MINUTES)).as("Remaining count was " + countDownLatch.getCount()).isTrue();
receive.blockLast();
// assert on the last subflow execution
@@ -192,7 +192,7 @@ public class ForEachItemCaseTest {
Duration.ofSeconds(60));
// we should have triggered 26 subflows
assertThat(countDownLatch.await(1, TimeUnit.MINUTES)).isEqualTo(true);
assertThat(countDownLatch.await(1, TimeUnit.MINUTES)).isTrue();
receive.blockLast();
// assert on the main flow execution
@@ -204,8 +204,8 @@ public class ForEachItemCaseTest {
assertThat(outputs.get("numberOfBatches")).isEqualTo(26);
assertThat(outputs.get("iterations")).isNotNull();
Map<String, Integer> iterations = (Map<String, Integer>) outputs.get("iterations");
assertThat(iterations.get("CREATED")).isEqualTo(0);
assertThat(iterations.get("RUNNING")).isEqualTo(0);
assertThat(iterations.get("CREATED")).isZero();
assertThat(iterations.get("RUNNING")).isZero();
assertThat(iterations.get("FAILED")).isEqualTo(26);
// assert on the last subflow execution
@@ -235,7 +235,7 @@ public class ForEachItemCaseTest {
Duration.ofSeconds(30));
// we should have triggered 26 subflows
assertThat(countDownLatch.await(1, TimeUnit.MINUTES)).isEqualTo(true);
assertThat(countDownLatch.await(1, TimeUnit.MINUTES)).isTrue();
receive.blockLast();
// assert on the main flow execution
@@ -248,8 +248,8 @@ public class ForEachItemCaseTest {
assertThat(outputs.get("iterations")).isNotNull();
Map<String, Integer> iterations = (Map<String, Integer>) outputs.get("iterations");
assertThat(iterations.get("CREATED")).isEqualTo(0);
assertThat(iterations.get("RUNNING")).isEqualTo(0);
assertThat(iterations.get("CREATED")).isZero();
assertThat(iterations.get("RUNNING")).isZero();
assertThat(iterations.get("SUCCESS")).isEqualTo(26);
// assert on the last subflow execution
@@ -331,7 +331,7 @@ public class ForEachItemCaseTest {
Duration.ofSeconds(30));
// we should have triggered 26 subflows
assertThat(countDownLatch.await(1, TimeUnit.MINUTES)).isEqualTo(true);
assertThat(countDownLatch.await(1, TimeUnit.MINUTES)).isTrue();
receive.blockLast();
// assert on the main flow execution
@@ -341,8 +341,8 @@ public class ForEachItemCaseTest {
assertThat(outputs.get("numberOfBatches")).isEqualTo(26);
assertThat(outputs.get("iterations")).isNotNull();
Map<String, Integer> iterations = (Map<String, Integer>) outputs.get("iterations");
assertThat(iterations.get("CREATED")).isEqualTo(0);
assertThat(iterations.get("RUNNING")).isEqualTo(0);
assertThat(iterations.get("CREATED")).isZero();
assertThat(iterations.get("RUNNING")).isZero();
assertThat(iterations.get("SUCCESS")).isEqualTo(26);
// assert on the last subflow execution
@@ -351,7 +351,7 @@ public class ForEachItemCaseTest {
assertThat((String) triggered.get().getInputs().get("items")).matches("kestra:///io/kestra/tests/for-each-item-in-if/executions/.*/tasks/each-split/.*\\.txt");
assertThat(triggered.get().getTaskRunList()).hasSize(1);
Optional<Label> correlationId = triggered.get().getLabels().stream().filter(label -> label.key().equals(Label.CORRELATION_ID)).findAny();
assertThat(correlationId.isPresent()).isEqualTo(true);
assertThat(correlationId.isPresent()).isTrue();
assertThat(correlationId.get().value()).isEqualTo(execution.getId());
}

View File

@@ -94,7 +94,7 @@ class IfTest {
execution = runnerUtils.runOne(null, "io.kestra.tests", "if-without-else", null,
(f, e) -> Map.of("param", false) , Duration.ofSeconds(120));
assertThat(execution.getTaskRunList()).hasSize(1);
assertThat(execution.findTaskRunsByTaskId("when-true").isEmpty()).isEqualTo(true);
assertThat(execution.findTaskRunsByTaskId("when-true").isEmpty()).isTrue();
assertThat(execution.getState().getCurrent()).isEqualTo(State.Type.SUCCESS);
}

View File

@@ -54,7 +54,7 @@ class ParallelTest {
assertThat(execution.findTaskRunsByTaskId("a2").getFirst().getState().getCurrent()).isEqualTo(State.Type.SUCCESS);
assertThat(execution.findTaskRunsByTaskId("e1").getFirst().getState().getCurrent()).isEqualTo(State.Type.SUCCESS);
assertThat(execution.findTaskRunsByTaskId("e2").getFirst().getState().getCurrent()).isEqualTo(State.Type.SUCCESS);
assertThat(execution.findTaskRunsByTaskId("a2").getFirst().getState().getStartDate().isAfter(execution.findTaskRunsByTaskId("a1").getFirst().getState().getEndDate().orElseThrow())).isEqualTo(true);
assertThat(execution.findTaskRunsByTaskId("e2").getFirst().getState().getStartDate().isAfter(execution.findTaskRunsByTaskId("e1").getFirst().getState().getEndDate().orElseThrow())).isEqualTo(true);
assertThat(execution.findTaskRunsByTaskId("a2").getFirst().getState().getStartDate().isAfter(execution.findTaskRunsByTaskId("a1").getFirst().getState().getEndDate().orElseThrow())).isTrue();
assertThat(execution.findTaskRunsByTaskId("e2").getFirst().getState().getStartDate().isAfter(execution.findTaskRunsByTaskId("e1").getFirst().getState().getEndDate().orElseThrow())).isTrue();
}
}

View File

@@ -42,7 +42,7 @@ class StateTest {
execution = runnerUtils.runOne(null, "io.kestra.tests", "state", null, (f, e) -> ImmutableMap.of("state", stateName));
assertThat(execution.getTaskRunList()).hasSize(5);
assertThat(execution.getState().getCurrent()).isEqualTo(State.Type.SUCCESS);
assertThat(execution.findTaskRunsByTaskId("deleteGet").getFirst().getOutputs().get("count")).isEqualTo(0);
assertThat((Integer) execution.findTaskRunsByTaskId("deleteGet").getFirst().getOutputs().get("count")).isZero();
}
@SuppressWarnings("unchecked")

View File

@@ -32,7 +32,7 @@ class SwitchTest {
assertThat(execution.getTaskRunList().get(1).getTaskId()).isEqualTo("t1");
assertThat(execution.findTaskRunsByTaskId("parent-seq").getFirst().getOutputs().get("value")).isEqualTo("FIRST");
assertThat(execution.findTaskRunsByTaskId("parent-seq").getFirst().getOutputs().get("defaults")).isEqualTo(false);
assertThat((Boolean) execution.findTaskRunsByTaskId("parent-seq").getFirst().getOutputs().get("defaults")).isEqualTo(false);
}
@Test
@@ -48,7 +48,7 @@ class SwitchTest {
assertThat(execution.getTaskRunList().get(1).getTaskId()).isEqualTo("t2");
assertThat(execution.findTaskRunsByTaskId("parent-seq").getFirst().getOutputs().get("value")).isEqualTo("SECOND");
assertThat(execution.findTaskRunsByTaskId("parent-seq").getFirst().getOutputs().get("defaults")).isEqualTo(false);
assertThat((Boolean) execution.findTaskRunsByTaskId("parent-seq").getFirst().getOutputs().get("defaults")).isFalse();
assertThat(execution.getTaskRunList().get(2).getTaskId()).isEqualTo("t2_sub");
}
@@ -65,7 +65,7 @@ class SwitchTest {
assertThat(execution.getTaskRunList().get(1).getTaskId()).isEqualTo("t3");
assertThat(execution.findTaskRunsByTaskId("parent-seq").getFirst().getOutputs().get("value")).isEqualTo("THIRD");
assertThat(execution.findTaskRunsByTaskId("parent-seq").getFirst().getOutputs().get("defaults")).isEqualTo(false);
assertThat((Boolean) execution.findTaskRunsByTaskId("parent-seq").getFirst().getOutputs().get("defaults")).isFalse();
assertThat(execution.getTaskRunList().get(2).getTaskId()).isEqualTo("failed");
assertThat(execution.getTaskRunList().get(3).getTaskId()).isEqualTo("error-t1");
}
@@ -83,7 +83,7 @@ class SwitchTest {
assertThat(execution.getTaskRunList().get(1).getTaskId()).isEqualTo("default");
assertThat(execution.findTaskRunsByTaskId("parent-seq").getFirst().getOutputs().get("value")).isEqualTo("DEFAULT");
assertThat(execution.findTaskRunsByTaskId("parent-seq").getFirst().getOutputs().get("defaults")).isEqualTo(true);
assertThat((Boolean)execution.findTaskRunsByTaskId("parent-seq").getFirst().getOutputs().get("defaults")).isTrue();
}
@Test

View File

@@ -235,7 +235,7 @@ public class WorkingDirectoryTest {
.findFirst().get()
.getOutputs()
.get("uris"))
.containsKey("hello.txt")).isEqualTo(true);
.containsKey("hello.txt")).isTrue();
assertThat(execution.getState().getCurrent()).isEqualTo(State.Type.SUCCESS);
}

View File

@@ -49,7 +49,7 @@ class DeleteTest {
Delete.Output run = delete.run(runContext);
// Then
assertThat(run.isDeleted()).isEqualTo(true);
assertThat(run.isDeleted()).isTrue();
}
@Test
@@ -74,7 +74,7 @@ class DeleteTest {
// When
Delete.Output run = delete.run(runContext);
assertThat(run.isDeleted()).isEqualTo(false);
assertThat(run.isDeleted()).isFalse();
Delete finalDelete = delete.toBuilder().errorOnMissing(Property.of(true)).build();
NoSuchElementException noSuchElementException = Assertions.assertThrows(NoSuchElementException.class, () -> finalDelete.run(runContext));

View File

@@ -160,7 +160,7 @@ class SetTest {
final KVStore kv = runContext.namespaceKv(runContext.flowInfo().namespace());
assertThat(kv.getValue(TEST_KEY)).isEqualTo(Optional.of(new KVValue(value)));
Instant expirationDate = kv.get(TEST_KEY).get().expirationDate();
assertThat(expirationDate.isAfter(Instant.now().plus(Duration.ofMinutes(4))) && expirationDate.isBefore(Instant.now().plus(Duration.ofMinutes(6)))).isEqualTo(true);
assertThat(expirationDate.isAfter(Instant.now().plus(Duration.ofMinutes(4))) && expirationDate.isBefore(Instant.now().plus(Duration.ofMinutes(6)))).isTrue();
}
@Test
@@ -191,7 +191,7 @@ class SetTest {
assertThat(kv.getValue(TEST_KEY).orElseThrow().value()).isEqualTo(123.45);
kv = createAndPerformSetTask("true", KVType.BOOLEAN);
assertThat(kv.getValue(TEST_KEY).orElseThrow().value()).isEqualTo(true);
assertThat((Boolean) kv.getValue(TEST_KEY).orElseThrow().value()).isTrue();
kv = createAndPerformSetTask("2023-05-02T01:02:03Z", KVType.DATETIME);
assertThat(kv.getValue(TEST_KEY).orElseThrow().value()).isEqualTo(Instant.parse("2023-05-02T01:02:03Z"));

Some files were not shown because too many files have changed in this diff Show More