When trying out version 0.4.0, I cannot get my previously running JerseyTests to work. They were running fine with 0.3.0. Sample code:
public class ResourceTest extends JerseyTest {
@Override
protected Application configure() {
return new ResourceConfig()
.register(GatewayFeature.class)
.packages(RequestHandler.class.getPackage().getName());
}
@Test
public void healthcheck() throws Exception {
Response response = target("/health").request().get();
assertThat(response.getStatusInfo()).isEqualTo(Response.Status.OK);
}
2016-12-17 11:56:40 ERROR ExceptionMapper:15 - Failure when processing request.
MultiException stack 1 of 1
java.lang.IllegalStateException: Proxiable context org.glassfish.jersey.process.internal.RequestScope@3e4f2b4d findOrCreate returned a null for descriptor SystemDescriptor(
implementation=com.jrestless.aws.gateway.GatewayFeature$ReferencingGatewayRequestFactory
contracts={com.jrestless.aws.gateway.io.GatewayRequest}
scope=org.glassfish.jersey.process.internal.RequestScoped
qualifiers={}
descriptorType=PROVIDE_METHOD
descriptorVisibility=NORMAL
metadata=
rank=0
loader=org.glassfish.hk2.utilities.binding.AbstractBinder$2@3a21dd9e
proxiable=true
proxyForSameScope=false
analysisName=null
id=125
locatorId=1
identityHashCode=310202442
reified=true) and handle ServiceHandle(SystemDescriptor(
implementation=com.jrestless.aws.gateway.security.CognitoUserPoolAuthorizerFilter
contracts={javax.ws.rs.container.ContainerRequestFilter}
scope=javax.inject.Singleton
qualifiers={org.glassfish.jersey.internal.inject.Custom}
descriptorType=CLASS
descriptorVisibility=NORMAL
metadata=
rank=2000
loader=null
proxiable=null
proxyForSameScope=null
analysisName=null
id=141
locatorId=1
identityHashCode=1492979664
reified=true),531579585)
at org.jvnet.hk2.internal.MethodInterceptorImpl.internalInvoke(MethodInterceptorImpl.java:92)
at org.jvnet.hk2.internal.MethodInterceptorImpl.invoke(MethodInterceptorImpl.java:125)
at org.jvnet.hk2.internal.MethodInterceptorInvocationHandler.invoke(MethodInterceptorInvocationHandler.java:62)
at com.sun.proxy.$Proxy32.getRequestContext(Unknown Source)
at com.jrestless.aws.gateway.security.AuthorizerFilter.getAuthorizerData(AuthorizerFilter.java:50)
at com.jrestless.aws.gateway.security.AuthorizerFilter.filter(AuthorizerFilter.java:40)
at org.glassfish.jersey.server.ContainerFilteringStage.apply(ContainerFilteringStage.java:132)
at org.glassfish.jersey.server.ContainerFilteringStage.apply(ContainerFilteringStage.java:68)
at org.glassfish.jersey.process.internal.Stages.process(Stages.java:197)
at org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:318)
at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)
at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)
at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
at org.glassfish.jersey.internal.Errors.process(Errors.java:267)
at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317)
at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:305)
at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1154)
at org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpContainer.service(GrizzlyHttpContainer.java:384)
at org.glassfish.grizzly.http.server.HttpHandler$1.run(HttpHandler.java:224)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:593)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:573)
at java.lang.Thread.run(Thread.java:745)
Dec 17, 2016 11:56:40 AM org.glassfish.grizzly.http.server.NetworkListener shutdownNow
INFO: Stopped listener bound to [localhost:9998]
org.junit.ComparisonFailure:
Expected :OK
Actual :Internal Server Error