Class OpenApiWebServiceTest
java.lang.Object
org.glassfish.jersey.test.JerseyTest
ubic.gemma.rest.OpenApiWebServiceTest
public class OpenApiWebServiceTest
extends org.glassfish.jersey.test.JerseyTest
Pin the invariant that
/openapi.{json,yaml} serves the very OpenAPI instance held by the
openApi bean — the instance OpenApiFactory decorates with the servers list, the
FilterArg/SortArg examples and placeholder resolution.
Swagger's OpenApiResource used to own this endpoint and answered from its own re-read of the spec, so a
request racing the factory's asynchronous build could pin an undecorated copy for the life of the JVM (frink
served a spec with no servers for 17 hours that way, which broke "Try it out" in the Swagger UI: with no
servers the UI falls back to the page origin and drops the /rest/v2 base path). Marking the
decoration here with a server URL that only this test's bean carries is what makes the wiring, not just the
factory, the thing under test.
- Author:
- poirigui
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionjakarta.ws.rs.core.Applicationprotected org.glassfish.jersey.test.spi.TestContainerFactoryvoidsetUp()Bridge Jersey's JUnit 4 lifecycle into Jupiter's, as inWebApplicationExceptionMapperTest.voidtearDown()voidtestJson()voidtestYaml()Methods inherited from class org.glassfish.jersey.test.JerseyTest
client, close, closeIfNotNull, configureClient, configureDeployment, disable, enable, forceDisable, forceEnable, forceSet, getAsyncTimeoutMultiplier, getBaseUri, getClient, getLastLoggedRecord, getLoggedRecords, getPort, getSslContext, getSslParameters, isEnabled, set, set, setClient, target, target
-
Constructor Details
-
OpenApiWebServiceTest
public OpenApiWebServiceTest()
-
-
Method Details
-
setUp
Bridge Jersey's JUnit 4 lifecycle into Jupiter's, as inWebApplicationExceptionMapperTest.BaseJerseyTest5is not reused because itsconfigure()isfinaland would pull in every resource inubic.gemma.rest.- Overrides:
setUpin classorg.glassfish.jersey.test.JerseyTest- Throws:
Exception
-
tearDown
-
getTestContainerFactory
protected org.glassfish.jersey.test.spi.TestContainerFactory getTestContainerFactory() throws org.glassfish.jersey.test.spi.TestContainerException- Overrides:
getTestContainerFactoryin classorg.glassfish.jersey.test.JerseyTest- Throws:
org.glassfish.jersey.test.spi.TestContainerException
-
configure
public jakarta.ws.rs.core.Application configure()- Overrides:
configurein classorg.glassfish.jersey.test.JerseyTest
-
testJson
@Test public void testJson() -
testYaml
@Test public void testYaml()
-