我有一个简单的资源,如:
@Path("/")
public class RootResource {
@Context WebConfig wc;
@PostConstruct
public void init() {
assertNotNull(wc);
}
@GET
public void String method() {
return "Hello\n";
}
}
Run Code Online (Sandbox Code Playgroud)
我试图使用JerseyTest(2.x,而不是1.x)和GrizzlyTestContainerFactory.
我无法解决在配置方面我需要做什么以获取注入的WebConfig对象.