Skip to content

Commit

Permalink
Fixed vulnerabilities
Browse files Browse the repository at this point in the history
  • Loading branch information
pollyvolk committed Dec 20, 2022
1 parent 6950ea8 commit 1968d0b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
16 changes: 11 additions & 5 deletions src/test/java/org/cqfn/reportwine/MainTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
*
* @since 0.1
*/
@SuppressWarnings("PMD.TooManyMethods")
class MainTest {
/**
* The "--template" option.
Expand Down Expand Up @@ -71,6 +72,11 @@ class MainTest {
*/
private static final String REPORT_DOCX = "report.docx";

/**
* The "project_valid" file.
*/
private static final String PROJECT_VALID = "project_valid.yml";

/**
* The capturer for Logger.
*/
Expand All @@ -89,7 +95,7 @@ void testDocxNoException(@TempDir final Path source) {
MainTest.OUTPUT,
source.resolve(MainTest.REPORT_DOCX).toString(),
MainTest.PROJECT,
MainTest.TESTS_PATH.concat("project_valid.yml"),
MainTest.TESTS_PATH.concat(MainTest.PROJECT_VALID),
};
boolean caught = false;
try {
Expand All @@ -112,7 +118,7 @@ void testNoExceptionWithConfig(@TempDir final Path source) {
MainTest.OUTPUT,
source.resolve(MainTest.REPORT_DOCX).toString(),
MainTest.PROJECT,
MainTest.TESTS_PATH.concat("project_valid.yml"),
MainTest.TESTS_PATH.concat(MainTest.PROJECT_VALID),
"--config",
MainTest.TESTS_PATH.concat("config.yml"),
};
Expand Down Expand Up @@ -210,7 +216,7 @@ void testPassingNotFoundPptx(@TempDir final Path source) {
MainTest.OUTPUT,
source.resolve("report.pptx").toString(),
MainTest.PROJECT,
MainTest.TESTS_PATH.concat("project_valid.yml"),
MainTest.TESTS_PATH.concat(MainTest.PROJECT_VALID),
};
boolean caught = false;
try {
Expand All @@ -234,7 +240,7 @@ void testPassingEmptyPptx(@TempDir final Path source) {
MainTest.OUTPUT,
source.resolve("report.pptx").toString(),
MainTest.PROJECT,
MainTest.TESTS_PATH.concat("project_valid.yml"),
MainTest.TESTS_PATH.concat(MainTest.PROJECT_VALID),
};
boolean caught = false;
try {
Expand Down Expand Up @@ -335,7 +341,7 @@ void testWithDifferentFileExtensions(@TempDir final Path source)
MainTest.OUTPUT,
source.resolve("report.pptx").toString(),
MainTest.PROJECT,
MainTest.TESTS_PATH.concat("project_valid.yml"),
MainTest.TESTS_PATH.concat(MainTest.PROJECT_VALID),
};
boolean caught = false;
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@
import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;

import com.google.gson.JsonElement;
import org.cqfn.reportwine.converters.YamlToIrConverter;
import org.cqfn.reportwine.exceptions.BaseException;
import org.junit.jupiter.api.Assertions;
Expand Down Expand Up @@ -68,8 +66,7 @@ void testTextSerialization() {
@Test
void testNumericTextSerialization() {
final Text text = new Text("3.14");
final JsonElement value = text.toJson();
Assertions.assertEquals(3.14, value.getAsDouble());
Assertions.assertEquals(3.14, text.toJson().getAsDouble());
}

/**
Expand Down

0 comments on commit 1968d0b

Please sign in to comment.