OpenAPITools / OpenAPITools/openapi-generator
[REQ] A configuration of the JUnit version used for the tests produced by the Java generator
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
Is your feature request related to a problem? Please describe.
We are using the Java generator in order to access other REST resources. The generated code also produces JUnit tests (a nice feature to keep our test coverage threshold) but they are designed to use the JUnit 4 library. In our case we only use JUnit 5. At the moment there is no possibility to configure this.
Describe the solution you'd like
The openapi-generator-maven-plugin has already the configuration to turn off the API tests and Model tests (configuration parameters: generateApiTests and generateModelTests). Another configuration to determine the utilized JUnit library in these tests would be nice.
Describe alternatives you've considered
Maybe to supersede the default case of now using JUnit 5 instead of the old JUnit 4 library.
Additional context
In the beginning I have asked at Stackoverflow to get some help and somone mentioned to create a Feature Request here:
https://stackoverflow.com/questions/76920305/generated-test-classes-use-junit-4
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the openapi-generator-maven-plugin configuration and its existing generateApiTests and generateModelTests parameters. Trace how the Java generator produces API and model test classes and identifies their JUnit dependency. Done means generated tests can use a selected JUnit library, including JUnit 4 and JUnit 5, without breaking the existing test-generation options.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- testing, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100