public class InProcessResteasy
extends org.junit.rules.ExternalResource
Usage:
@Rule public InProcessResteasy resteasy = new InProcessResteasy();
@Before public void setup() {
resteasy.getDeployment().getRegistry().addPerRequestResource(DummyResource.class);
}
@Test public void testMethod() {
// Setup authenticated user as "username"
resteasy.getDeployment().getProviderFactory().register(
new TestSecurityFilter("username", SecurityContext.FORM_AUTH));
Response response = resteasy.getClient()
.target(resteasy.getBaseUriBuilder().path(DummyResource.class))
.request().get();
// ...
}
| Constructor and Description |
|---|
InProcessResteasy() |
InProcessResteasy(URI baseUri) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
after() |
protected void |
before() |
protected void |
configureClient(org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder builder) |
protected void |
configureDeployment(org.jboss.resteasy.spi.ResteasyDeployment deployment) |
URI |
getBaseUri() |
javax.ws.rs.core.UriBuilder |
getBaseUriBuilder() |
javax.ws.rs.client.Client |
getClient() |
org.jboss.resteasy.spi.ResteasyDeployment |
getDeployment() |
public InProcessResteasy()
public InProcessResteasy(URI baseUri)
public final URI getBaseUri()
public final javax.ws.rs.core.UriBuilder getBaseUriBuilder()
public final org.jboss.resteasy.spi.ResteasyDeployment getDeployment()
public final javax.ws.rs.client.Client getClient()
protected final void before()
throws Throwable
before in class org.junit.rules.ExternalResourceThrowableprotected final void after()
after in class org.junit.rules.ExternalResourceprotected void configureDeployment(org.jboss.resteasy.spi.ResteasyDeployment deployment)
protected void configureClient(org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder builder)
Copyright © 2015–2016. All rights reserved.