Skip to content

Commit 0220ec7

Browse files
authored
Restore SmallRyeOpenAPI.Builder binary compatibility (buildFinalize) (#2345)
* Restore SmallRyeOpenAPI.Builder binary compatibility (buildFinalize) Signed-off-by: Michael Edgar <[email protected]> * Add Quarkus endpoint smoke test Signed-off-by: Michael Edgar <[email protected]> --------- Signed-off-by: Michael Edgar <[email protected]>
1 parent 862a4dd commit 0220ec7

File tree

4 files changed

+68
-0
lines changed

4 files changed

+68
-0
lines changed

.github/workflows/build.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,15 @@ jobs:
8787
!**/target/surefire-reports/**/*
8888
!**/target/maven-it/**/*
8989
90+
- name: Archive Failed Tests Results
91+
uses: actions/upload-artifact@v4
92+
if: failure()
93+
with:
94+
name: artifacts-${{ matrix.os }}-java${{matrix.java}}
95+
path: |
96+
**/target/failsafe-reports/
97+
**/target/surefire-reports/
98+
9099
tck-reporting:
91100
runs-on: ubuntu-latest
92101
strategy:

core/src/main/java/io/smallrye/openapi/api/SmallRyeOpenAPI.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -654,6 +654,10 @@ protected <V> SmallRyeOpenAPI buildFinalize(BuildContext<V, ?, ?, ?, ?> ctx, boo
654654
return new SmallRyeOpenAPI(model, ctx.modelIO.write(model).orElse(null), toString, unmodifiable);
655655
}
656656

657+
protected <V> SmallRyeOpenAPI buildFinalize(BuildContext<V, ?, ?, ?, ?> ctx) {
658+
return buildFinalize(ctx, false);
659+
}
660+
657661
protected static class BuildContext<V, A extends V, O extends V, AB, OB> {
658662
ClassLoader appClassLoader;
659663
OpenApiConfig buildConfig;

testsuite/data/pom.xml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,10 @@
114114
<artifactId>quarkus-junit5</artifactId>
115115
<scope>test</scope>
116116
</dependency>
117+
<dependency>
118+
<groupId>io.rest-assured</groupId>
119+
<artifactId>rest-assured</artifactId>
120+
</dependency>
117121
<dependency>
118122
<groupId>org.skyscreamer</groupId>
119123
<artifactId>jsonassert</artifactId>
@@ -308,6 +312,7 @@
308312
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
309313
<java.util.logging.config.file>${project.build.testOutputDirectory}/logging.properties</java.util.logging.config.file>
310314
<maven.home>${maven.home}</maven.home>
315+
<quarkus.test.arg-line>${jacocoArgLine}</quarkus.test.arg-line>
311316
</systemPropertyVariables>
312317
</configuration>
313318
</plugin>
@@ -354,6 +359,29 @@
354359
<plugin>
355360
<groupId>org.jacoco</groupId>
356361
<artifactId>jacoco-maven-plugin</artifactId>
362+
<executions>
363+
<execution>
364+
<id>default-prepare-agent</id>
365+
<goals>
366+
<goal>prepare-agent</goal>
367+
</goals>
368+
<configuration>
369+
<exclClassLoaders>*QuarkusClassLoader</exclClassLoaders>
370+
<destFile>${project.build.directory}/jacoco.exec</destFile>
371+
<append>true</append>
372+
</configuration>
373+
</execution>
374+
<execution>
375+
<id>default-prepare-agent-integration</id>
376+
<goals>
377+
<goal>prepare-agent-integration</goal>
378+
</goals>
379+
<configuration>
380+
<destFile>${project.build.directory}/jacoco.exec</destFile>
381+
<append>true</append>
382+
</configuration>
383+
</execution>
384+
</executions>
357385
</plugin>
358386
</plugins>
359387
</build>
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
package io.smallrye.openapi.testdata;
2+
3+
import static io.restassured.RestAssured.given;
4+
import static org.hamcrest.Matchers.aMapWithSize;
5+
import static org.hamcrest.Matchers.greaterThan;
6+
7+
import org.junit.jupiter.api.Test;
8+
import org.junit.jupiter.api.condition.DisabledOnOs;
9+
import org.junit.jupiter.api.condition.OS;
10+
11+
import io.quarkus.test.junit.QuarkusIntegrationTest;
12+
13+
@QuarkusIntegrationTest
14+
@DisabledOnOs(value = OS.WINDOWS, disabledReason = """
15+
dev services uses testcontainers, not supported on Windows
16+
WARN [org.tes.doc.DockerClientProviderStrategy] (build-26) windows is currently not supported
17+
""")
18+
class QuarkusOpenAPIEndpointIT {
19+
20+
@Test
21+
void testOpenAPIEndpointResponds() {
22+
given()
23+
.when().get("/q/openapi.json")
24+
.then()
25+
.body("paths", aMapWithSize(greaterThan(0)));
26+
}
27+
}

0 commit comments

Comments
 (0)