com.eclipsesource.restfuse.annotation
Annotation Type Context


@Retention(value=RUNTIME)
@Target(value=FIELD)
public @interface Context

The Context annotation can be used within a TestCase to get the Response or a PollState of an HTTP request injected after it succeeds.

A simple example looks like this:

 @RunWith( HttpJUnitRunner.class )
 public class Example {
 
   @Rule
   public Destination destination = new Destination( "http://localhost" );
    
   @Context
   private Response response;
 
   @HttpTest( method = Method.GET, path = "/test" ) 
   public void testMethod() {
     com.eclipsesource.restfuse.Assert.assertAccepted( response );
   }
 }
 

See Also:
HttpTest, Destination