@Test public void resolvesProviders() throws Exception { ProviderBinder providers = mock(ProviderBinder.class); when(applicationContext.getProviders()).thenReturn(providers); when(parameter.getParameterClass()).thenReturn((Class)Providers.class); assertSame(providers, contextParameterResolver.resolve(parameter, applicationContext)); verify(environmentContext, never()).get(any(Class.class)); }
@Override public Object resolve(org.everrest.core.Parameter parameter, ApplicationContext context) throws Exception { Class<?> parameterClass = parameter.getParameterClass(); if (parameterClass == HttpHeaders.class) { return context.getHttpHeaders(); } else if (parameterClass == SecurityContext.class) { return context.getSecurityContext(); } else if (parameterClass == Request.class) { return context.getRequest(); } else if (parameterClass == UriInfo.class) { return context.getUriInfo(); } else if (parameterClass == Providers.class) { return context.getProviders(); } else if (parameterClass == Application.class) { return context.getApplication(); } else if (parameterClass == InitialProperties.class) { return context.getInitialProperties(); } return EnvironmentContext.getCurrent().get(parameter.getParameterClass()); }
ContextParameterResolver implements ParameterResolver<Context> { @Override public Object resolve(org.everrest.core.Parameter parameter, ApplicationContext context) throws Exception { Class<?> parameterClass = parameter.getParameterClass(); if (parameterClass == HttpHeaders.class) { return context.getHttpHeaders(); } else if (parameterClass == SecurityContext.class) { return context.getSecurityContext(); } else if (parameterClass == Request.class) { return context.getRequest(); } else if (parameterClass == UriInfo.class) { return context.getUriInfo(); } else if (parameterClass == Providers.class) { return context.getProviders(); } else if (parameterClass == Application.class) { return context.getApplication(); } else if (parameterClass == InitialProperties.class) { return context.getInitialProperties(); } return EnvironmentContext.getCurrent().get(parameter.getParameterClass()); } }
ContextParameterResolver implements ParameterResolver<Context> { @Override public Object resolve(org.everrest.core.Parameter parameter, ApplicationContext context) throws Exception { Class<?> parameterClass = parameter.getParameterClass(); if (parameterClass == HttpHeaders.class) { return context.getHttpHeaders(); } else if (parameterClass == SecurityContext.class) { return context.getSecurityContext(); } else if (parameterClass == Request.class) { return context.getRequest(); } else if (parameterClass == UriInfo.class) { return context.getUriInfo(); } else if (parameterClass == Providers.class) { return context.getProviders(); } else if (parameterClass == Application.class) { return context.getApplication(); } else if (parameterClass == InitialProperties.class) { return context.getInitialProperties(); } return EnvironmentContext.getCurrent().get(parameter.getParameterClass()); }  }
ContextParameterResolver implements ParameterResolver<Context> { @Override public Object resolve(org.everrest.core.Parameter parameter, ApplicationContext context) throws Exception { Class<?> parameterClass = parameter.getParameterClass(); if (parameterClass == HttpHeaders.class) { return context.getHttpHeaders(); } else if (parameterClass == SecurityContext.class) { return context.getSecurityContext(); } else if (parameterClass == Request.class) { return context.getRequest(); } else if (parameterClass == UriInfo.class) { return context.getUriInfo(); } else if (parameterClass == Providers.class) { return context.getProviders(); } else if (parameterClass == Application.class) { return context.getApplication(); } else if (parameterClass == InitialProperties.class) { return context.getInitialProperties(); } return EnvironmentContext.getCurrent().get(parameter.getParameterClass()); }  @Override Object resolve(org.everrest.core.Parameter parameter, ApplicationContext context); }
ContextParameterResolver implements ParameterResolver<Context> { @Override public Object resolve(org.everrest.core.Parameter parameter, ApplicationContext context) throws Exception { Class<?> parameterClass = parameter.getParameterClass(); if (parameterClass == HttpHeaders.class) { return context.getHttpHeaders(); } else if (parameterClass == SecurityContext.class) { return context.getSecurityContext(); } else if (parameterClass == Request.class) { return context.getRequest(); } else if (parameterClass == UriInfo.class) { return context.getUriInfo(); } else if (parameterClass == Providers.class) { return context.getProviders(); } else if (parameterClass == Application.class) { return context.getApplication(); } else if (parameterClass == InitialProperties.class) { return context.getInitialProperties(); } return EnvironmentContext.getCurrent().get(parameter.getParameterClass()); }  @Override Object resolve(org.everrest.core.Parameter parameter, ApplicationContext context);  }