Java Code Examples for org.jboss.resteasy.spi.ResteasyUriInfo#pushCurrentResource()

The following examples show how to use org.jboss.resteasy.spi.ResteasyUriInfo#pushCurrentResource() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DisabledByEnvironmentTest.java    From aerogear-unifiedpush-server with Apache License 2.0 6 votes vote down vote up
@Test
public void doNotAbortIfNotInVariable() throws IOException, ServletException {
    System.setProperty("UPS_DISABLED", "");
    DisabledVariantEndpointFilter localFilter = new DisabledVariantEndpointFilter();
    ResteasyUriInfo uriInfo = new ResteasyUriInfo("http://example.org/rest/applications/fake-push-id/android", "",
            "");
    uriInfo.pushCurrentResource(new AndroidVariantEndpoint());
    ContainerRequestContext context = mock(ContainerRequestContext.class);
    when(context.getUriInfo()).thenReturn(uriInfo);
    doThrow(new RuntimeException("This should not be aborted.")).when(context).abortWith(Matchers.any());
    
    try {
        localFilter.filter(context);
    } catch (IOException e) {
        throw new RuntimeException(e);
    }

}
 
Example 2
Source File: DisabledByEnvironmentTest.java    From aerogear-unifiedpush-server with Apache License 2.0 5 votes vote down vote up
@Test
public void androidEnvDisablesAndroid() throws IOException {
    ResteasyUriInfo uriInfo = new ResteasyUriInfo("http://example.org/rest/applications/fake-push-id/android", "",
            "");
    uriInfo.pushCurrentResource(new AndroidVariantEndpoint());
    runTest(uriInfo);
}
 
Example 3
Source File: DisabledByEnvironmentTest.java    From aerogear-unifiedpush-server with Apache License 2.0 4 votes vote down vote up
@Test
public void iosEnvDisablesIOS() {
    ResteasyUriInfo uriInfo = new ResteasyUriInfo("http://example.org/rest/applications/fake-push-id/ios", "", "");
    uriInfo.pushCurrentResource(new iOSVariantEndpoint());
    runTest(uriInfo);
}