use of org.glassfish.jersey.server.ResourceConfig in project jersey by jersey.
the class UriModificationFilterTest method testWithInstance.
@Test
public void testWithInstance() throws ExecutionException, InterruptedException {
final ResourceConfig resourceConfig = new ResourceConfig(Resource.class).register(UriModifyFilter.class);
final ApplicationHandler application = new ApplicationHandler(resourceConfig);
final ContainerResponse response = application.apply(RequestContextBuilder.from("/a/b/c", "GET").build()).get();
assertEquals(200, response.getStatus());
assertEquals("/a/b?filter=c", response.getEntity());
}
use of org.glassfish.jersey.server.ResourceConfig in project jersey by jersey.
the class CsrfProtectionFilterTest method setUp.
@Before
public void setUp() {
ResourceConfig rc = new ResourceConfig(Resource.class, CsrfProtectionFilter.class);
handler = new ApplicationHandler(rc);
}
use of org.glassfish.jersey.server.ResourceConfig in project jersey by jersey.
the class EncodingFilterTest method initializeAndGetFilter.
@SuppressWarnings("unchecked")
private EncodingFilter initializeAndGetFilter() {
ResourceConfig rc = new ResourceConfig();
EncodingFilter.enableFor(rc, FooEncoding.class, GZipEncoder.class);
return (EncodingFilter) new ApplicationHandler(rc).getInjectionManager().getInstance(ContainerResponseFilter.class);
}
use of org.glassfish.jersey.server.ResourceConfig in project jersey by jersey.
the class EntityTypeFilterTest method test.
@Test
public void test() throws ExecutionException, InterruptedException {
ApplicationHandler handler = new ApplicationHandler(new ResourceConfig(Resource.class, ResponseFilter.class));
final ContainerResponse response = handler.apply(RequestContextBuilder.from("/resource/getentitytype", "GET").build()).get();
assertEquals(200, response.getStatus());
}
use of org.glassfish.jersey.server.ResourceConfig in project jersey by jersey.
the class FilterSetMethodTest method testResource.
@Test
public void testResource() throws ExecutionException, InterruptedException {
ApplicationHandler handler = new ApplicationHandler(new ResourceConfig(Resource.class, PostMatchFilter.class));
ContainerResponse res = handler.apply(RequestContextBuilder.from("", "/resource/setMethodInResource", "GET").build()).get();
assertEquals(200, res.getStatus());
}
Aggregations