Skip to content

Commit

Permalink
chore: Add unit test for additional branches
Browse files Browse the repository at this point in the history
  • Loading branch information
en-milie committed Sep 9, 2024
1 parent bc57fa4 commit 8468aed
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/test/java/com/endava/cats/args/FilesArgumentsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ void shouldLoadPathsOrder() throws Exception {
void shouldLoadMutators() throws Exception {
FilesArguments filesArguments = new FilesArguments();
filesArguments.setMutatorsFolder(new File("src/test/resources/mutators"));
filesArguments.loadMutators();

org.assertj.core.api.Assertions.assertThat(filesArguments.getMutatorsFolder()).isDirectory();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -746,7 +746,7 @@ void shouldRecordErrorWhenParamRefDoesNotExist() throws Exception {
}

@Test
void shouldExtractMultiLevelExamples() throws Exception {
void shouldExtractMultiLevelExamples() {
ObjectMapper objectMapper = new ObjectMapper();
ObjectNode exampleMapObject = objectMapper.createObjectNode();
exampleMapObject.set("WORKER_COMPENSATION_PAYRATE_POST_PATCH", objectMapper.createObjectNode().put("value", "catsIsCool"));
Expand Down
22 changes: 22 additions & 0 deletions src/test/java/com/endava/cats/util/CatsModeLUtilsTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package com.endava.cats.util;

import io.quarkus.test.junit.QuarkusTest;
import org.assertj.core.api.Assertions;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.CsvSource;

@QuarkusTest
class CatsModeLUtilsTest {

@ParameterizedTest
@CsvSource(value = {
"#/components/schemas/SomeSchema, SomeSchema",
"#/components/schemas/AnotherSchema, AnotherSchema",
"#/components/schemas/YetAnotherSchema, YetAnotherSchema",
"null,null", "#/paths/path1,#/paths/path1"}, nullValues = "null")
void shouldReturnSimpleReference(String ref, String expected) {
String result = CatsModelUtils.getSimpleRef(ref);

Assertions.assertThat(result).isEqualTo(expected);
}
}

0 comments on commit 8468aed

Please sign in to comment.