/** * Create and configure deployment context for the tested application. * <p> * This method may be overridden by subclasses to provide custom test container deployment context for the tested * application. The method may be also used to configure {@code JerseyTest} instance properties. * <p> * The method is invoked from {@code JerseyTest} constructors to provide deployment context for the tested application. * Default implementation of this method creates * {@link DeploymentContext#newInstance(javax.ws.rs.core.Application) new deployment context} * using JAX-RS application instance obtained by calling the {@link #configure()} method. * </p> * <p> * Note that since the method is invoked from {@code JerseyTest} constructor, the overriding implementation of the method * must not depend on any subclass fields as those will not be initialized yet when the method is invoked. * </p> * <p> * Also note that in case the {@link #JerseyTest(javax.ws.rs.core.Application)} constructor is used, the method is never * invoked. * </p> * * @return configured deployment context for the tested application. * @since 2.8 */ protected DeploymentContext configureDeployment() { return DeploymentContext.builder(configure()).build(); }
/** * Create a new deployment context for a JAX-RS / Jersey application instance. * <p> * The created deployment context will be configured to use default values. * </p> * * @param applicationClass a JAX-RS / Jersey application to be tested. * @return new deployment context instance associated with the JAX-RS / Jersey application to be tested. * * @throws java.lang.NullPointerException in case the {@code applicationClass} is {@code null}. */ public static DeploymentContext newInstance(final Class<? extends Application> applicationClass) { return new Builder(applicationClass).build(); }
/** * Create a new deployment context for a JAX-RS / Jersey application instance. * <p> * The created deployment context will be configured to use default values. * </p> * * @param application a JAX-RS / Jersey application to be tested. * @return new deployment context instance associated with the JAX-RS / Jersey application to be tested. * * @throws java.lang.NullPointerException in case the {@code application} is {@code null}. */ public static DeploymentContext newInstance(final Application application) { return new Builder(application).build(); }
/** * Create and configure deployment context for the tested application. * <p> * This method may be overridden by subclasses to provide custom test container deployment context for the tested * application. The method may be also used to configure {@code JerseyTest} instance properties. * <p> * The method is invoked from {@code JerseyTest} constructors to provide deployment context for the tested application. * Default implementation of this method creates * {@link DeploymentContext#newInstance(javax.ws.rs.core.Application) new deployment context} * using JAX-RS application instance obtained by calling the {@link #configure()} method. * </p> * <p> * Note that since the method is invoked from {@code JerseyTest} constructor, the overriding implementation of the method * must not depend on any subclass fields as those will not be initialized yet when the method is invoked. * </p> * <p> * Also note that in case the {@link #JerseyTest(javax.ws.rs.core.Application)} constructor is used, the method is never * invoked. * </p> * * @return configured deployment context for the tested application. * @since 2.8 */ protected DeploymentContext configureDeployment() { return DeploymentContext.builder(configure()).build(); }
/** * Create a new deployment context for a JAX-RS / Jersey application instance. * <p> * The created deployment context will be configured to use default values. * </p> * * @param application a JAX-RS / Jersey application to be tested. * @return new deployment context instance associated with the JAX-RS / Jersey application to be tested. * * @throws java.lang.NullPointerException in case the {@code application} is {@code null}. */ public static DeploymentContext newInstance(final Application application) { return new Builder(application).build(); }
/** * Create a new deployment context for a JAX-RS / Jersey application instance. * <p> * The created deployment context will be configured to use default values. * </p> * * @param applicationClass a JAX-RS / Jersey application to be tested. * @return new deployment context instance associated with the JAX-RS / Jersey application to be tested. * * @throws java.lang.NullPointerException in case the {@code applicationClass} is {@code null}. */ public static DeploymentContext newInstance(final Class<? extends Application> applicationClass) { return new Builder(applicationClass).build(); }
@Override protected DeploymentContext configureDeployment() { return DeploymentContext.builder(configure()).contextPath(CONTEXT_ROOT).build(); }