-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Co-authored-by: yuhaibohotmail <[email protected]>
- Loading branch information
1 parent
b4d52c0
commit 10be4d3
Showing
10 changed files
with
264 additions
and
0 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
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
91 changes: 91 additions & 0 deletions
91
client/integration-tests/remove-operationid-prefix/pom.xml
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,91 @@ | ||
<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>io.quarkiverse.openapi.generator</groupId> | ||
<artifactId>quarkus-openapi-generator-integration-tests</artifactId> | ||
<version>3.0.0-SNAPSHOT</version> | ||
</parent> | ||
|
||
<artifactId>quarkus-openapi-generator-it-remove-operationid-prefix</artifactId> | ||
<name>Quarkus - Openapi Generator - Integration Tests - Client - remove operation id prefix</name> | ||
<description>Example project for general usage with remove operation id prefix</description> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>io.quarkiverse.openapi.generator</groupId> | ||
<artifactId>quarkus-openapi-generator</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.assertj</groupId> | ||
<artifactId>assertj-core</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-junit5</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-maven-plugin</artifactId> | ||
<extensions>true</extensions> | ||
<executions> | ||
<execution> | ||
<goals> | ||
<goal>build</goal> | ||
<goal>generate-code</goal> | ||
<goal>generate-code-tests</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
<profiles> | ||
<profile> | ||
<id>native-image</id> | ||
<activation> | ||
<property> | ||
<name>native</name> | ||
</property> | ||
</activation> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<artifactId>maven-surefire-plugin</artifactId> | ||
<configuration> | ||
<skipTests>${native.surefire.skip}</skipTests> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<artifactId>maven-failsafe-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<goals> | ||
<goal>integration-test</goal> | ||
<goal>verify</goal> | ||
</goals> | ||
<configuration> | ||
<systemPropertyVariables> | ||
<native.image.path>${project.build.directory}/${project.build.finalName}-runner</native.image.path> | ||
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager> | ||
<maven.home>${maven.home}</maven.home> | ||
</systemPropertyVariables> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
<properties> | ||
<quarkus.package.type>native</quarkus.package.type> | ||
</properties> | ||
</profile> | ||
</profiles> | ||
|
||
</project> |
108 changes: 108 additions & 0 deletions
108
...-tests/remove-operationid-prefix/src/main/openapi/openapi-remove-operation-id-prefix.yaml
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,108 @@ | ||
--- | ||
openapi: 3.0.3 | ||
info: | ||
title: code-with-quarkus API | ||
version: 1.0.0-SNAPSHOT | ||
servers: | ||
- url: http://localhost:8080 | ||
description: Auto generated value | ||
- url: http://0.0.0.0:8080 | ||
description: Auto generated value | ||
paths: | ||
/users: | ||
get: | ||
tags: | ||
- User Resource | ||
description: Find All | ||
operationId: UserResource_findAll | ||
responses: | ||
"200": | ||
description: OK | ||
content: | ||
application/json: | ||
schema: | ||
type: array | ||
items: | ||
$ref: "#/components/schemas/User" | ||
post: | ||
tags: | ||
- User Resource | ||
description: Add | ||
operationId: UserResource_add | ||
requestBody: | ||
content: | ||
application/json: | ||
schema: | ||
$ref: "#/components/schemas/User" | ||
responses: | ||
"200": | ||
description: OK | ||
content: | ||
application/json: | ||
schema: | ||
$ref: "#/components/schemas/User" | ||
/users/{id}: | ||
get: | ||
tags: | ||
- User Resource | ||
description: Find | ||
operationId: UserResource_find | ||
parameters: | ||
- name: id | ||
in: path | ||
required: true | ||
schema: | ||
format: int32 | ||
type: integer | ||
responses: | ||
"200": | ||
description: OK | ||
content: | ||
application/json: | ||
schema: | ||
$ref: "#/components/schemas/User" | ||
put: | ||
tags: | ||
- User Resource | ||
description: Update | ||
operationId: UserResource_update | ||
parameters: | ||
- name: id | ||
in: path | ||
required: true | ||
schema: | ||
format: int32 | ||
type: integer | ||
requestBody: | ||
content: | ||
application/json: | ||
schema: | ||
$ref: "#/components/schemas/User" | ||
responses: | ||
"204": | ||
description: No Content | ||
delete: | ||
tags: | ||
- User Resource | ||
description: Delete | ||
operationId: UserResource_delete | ||
parameters: | ||
- name: id | ||
in: path | ||
required: true | ||
schema: | ||
format: int32 | ||
type: integer | ||
responses: | ||
"204": | ||
description: No Content | ||
components: | ||
schemas: | ||
User: | ||
type: object | ||
properties: | ||
id: | ||
format: int32 | ||
type: integer | ||
name: | ||
type: string |
2 changes: 2 additions & 0 deletions
2
client/integration-tests/remove-operationid-prefix/src/main/resources/application.properties
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,2 @@ | ||
quarkus.rest-client.quarkus_simple_openapi_yaml.url=http://localhost:8080 | ||
quarkus.openapi-generator.codegen.spec.openapi_remove_operation_id_prefix_yaml.remove-operation-id-prefix=true |
33 changes: 33 additions & 0 deletions
33
...prefix/src/test/java/io/quarkiverse/openapi/generator/it/RemoveOperationIdPrefixTest.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,33 @@ | ||
package io.quarkiverse.openapi.generator.it; | ||
|
||
import static org.assertj.core.api.Assertions.assertThatCode; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
import io.quarkus.test.junit.QuarkusTest; | ||
|
||
@QuarkusTest | ||
public class RemoveOperationIdPrefixTest { | ||
|
||
String apiClassName = "org.openapi.quarkus.openapi_remove_operation_id_prefix_yaml.api.UserResourceApi"; | ||
String modelClassName = "org.openapi.quarkus.openapi_remove_operation_id_prefix_yaml.model.User"; | ||
|
||
@Test | ||
void apiIsBeingGenerated() { | ||
assertThatCode(() -> Class.forName(apiClassName).getMethod("find", Integer.class)) | ||
.doesNotThrowAnyException(); | ||
|
||
assertThatCode(() -> Class.forName(apiClassName).getMethod("findAll")) | ||
.doesNotThrowAnyException(); | ||
|
||
assertThatCode(() -> Class.forName(apiClassName).getMethod("add", Class.forName(modelClassName))) | ||
.doesNotThrowAnyException(); | ||
|
||
assertThatCode(() -> Class.forName(apiClassName).getMethod("update", Integer.class, Class.forName(modelClassName))) | ||
.doesNotThrowAnyException(); | ||
|
||
assertThatCode(() -> Class.forName(apiClassName).getMethod("delete", Integer.class)) | ||
.doesNotThrowAnyException(); | ||
|
||
} | ||
} |
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