Skip to content

Instantly share code, notes, and snippets.

@hstaudacher
Created November 12, 2011 11:41
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/1360419 to your computer and use it in GitHub Desktop.
Save hstaudacher/1360419 to your computer and use it in GitHub Desktop.
A simple Callback Test using restfuse
@RunWith( HttpJUnitRunner.class )
public class RestfuseCalbackTest {
@Rule
public Destination destination = new Destination( "http://restfuse.com" );
@Context
private Response response;
private class TestCallbackResource extends DefaultCallbackResource {
@Override
public Response post( Request request ) {
assertNotNull( request.getBody() );
return super.post( request );
}
}
@HttpTest( method = Method.GET, path = "/test" )
@Callback( port = 9090, path = "/asynchron", resource = TestCallbackResource.class, timeout = 10000 )
public void testMethod() {
assertAccepted( response );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment