Package io.dropwizard.testing.junit
Class ResourceTestRule
- java.lang.Object
-
- io.dropwizard.testing.junit.ResourceTestRule
-
- All Implemented Interfaces:
org.junit.rules.TestRule
@Deprecated public class ResourceTestRule extends Object implements org.junit.rules.TestRule
Deprecated.Deprecated since Dropwizard 2.0.0. Please migrate to JUnit 5 andResourceExtension.A JUnitTestRulefor testing Jersey resources.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classResourceTestRule.BuilderDeprecated.AResourceTestRulebuilder which enables configuration of a Jersey testing environment.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description org.junit.runners.model.Statementapply(org.junit.runners.model.Statement base, org.junit.runner.Description description)Deprecated.static ResourceTestRule.Builderbuilder()Deprecated.Creates a new Jersey testing environment builder forResourceTestRulejavax.ws.rs.client.Clientclient()Deprecated.Returns the pre-configuredClientfor this test.Consumer<org.glassfish.jersey.client.ClientConfig>getClientConfigurator()Deprecated.org.glassfish.jersey.test.JerseyTestgetJerseyTest()Deprecated.Returns the underlyingJerseyTest.com.fasterxml.jackson.databind.ObjectMappergetObjectMapper()Deprecated.javax.validation.ValidatorgetValidator()Deprecated.javax.ws.rs.client.WebTargettarget(String path)Deprecated.Creates a web target to be sent to the resource under testing.
-
-
-
Method Detail
-
builder
public static ResourceTestRule.Builder builder()
Deprecated.Creates a new Jersey testing environment builder forResourceTestRule- Returns:
- a new
ResourceTestRule.Builder
-
getValidator
public javax.validation.Validator getValidator()
Deprecated.
-
getObjectMapper
public com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()
Deprecated.
-
getClientConfigurator
public Consumer<org.glassfish.jersey.client.ClientConfig> getClientConfigurator()
Deprecated.
-
target
public javax.ws.rs.client.WebTarget target(String path)
Deprecated.Creates a web target to be sent to the resource under testing.- Parameters:
path- relative path (from tested application base URI) this web target should point to.- Returns:
- the created JAX-RS web target.
-
client
public javax.ws.rs.client.Client client()
Deprecated.Returns the pre-configuredClientfor this test. For sending requests prefertarget(String)- Returns:
- the
JerseyTestconfiguredClient
-
getJerseyTest
public org.glassfish.jersey.test.JerseyTest getJerseyTest()
Deprecated.Returns the underlyingJerseyTest. For sending requests prefertarget(String).- Returns:
- the underlying
JerseyTest
-
apply
public org.junit.runners.model.Statement apply(org.junit.runners.model.Statement base, org.junit.runner.Description description)Deprecated.- Specified by:
applyin interfaceorg.junit.rules.TestRule
-
-