users@jersey.java.net

[Jersey] Reuse Spring Context during JerseyTest

From: Brandon Fish <brandon.j.fish_at_gmail.com>
Date: Fri, 11 Mar 2016 11:03:19 -0600

Hello,

Is there a way to reuse the Spring application context during a JerseyTest?

Currently my test looks like this and it is reloading the Spring context
for every test:


public class ResourceResponseTest extends JerseyTest
{

   public StopsErrorResponseTest()
   {
      super(new InMemoryTestContainerFactory());
   }

   @Override
   protected Application configure()
   {
      ApplicationContext context = new
AnnotationConfigApplicationContext(TestConfig.class);

      return new JaxRSApplicationConfig().property("contextConfig", context);
   }

   @Test
   public void testInvalidParams()
   {

   }

   @Test
   public void testValidParams()
   {

   }

}





Thank you,
Brandon