Package io.dropwizard.testing.common
Class Resource
java.lang.Object
io.dropwizard.testing.common.Resource
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classResource.Builder<B extends Resource.Builder<B>>AResourcebuilder which enables configuration of a Jersey testing environment. -
Method Summary
Modifier and TypeMethodDescriptionvoidafter()voidbefore()static ResourceExtension.Builderbuilder()Creates a new Jersey testing environment builder forResourceExtensionjakarta.ws.rs.client.Clientclient()Returns the pre-configuredClientfor this test.Consumer<org.glassfish.jersey.client.ClientConfig>org.glassfish.jersey.test.JerseyTestReturns the underlyingJerseyTest.com.fasterxml.jackson.databind.ObjectMapperjakarta.validation.Validatorjakarta.ws.rs.client.WebTargetCreates a web target to be sent to the resource under testing.
-
Method Details
-
builder
Creates a new Jersey testing environment builder forResourceExtension- Returns:
- a new
ResourceExtension.Builder
-
getValidator
public jakarta.validation.Validator getValidator() -
getObjectMapper
public com.fasterxml.jackson.databind.ObjectMapper getObjectMapper() -
getClientConfigurator
-
target
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 jakarta.ws.rs.client.Client client()Returns the pre-configuredClientfor this test. For sending requests prefertarget(String)- Returns:
- the
JerseyTestconfiguredClient
-
getJerseyTest
public org.glassfish.jersey.test.JerseyTest getJerseyTest()Returns the underlyingJerseyTest. For sending requests prefertarget(String).- Returns:
- the underlying
JerseyTest
-
before
- Throws:
Throwable
-
after
- Throws:
Throwable
-