Skip to content

Commit c4c13c6

Browse files
(fix) Break Integration Tests into small sets of use cases (#166)
* (fix) Break Integration Tests into small sets of use cases Signed-off-by: Ricardo Zanini <[email protected]> * Optmize Wiremocks imports Signed-off-by: Ricardo Zanini <[email protected]> * Add simple quotes to mvn -D parameter to run on Windows Signed-off-by: Ricardo Zanini <[email protected]> Signed-off-by: Ricardo Zanini <[email protected]>
1 parent 1b27115 commit c4c13c6

File tree

43 files changed

+874
-173
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+874
-173
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,4 @@ jobs:
4242
cache: 'maven'
4343

4444
- name: Build with Maven
45-
run: mvn -B formatter:validate verify --file pom.xml
45+
run: mvn '-Dorg.slf4j.simpleLogger.log.org.openapitools=off' -B formatter:validate verify --file pom.xml

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,8 @@ If the OpenAPI specification file has `securitySchemes` definitions, but no [Sec
160160
| -------------------- | -------------------------------------------------------------- | ---------------------------------------------------- |
161161
| Create security for the referenced security scheme | `quarkus.openapi-generator.codegen.default.security.scheme` | `quarkus.openapi-generator.codegen.default.security.scheme=api_key` |
162162

163+
See the module [security](integration-tests/security) for an example of how to use this feature.
164+
163165
### Basic HTTP Authentication
164166

165167
For Basic HTTP Authentication, these are the supported configurations:
@@ -239,6 +241,7 @@ For this to work you **must** add [Quarkus OIDC Client Filter Extension](https:/
239241
</dependency>
240242
````
241243

244+
See the module [generation-tests](integration-tests/generation-tests) for an example of how to use this feature.
242245

243246
## Authorization Token Propagation
244247

@@ -444,6 +447,8 @@ org.acme.openapi.simple.api.DefaultApi/byeGet/CircuitBreaker/failureRatio=3.14
444447
org.acme.openapi.simple.api.DefaultApi/byeGet/CircuitBreaker/successThreshold=22
445448
````
446449

450+
See the module [circuit-breaker](integration-tests/circuit-breaker) for an example of how to use this feature.
451+
447452
## Sending multipart/form-data
448453

449454
The rest client also supports request with mime-type multipart/form-data and, if the schema of the request body is known in advance, we can also automatically generate the models of the request
@@ -513,6 +518,8 @@ the `skip-form-model` property corresponding to your spec in the `application.pr
513518
quarkus.openapi-generator.codegen.spec.my_multipart_requests_yml.skip-form-model=false
514519
```
515520

521+
See the module [multipart-request](integration-tests/multipart-request) for an example of how to use this feature.
522+
516523
### Default content-types according to OpenAPI Specification and limitations
517524

518525
The [OAS 3.0](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#special-considerations-for-multipart-content) specifies the following default content-types for a multipart:
@@ -586,6 +593,8 @@ public interface DefaultApi {
586593
}
587594
```
588595

596+
See the module [register-provider](integration-tests/register-provider) for an example of how to use this feature.
597+
589598
## Skip OpenAPI schema validation
590599

591600
Use the property key `quarkus.openapi-generator.codegen.validateSpec=false` to disable validating the input specification file before code generation. By default, invalid specifications will result in an error.
@@ -603,6 +612,8 @@ Note that these configuration properties are maps where the keys are OAS data ty
603612

604613
It's also possible to only use a type mapping with a fully qualified name, for instance `quarkus.openapi-generator.codegen.spec.my_spec_yml.type-mappings.File=java.io.InputStream`. For more information and a list of all types see the OpenAPI generator documentation on [Type Mappings and Import Mappings](https://openapi-generator.tech/docs/usage/#type-mappings-and-import-mappings). (Note that you won't be able to change all types as some are hardcoded in the generator, e.g. the OAS type DateTime.)
605614

615+
See the module [type-mapping](integration-tests/type-mapping) for an example of how to use this feature.
616+
606617
## Known Limitations
607618

608619
These are the known limitations of this pre-release version:
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
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/xsd/maven-4.0.0.xsd">
5+
<parent>
6+
<artifactId>quarkus-openapi-generator-integration-tests</artifactId>
7+
<groupId>io.quarkiverse.openapi.generator</groupId>
8+
<version>1.0.0-SNAPSHOT</version>
9+
</parent>
10+
<modelVersion>4.0.0</modelVersion>
11+
12+
<artifactId>quarkus-openapi-generator-it-circuit-breaker</artifactId>
13+
<name>Quarkus - Openapi Generator - Integration Tests - Circuit Breaker</name>
14+
15+
<dependencies>
16+
<dependency>
17+
<groupId>io.quarkiverse.openapi.generator</groupId>
18+
<artifactId>quarkus-openapi-generator</artifactId>
19+
</dependency>
20+
<dependency>
21+
<groupId>org.eclipse.microprofile.fault-tolerance</groupId>
22+
<artifactId>microprofile-fault-tolerance-api</artifactId>
23+
</dependency>
24+
<dependency>
25+
<groupId>io.quarkus</groupId>
26+
<artifactId>quarkus-junit5</artifactId>
27+
<scope>test</scope>
28+
</dependency>
29+
<dependency>
30+
<groupId>io.quarkiverse.openapi.generator</groupId>
31+
<artifactId>quarkus-openapi-generator-test-utils</artifactId>
32+
<scope>test</scope>
33+
</dependency>
34+
</dependencies>
35+
36+
<build>
37+
<plugins>
38+
<plugin>
39+
<groupId>io.quarkus</groupId>
40+
<artifactId>quarkus-maven-plugin</artifactId>
41+
<extensions>true</extensions>
42+
<executions>
43+
<execution>
44+
<goals>
45+
<goal>build</goal>
46+
<goal>generate-code</goal>
47+
<goal>generate-code-tests</goal>
48+
</goals>
49+
</execution>
50+
</executions>
51+
</plugin>
52+
</plugins>
53+
</build>
54+
<profiles>
55+
<profile>
56+
<id>native-image</id>
57+
<activation>
58+
<property>
59+
<name>native</name>
60+
</property>
61+
</activation>
62+
<build>
63+
<plugins>
64+
<plugin>
65+
<artifactId>maven-surefire-plugin</artifactId>
66+
<configuration>
67+
<skipTests>${native.surefire.skip}</skipTests>
68+
</configuration>
69+
</plugin>
70+
<plugin>
71+
<artifactId>maven-failsafe-plugin</artifactId>
72+
<executions>
73+
<execution>
74+
<goals>
75+
<goal>integration-test</goal>
76+
<goal>verify</goal>
77+
</goals>
78+
<configuration>
79+
<systemPropertyVariables>
80+
<native.image.path>${project.build.directory}/${project.build.finalName}-runner</native.image.path>
81+
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
82+
<maven.home>${maven.home}</maven.home>
83+
</systemPropertyVariables>
84+
</configuration>
85+
</execution>
86+
</executions>
87+
</plugin>
88+
</plugins>
89+
</build>
90+
<properties>
91+
<quarkus.package.type>native</quarkus.package.type>
92+
</properties>
93+
</profile>
94+
</profiles>
95+
</project>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
org.acme.openapi.simple.api.DefaultApi/byeGet/CircuitBreaker/enabled=true
2+
org.acme.openapi.simple.api.DefaultApi/byeGet/CircuitBreaker/failOn = java.lang.IllegalArgumentException,java.lang.NullPointerException
3+
org.acme.openapi.simple.api.DefaultApi/byeGet/CircuitBreaker/skipOn = java.lang.NumberFormatException, java.lang.IndexOutOfBoundsException
4+
org.acme.openapi.simple.api.DefaultApi/byeGet/CircuitBreaker/delay = 33
5+
org.acme.openapi.simple.api.DefaultApi/byeGet/CircuitBreaker/delayUnit = MILLIS
6+
org.acme.openapi.simple.api.DefaultApi/byeGet/CircuitBreaker/requestVolumeThreshold = 42
7+
org.acme.openapi.simple.api.DefaultApi/byeGet/CircuitBreaker/failureRatio = 3.14
8+
org.acme.openapi.simple.api.DefaultApi/byeGet/CircuitBreaker/successThreshold = 22
9+
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
package io.quarkiverse.openapi.generator.it;
1+
package io.quarkiverse.openapi.generator.it.circuit.breaker;
22

3-
import static io.quarkiverse.openapi.generator.it.assertions.Assertions.assertThat;
4-
import static org.assertj.core.api.Assertions.assertThat;
3+
import static io.quarkiverse.openapi.generator.it.circuit.breaker.assertions.Assertions.assertThat;
54
import static org.junit.jupiter.api.Assertions.assertNotEquals;
65

76
import java.io.IOException;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package io.quarkiverse.openapi.generator.it.assertions;
1+
package io.quarkiverse.openapi.generator.it.circuit.breaker.assertions;
22

33
import com.github.javaparser.ast.body.MethodDeclaration;
44

integration-tests/example-project/src/main/resources/application.properties

Lines changed: 0 additions & 40 deletions
This file was deleted.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# OpenAPI Generator - OpenAPISpecInputProvider Example
2+
3+
This module exemplifies a library that provides the OpenAPI specification file as an input stream reference.
4+
5+
See [generation-tests](../generation-tests) as a how to use example.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# OpenAPI Generator - OpenAPISpecInputProvider Example Usage
2+
3+
This module exemplifies how to use an input stream instead of a file in the `openapi` directory to generate the Rest Clients.
4+
5+
See the [generation-input](../generation-input) module as a library reference.

0 commit comments

Comments
 (0)