Skip to content

Instantly share code, notes, and snippets.

@hstaudacher
Created November 12, 2011 11:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hstaudacher/1360418 to your computer and use it in GitHub Desktop.
Save hstaudacher/1360418 to your computer and use it in GitHub Desktop.
A simple Polling Test using restfuse
@RunWith( HttpJUnitRunner.class )
public class RestfusePollTest {
@Rule
public Destination destination = new Destination( "http://restfuse.com" );
@Context
private Response response;
@Context
private PollState pollState
@HttpTest( method = Method.GET, path = "/asynchron" )
@Poll( times = 5, interval = 500 )
public void testAsynchronousService() {
Response currentResponse = pollState.getRespone( pollState.getTimes() );
assertEquals( currentResponse, response );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment