Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Wiki
  • Integration Tests

Integration Tests · Changes

Page history
Add info about the echo server authored Dec 18, 2022 by William Cheng's avatar William Cheng
Show whitespace changes
Inline Side-by-side
Integration-Tests.md
View page @ 73be31e5
...@@ -43,3 +43,34 @@ To setup the test server locally, please run ...@@ -43,3 +43,34 @@ To setup the test server locally, please run
and add the following entry to your host table: and add the following entry to your host table:
`127.0.0.1 petstore.swagger.io` `127.0.0.1 petstore.swagger.io`
## Echo server
Echo server tests are newly added in Nov 2022. Eventually it will replace the PetStore server tests, which couldn't meet the growing requirements in terms of test coverage of the auto-generated code.
To run the server:
```
git clone https://github.com/wing328/http-echo-server -b openapi-generator-test-server
cd http-echo-server
npm install
npm start
```
Echo server OpenAPI spec:
```
modules/openapi-generator/src/test/resources/3_0/echo_api.yaml
```
Example of a sample config:
```
generatorName: java
outputDir: samples/client/echo_api/java/native
library: native
inputSpec: modules/openapi-generator/src/test/resources/3_0/echo_api.yaml
templateDir: modules/openapi-generator/src/main/resources/Java
additionalProperties:
artifactId: echo-api-native
hideGenerationTimestamp: "true"
```
To facilitate testing, usually we create a helper to parse the response from the echo server, e.g. https://github.com/OpenAPITools/openapi-generator/blob/master/samples/client/echo_api/java/native/src/test/java/org/openapitools/client/EchoServerResponseParser.java
Clone repository
  • API client generator HOWTO
  • Building your own Templates
  • Customizing client code generation
  • FAQ
  • Git Branches
  • Home
  • How to add a generator for a new language or framework
  • Integration Tests
  • Migration Guide
  • Mustache Template Variables
  • Pull Request Checklist
  • Release Checklist
  • Samples folder
  • Server stub generator HOWTO
  • Vendor Extensions
View All Pages