Reuse Spring Context during JerseyTest

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Reuse Spring Context during JerseyTest

Brandon Fish
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
Loading...