Package io.github.cdiunit
Annotation Type InRequestScope
@InterceptorBinding
@Inherited
@Target({METHOD,TYPE})
@Retention(RUNTIME)
public @interface InRequestScope
Starts a request around the annotated method.
@Test @InRequestScope // This test will be run within the context of a request void testStart() { starship.start(); }
Remember to add an implementation of HttpServletRequest to your test e.g.
@Produces HttpServletRequest getRequest() { return new DummyHttpRequest(); }
- Author:
- Bryn Cooke