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
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    jakarta.ws.rs.core.Application
     
    protected org.glassfish.jersey.test.spi.TestContainerFactory
     
    void
    Bridge Jersey's JUnit 4 lifecycle into Jupiter's, as in WebApplicationExceptionMapperTest.
    void
     
    void
     
    void
     

    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

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • OpenApiWebServiceTest

      public OpenApiWebServiceTest()
  • Method Details

    • setUp

      @BeforeEach public void setUp() throws Exception
      Bridge Jersey's JUnit 4 lifecycle into Jupiter's, as in WebApplicationExceptionMapperTest. BaseJerseyTest5 is not reused because its configure() is final and would pull in every resource in ubic.gemma.rest.
      Overrides:
      setUp in class org.glassfish.jersey.test.JerseyTest
      Throws:
      Exception
    • tearDown

      @AfterEach public void tearDown() throws Exception
      Overrides:
      tearDown in class org.glassfish.jersey.test.JerseyTest
      Throws:
      Exception
    • getTestContainerFactory

      protected org.glassfish.jersey.test.spi.TestContainerFactory getTestContainerFactory() throws org.glassfish.jersey.test.spi.TestContainerException
      Overrides:
      getTestContainerFactory in class org.glassfish.jersey.test.JerseyTest
      Throws:
      org.glassfish.jersey.test.spi.TestContainerException
    • configure

      public jakarta.ws.rs.core.Application configure()
      Overrides:
      configure in class org.glassfish.jersey.test.JerseyTest
    • testJson

      @Test public void testJson()
    • testYaml

      @Test public void testYaml()