-
spring-boot-black-box-testing-example
An example of black box testing implementation in Spring Boot application
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
-
openapi-generator
OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)
-
gradle-testsets-plugin
A plugin for the Gradle build system that allows specifying test sets (like integration or acceptance tests).
-
SaaSHub
SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives
You can find the code examples in this repository.
The generated classes should be put into .gitignore. Otherwise, if you have Checkstyle, PMD, or SonarQube in your project, then generated classes can violate some rules. Besides, if you don't put them into .gitignore, then each pull request might become huge due to the fact that even a slightest fix can lead to lots of changes in the generated classes.
In this article, I'm showing you how to configure the corresponding Gradle plugin. Anyway, there is Maven plugin as well and the approach won't be different much.
I'm using Spring Data JPA as a persistence framework. Therefore, those classes are Hibernate entities.
Firstly, let's add the gradle-testsets plugin and define a separate test source that'll contain the OpenAPITest file. It's the one that generates the open-api.json specification. Take a look at the code example below.
The SpringDoc library comes with lots of annotations to tune your REST API specification precisely. Anyway, that's out of context of this article.
The generated classes should be put into .gitignore. Otherwise, if you have Checkstyle, PMD, or SonarQube in your project, then generated classes can violate some rules. Besides, if you don't put them into .gitignore, then each pull request might become huge due to the fact that even a slightest fix can lead to lots of changes in the generated classes.
I'm using Spring Data JPA as a persistence framework. Therefore, those classes are Hibernate entities.
Spring Boot comes with a brilliant OpenAPI support. All you have to do is to add two dependencies. Look at the Gradle configuration below.