-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tests to check content type between services and openapi
Signed-off-by: Phillip Kruger <phillip.kruger@gmail.com>
- Loading branch information
1 parent
12ef71e
commit b3857b5
Showing
63 changed files
with
7,559 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,4 +34,4 @@ public void testOpenApiPathAccessResource() { | |
Matchers.containsString("#/components/schemas/Greeting")); | ||
|
||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,171 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<parent> | ||
<artifactId>quarkus-integration-tests-parent</artifactId> | ||
<groupId>io.quarkus</groupId> | ||
<version>999-SNAPSHOT</version> | ||
</parent> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<artifactId>quarkus-integration-test-openapi</artifactId> | ||
<name>Quarkus - Integration Tests - OpenAPI</name> | ||
<description>The openapi integration tests module</description> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-smallrye-openapi</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-resteasy-reactive-jackson</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-reactive-routes</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-spring-web</artifactId> | ||
</dependency> | ||
|
||
<!-- test dependencies --> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-junit5</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-junit5-component</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.rest-assured</groupId> | ||
<artifactId>rest-assured</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.assertj</groupId> | ||
<artifactId>assertj-core</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
|
||
<!-- Minimal test dependencies to *-deployment artifacts for consistent build order --> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-reactive-routes-deployment</artifactId> | ||
<version>${project.version}</version> | ||
<type>pom</type> | ||
<scope>test</scope> | ||
<exclusions> | ||
<exclusion> | ||
<groupId>*</groupId> | ||
<artifactId>*</artifactId> | ||
</exclusion> | ||
</exclusions> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-resteasy-reactive-jackson-deployment</artifactId> | ||
<version>${project.version}</version> | ||
<type>pom</type> | ||
<scope>test</scope> | ||
<exclusions> | ||
<exclusion> | ||
<groupId>*</groupId> | ||
<artifactId>*</artifactId> | ||
</exclusion> | ||
</exclusions> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-smallrye-openapi-deployment</artifactId> | ||
<version>${project.version}</version> | ||
<type>pom</type> | ||
<scope>test</scope> | ||
<exclusions> | ||
<exclusion> | ||
<groupId>*</groupId> | ||
<artifactId>*</artifactId> | ||
</exclusion> | ||
</exclusions> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-spring-web-deployment</artifactId> | ||
<version>${project.version}</version> | ||
<type>pom</type> | ||
<scope>test</scope> | ||
<exclusions> | ||
<exclusion> | ||
<groupId>*</groupId> | ||
<artifactId>*</artifactId> | ||
</exclusion> | ||
</exclusions> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<resources> | ||
<resource> | ||
<directory>src/main/resources</directory> | ||
<filtering>true</filtering> | ||
</resource> | ||
</resources> | ||
<plugins> | ||
<plugin> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-maven-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<goals> | ||
<goal>build</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-surefire-plugin</artifactId> | ||
<configuration> | ||
<runOrder>alphabetical</runOrder> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
<profiles> | ||
|
||
<profile> | ||
<id>native-image</id> | ||
<activation> | ||
<property> | ||
<name>native</name> | ||
</property> | ||
</activation> | ||
<!-- add some custom config, the rest comes from parent --> | ||
<properties> | ||
<quarkus.native.add-all-charsets>true</quarkus.native.add-all-charsets> | ||
</properties> | ||
</profile> | ||
|
||
<profile> | ||
<id>no-native</id> | ||
<activation> | ||
<property> | ||
<name>!native</name> | ||
</property> | ||
</activation> | ||
<!-- these properties must not be defined in the general properties, | ||
otherwise the native profile in the parent pom is not able to override them --> | ||
<properties> | ||
<quarkus.package.type>uber-jar</quarkus.package.type> | ||
</properties> | ||
</profile> | ||
|
||
</profiles> | ||
|
||
</project> |
31 changes: 31 additions & 0 deletions
31
integration-tests/openapi/src/main/java/io/quarkus/it/openapi/Greeting.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package io.quarkus.it.openapi; | ||
|
||
public class Greeting { | ||
private int id; | ||
private String salutation; | ||
|
||
public Greeting() { | ||
|
||
} | ||
|
||
public Greeting(int id, String salutation) { | ||
this.id = id; | ||
this.salutation = salutation; | ||
} | ||
|
||
public int getId() { | ||
return id; | ||
} | ||
|
||
public void setId(int id) { | ||
this.id = id; | ||
} | ||
|
||
public String getSalutation() { | ||
return salutation; | ||
} | ||
|
||
public void setSalutation(String salutation) { | ||
this.salutation = salutation; | ||
} | ||
} |
98 changes: 98 additions & 0 deletions
98
integration-tests/openapi/src/main/java/io/quarkus/it/openapi/jaxrs/BigDecimalResource.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
package io.quarkus.it.openapi.jaxrs; | ||
|
||
import java.math.BigDecimal; | ||
import java.util.Arrays; | ||
import java.util.List; | ||
import java.util.Optional; | ||
import java.util.concurrent.CompletableFuture; | ||
import java.util.concurrent.CompletionStage; | ||
|
||
import jakarta.ws.rs.GET; | ||
import jakarta.ws.rs.POST; | ||
import jakarta.ws.rs.Path; | ||
|
||
import org.jboss.resteasy.reactive.RestResponse; | ||
|
||
import io.smallrye.mutiny.Uni; | ||
|
||
@Path("/jax-rs/defaultContentType") | ||
public class BigDecimalResource { | ||
@GET | ||
@Path("/justBigDecimal") | ||
public BigDecimal justBigDecimal() { | ||
return new BigDecimal("0"); | ||
} | ||
|
||
@POST | ||
@Path("/justBigDecimal") | ||
public BigDecimal justBigDecimal(BigDecimal body) { | ||
return body; | ||
} | ||
|
||
@GET | ||
@Path("/restResponseBigDecimal") | ||
public RestResponse<BigDecimal> restResponseBigDecimal() { | ||
return RestResponse.ok(new BigDecimal("0")); | ||
} | ||
|
||
@POST | ||
@Path("/restResponseBigDecimal") | ||
public RestResponse<BigDecimal> restResponseBigDecimal(BigDecimal body) { | ||
return RestResponse.ok(body); | ||
} | ||
|
||
@GET | ||
@Path("/optionalBigDecimal") | ||
public Optional<BigDecimal> optionalBigDecimal() { | ||
return Optional.of(new BigDecimal("0")); | ||
} | ||
|
||
@POST | ||
@Path("/optionalBigDecimal") | ||
public Optional<BigDecimal> optionalBigDecimal(Optional<BigDecimal> body) { | ||
return body; | ||
} | ||
|
||
@GET | ||
@Path("/uniBigDecimal") | ||
public Uni<BigDecimal> uniBigDecimal() { | ||
return Uni.createFrom().item(new BigDecimal("0")); | ||
} | ||
|
||
@GET | ||
@Path("/completionStageBigDecimal") | ||
public CompletionStage<BigDecimal> completionStageBigDecimal() { | ||
return CompletableFuture.completedStage(new BigDecimal("0")); | ||
} | ||
|
||
@GET | ||
@Path("/completedFutureBigDecimal") | ||
public CompletableFuture<BigDecimal> completedFutureBigDecimal() { | ||
return CompletableFuture.completedFuture(new BigDecimal("0")); | ||
} | ||
|
||
@GET | ||
@Path("/listBigDecimal") | ||
public List<BigDecimal> listBigDecimal() { | ||
return Arrays.asList(new BigDecimal[] { new BigDecimal("0") }); | ||
} | ||
|
||
@POST | ||
@Path("/listBigDecimal") | ||
public List<BigDecimal> listBigDecimal(List<BigDecimal> body) { | ||
return body; | ||
} | ||
|
||
@GET | ||
@Path("/arrayBigDecimal") | ||
public BigDecimal[] arrayBigDecimal() { | ||
return new BigDecimal[] { new BigDecimal("0") }; | ||
} | ||
|
||
@POST | ||
@Path("/arrayBigDecimal") | ||
public BigDecimal[] arrayBigDecimal(BigDecimal[] body) { | ||
return body; | ||
} | ||
|
||
} |
Oops, something went wrong.