Skip to content

Commit 4637658

Browse files
fix: Upgrade testng to avoid CVE-2022-4065 (#18635)
1 parent 4253693 commit 4637658

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

modules/openapi-generator/src/test/java/org/openapitools/codegen/AbstractIntegrationTest.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,11 @@
1717

1818
package org.openapitools.codegen;
1919

20+
import java.nio.file.Files;
21+
import java.util.stream.Collectors;
2022
import io.swagger.v3.oas.models.OpenAPI;
2123
import org.openapitools.codegen.testutils.IntegrationTestPathsConfig;
2224
import org.testng.annotations.Test;
23-
import org.testng.reporters.Files;
2425

2526
import java.io.IOException;
2627
import java.util.HashMap;
@@ -51,7 +52,7 @@ public void generatesCorrectDirectoryStructure() throws IOException {
5152

5253
IntegrationTestPathsConfig integrationTestPathsConfig = getIntegrationTestPathsConfig();
5354

54-
String specContent = Files.readFile(integrationTestPathsConfig.getSpecPath().toFile());
55+
String specContent = Files.lines(integrationTestPathsConfig.getSpecPath()).collect(Collectors.joining("\n"));
5556
OpenAPI openAPI = TestUtils.parseContent(specContent);
5657

5758

pom.xml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2-
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
35
<parent>
46
<groupId>org.sonatype.oss</groupId>
57
<artifactId>oss-parent</artifactId>
68
<version>5</version>
7-
<relativePath/>
8-
<!-- lookup parent from repository -->
9+
<relativePath />
10+
<!-- lookup parent from repository -->
911
</parent>
1012
<modelVersion>4.0.0</modelVersion>
1113
<groupId>org.openapitools</groupId>
@@ -505,7 +507,8 @@
505507
<failOnError>false</failOnError>
506508
<!-- https://spotbugs.readthedocs.io/en/stable/effort.html -->
507509
<effort>min</effort>
508-
<excludeFilterFile>${project.basedir}${file.separator}spotbugs-exclude.xml</excludeFilterFile>
510+
<excludeFilterFile>
511+
${project.basedir}${file.separator}spotbugs-exclude.xml</excludeFilterFile>
509512
</configuration>
510513
<executions>
511514
<execution>
@@ -1253,10 +1256,10 @@
12531256
<spotbugs-plugin.version>3.1.12.2</spotbugs-plugin.version>
12541257
<swagger-parser-groupid.version>io.swagger.parser.v3</swagger-parser-groupid.version>
12551258
<swagger-parser.version>2.1.22</swagger-parser.version>
1256-
<testng.version>7.5</testng.version>
1259+
<testng.version>7.10.2</testng.version>
12571260
<violations-maven-plugin.version>1.34</violations-maven-plugin.version>
12581261
<wagon-ssh-external.version>3.4.3</wagon-ssh-external.version>
12591262
<wagon-svn.version>1.12</wagon-svn.version>
12601263
<wagon-webdav.version>1.0-beta-2</wagon-webdav.version>
12611264
</properties>
1262-
</project>
1265+
</project>

0 commit comments

Comments
 (0)