Skip to content

Commit f1a273d

Browse files
authored
Test Java clients with Petstore server in Github workflow (#22003)
* test java clients with petstore in github workflow * update * clean up
1 parent 3a63c2f commit f1a273d

File tree

4 files changed

+81
-13
lines changed

4 files changed

+81
-13
lines changed

.github/workflows/samples-java-client-jdk11.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ on:
1717
- samples/client/petstore/java/webclient-useSingleRequestParameter/**
1818
- samples/client/others/java/jersey2-oneOf-duplicates/**
1919
- samples/client/others/java/jersey2-oneOf-Mixed/**
20+
- samples/client/petstore/java/jersey3-oneOf/**
21+
- samples/client/others/java/okhttp-gson-streaming/**
22+
- samples/client/others/java/resteasy/**
23+
- samples/client/others/java/apache-httpclient/**
2024
- samples/client/others/java/resttemplate-list-schema-validation/**
2125
- samples/client/petstore/java/okhttp-gson-3.1-duplicated-operationid/**
2226
pull_request:
@@ -35,6 +39,10 @@ on:
3539
- samples/client/petstore/java/webclient-useSingleRequestParameter/**
3640
- samples/client/others/java/jersey2-oneOf-duplicates/**
3741
- samples/client/others/java/jersey2-oneOf-Mixed/**
42+
- samples/client/petstore/java/jersey3-oneOf/**
43+
- samples/client/others/java/okhttp-gson-streaming/**
44+
- samples/client/others/java/resteasy/**
45+
- samples/client/others/java/apache-httpclient/**
3846
- samples/client/others/java/resttemplate-list-schema-validation/**
3947
- samples/client/petstore/java/okhttp-gson-3.1-duplicated-operationid/**
4048
jobs:
@@ -97,6 +105,10 @@ jobs:
97105
- samples/client/others/java/jersey2-oneOf-Mixed/
98106
- samples/client/others/java/resttemplate-list-schema-validation/
99107
- samples/client/petstore/java/okhttp-gson-3.1-duplicated-operationid/
108+
- samples/client/petstore/java/jersey3-oneOf/
109+
- samples/client/others/java/okhttp-gson-streaming/
110+
- samples/client/petstore/java/resteasy/
111+
- samples/client/petstore/java/apache-httpclient/
100112
steps:
101113
- uses: actions/checkout@v5
102114
- uses: actions/setup-java@v5
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# run java client tests with petstore server
2+
name: Samples Java Petsore Client JDK11
3+
4+
on:
5+
push:
6+
paths:
7+
- samples/client/petstore/java/jersey2-java8/**
8+
- samples/openapi3/client/petstore/java/jersey2-java8/**
9+
- samples/client/petstore/java/jersey3/**
10+
- samples/client/petstore/java/okhttp-gson/**
11+
- samples/client/petstore/java/okhttp-gson-3.1/**
12+
- samples/client/petstore/java/okhttp-gson-dynamicOperations/**
13+
- samples/client/petstore/java-micronaut-client/**
14+
pull_request:
15+
paths:
16+
- samples/client/petstore/java/jersey2-java8/**
17+
- samples/openapi3/client/petstore/java/jersey2-java8/**
18+
- samples/client/petstore/java/jersey3/**
19+
- samples/client/petstore/java/okhttp-gson/**
20+
- samples/client/petstore/java/okhttp-gson-3.1/**
21+
- samples/client/petstore/java/okhttp-gson-dynamicOperations/**
22+
- samples/client/petstore/java-micronaut-client/**
23+
jobs:
24+
build:
25+
name: Build Java Client JDK11
26+
runs-on: ubuntu-latest
27+
strategy:
28+
fail-fast: false
29+
matrix:
30+
sample:
31+
- samples/client/petstore/java/jersey2-java8
32+
- samples/openapi3/client/petstore/java/jersey2-java8
33+
- samples/client/petstore/java/jersey3
34+
- samples/client/petstore/java/okhttp-gson
35+
- samples/client/petstore/java/okhttp-gson-3.1
36+
- samples/client/petstore/java/okhttp-gson-dynamicOperations
37+
- samples/client/petstore/java-micronaut-client
38+
services:
39+
petstore-api:
40+
image: swaggerapi/petstore
41+
ports:
42+
- 80:8080
43+
env:
44+
SWAGGER_HOST: http://petstore.swagger.io
45+
SWAGGER_BASE_PATH: /v2
46+
steps:
47+
- uses: actions/checkout@v5
48+
- name: Add hosts to /etc/hosts
49+
run: |
50+
sudo echo "127.0.0.1 petstore.swagger.io" | sudo tee -a /etc/hosts
51+
- uses: actions/setup-java@v5
52+
with:
53+
distribution: 'temurin'
54+
java-version: 11
55+
- name: Cache maven dependencies
56+
uses: actions/cache@v4
57+
env:
58+
cache-name: maven-repository
59+
with:
60+
path: |
61+
~/.m2
62+
key: ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }}
63+
- name: Build with Maven
64+
working-directory: ${{ matrix.sample }}
65+
run: mvn clean package --no-transfer-progress

CI/circle_parallel.sh

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -121,17 +121,5 @@ else
121121
(cd samples/client/petstore/scala-sttp-circe && mvn integration-test)
122122
(cd samples/client/petstore/scala-sttp4 && mvn integration-test)
123123
(cd samples/client/petstore/clojure && mvn integration-test)
124-
(cd samples/client/petstore/java/jersey2-java8 && mvn integration-test)
125-
(cd samples/openapi3/client/petstore/java/jersey2-java8 && mvn integration-test)
126-
(cd samples/client/petstore/java/jersey3 && mvn integration-test)
127-
(cd samples/client/petstore/java/jersey3-oneOf && mvn integration-test)
128-
(cd samples/client/others/java/okhttp-gson-streaming && mvn integration-test)
129-
(cd samples/client/petstore/java/okhttp-gson && mvn integration-test)
130-
(cd samples/client/petstore/java/okhttp-gson-3.1 && mvn integration-test)
131-
(cd samples/client/petstore/java/okhttp-gson-dynamicOperations && mvn integration-test)
132-
(cd samples/client/petstore/java/resteasy && mvn integration-test)
133-
(cd samples/client/petstore/java-micronaut-client && mvn integration-test)
134-
(cd samples/client/petstore/java/apache-httpclient && mvn integration-test)
135-
(cd samples/client/petstore/java/resttemplate-jakarta && mvn integration-test)
136124

137125
fi
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
# OpenAPI Generator Ignore
22
# These are "live" test files which should not be overwritten
33
src/test/java/org/openapitools/client/JSONTest.java
4-
src/test/java/org/openapitools/client/JSONComposedSchemaTest.java
4+
src/test/java/org/openapitools/client/JSONComposedSchemaTest.java
5+
6+
7+

0 commit comments

Comments
 (0)