Class BaseJerseyTest

java.lang.Object
org.glassfish.jersey.test.JerseyTest
ubic.gemma.rest.util.BaseJerseyTest
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware
Direct Known Subclasses:
AnnotationsWebServiceTest, BaseJerseyIntegrationTest, DatasetsWebServiceTest, SearchWebServiceTest

@ActiveProfiles({"web","test"}) @WebAppConfiguration @TestExecutionListeners({org.springframework.test.context.web.ServletTestExecutionListener.class,org.springframework.test.context.support.DependencyInjectionTestExecutionListener.class,org.springframework.test.context.support.DirtiesContextTestExecutionListener.class}) public abstract class BaseJerseyTest extends org.glassfish.jersey.test.JerseyTest implements org.springframework.context.ApplicationContextAware
Base class for Jersey-based tests that needs a WebApplicationContext for loading and configuring or mocking Spring components.

Unfortunately, it is not possible to inherit from AbstractJUnit4SpringContextTests, so we have to borrow some its annotations here.

Author:
poirigui
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected final javax.ws.rs.core.Application
     
    protected final void
    configureClient(org.glassfish.jersey.client.ClientConfig config)
     
    protected final org.glassfish.jersey.test.spi.TestContainerFactory
     
    final void
    setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
     
    final void
    This is intentionally made final to prevent subclasses from overriding.
    final void
    This is intentionally made final to prevent subclasses from overriding.

    Methods inherited from class org.glassfish.jersey.test.JerseyTest

    client, close, closeIfNotNull, configureDeployment, disable, enable, forceDisable, forceEnable, forceSet, getAsyncTimeoutMultiplier, getBaseUri, getClient, getLastLoggedRecord, getLoggedRecords, getPort, isEnabled, set, set, setClient, target, target

    Methods inherited from class java.lang.Object

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

    • BaseJerseyTest

      public BaseJerseyTest()
  • Method Details

    • getTestContainerFactory

      protected final 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

      protected final javax.ws.rs.core.Application configure()
      Overrides:
      configure in class org.glassfish.jersey.test.JerseyTest
    • setApplicationContext

      public final void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
      Specified by:
      setApplicationContext in interface org.springframework.context.ApplicationContextAware
    • configureClient

      protected final void configureClient(org.glassfish.jersey.client.ClientConfig config)
      Overrides:
      configureClient in class org.glassfish.jersey.test.JerseyTest
    • setUp

      public final void setUp() throws Exception
      This is intentionally made final to prevent subclasses from overriding.
      Overrides:
      setUp in class org.glassfish.jersey.test.JerseyTest
      Throws:
      Exception
    • tearDown

      public final void tearDown() throws Exception
      This is intentionally made final to prevent subclasses from overriding.
      Overrides:
      tearDown in class org.glassfish.jersey.test.JerseyTest
      Throws:
      Exception