Change/reintroduce junit5 (#18790)

* Revert "Revert back to junit4 (#18786)"

This reverts commit 2471ba2d2e.

* Make junit engine execute TestNG test cases

* Fix failing test and use tempDir's for test code generation

* Make test fail with helpful info in case generator throws exception

* Suppress error output from TestUtils

* Remove transitive junit4 dependency

* Sync guava-testlib version with guava version

* Add hint regarding alternative for guava-testlib's FakeTicker
This commit is contained in:
Philzen
2024-06-01 10:40:40 +02:00
committed by GitHub
parent 368110a631
commit 6a6f39d6f4
29 changed files with 828 additions and 806 deletions

View File

@@ -41,7 +41,6 @@
</systemPropertyVariables>
<argLine>-Xms512m -Xmx1500m</argLine>
<parallel>methods</parallel>
<forkMode>pertest</forkMode>
</configuration>
</plugin>
@@ -114,8 +113,8 @@
<scope>provided</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>${junit-version}</version>
<scope>test</scope>
</dependency>
@@ -124,6 +123,6 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<openapi-generator-version>7.7.0-SNAPSHOT</openapi-generator-version>
<maven-plugin-version>1.0.0</maven-plugin-version>
<junit-version>4.13.2</junit-version>
<junit-version>5.10.2</junit-version>
</properties>
</project>

View File

@@ -1,6 +1,6 @@
package com.my.company.codegen;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.openapitools.codegen.ClientOptInput;
import org.openapitools.codegen.DefaultGenerator;
import org.openapitools.codegen.config.CodegenConfigurator;
@@ -33,4 +33,4 @@ public class MyclientcodegenGeneratorTest {
DefaultGenerator generator = new DefaultGenerator();
generator.opts(clientOptInput).generate();
}
}
}