/** * 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(); }
@Override protected DeploymentContext configureDeployment() { return DeploymentContext.builder(configure()).contextPath(CONTEXT_ROOT).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(); }