@Test public void retrievesHeaderFromRequest() throws Exception { when(typeProducer.createValue("foo", headers, null)).thenReturn(headers.getFirst("foo")); Object resolvedHeader = headerParameterResolver.resolve(parameter, applicationContext); assertEquals(headers.getFirst("foo"), resolvedHeader); }
@Override public Object resolve(Parameter parameter, ApplicationContext context) throws Exception { String param = this.headerParam.value(); TypeProducer typeProducer = typeProducerFactory.createTypeProducer(parameter.getParameterClass(), parameter.getGenericType()); return typeProducer.createValue(param, context.getHttpHeaders().getRequestHeaders(), parameter.getDefaultValue()); }
HeaderParameterResolver implements ParameterResolver<HeaderParam> { @Override public Object resolve(Parameter parameter, ApplicationContext context) throws Exception { String param = this.headerParam.value(); TypeProducer typeProducer = typeProducerFactory.createTypeProducer(parameter.getParameterClass(), parameter.getGenericType()); return typeProducer.createValue(param, context.getHttpHeaders().getRequestHeaders(), parameter.getDefaultValue()); } }
HeaderParameterResolver implements ParameterResolver<HeaderParam> { @Override public Object resolve(Parameter parameter, ApplicationContext context) throws Exception { String param = this.headerParam.value(); TypeProducer typeProducer = typeProducerFactory.createTypeProducer(parameter.getParameterClass(), parameter.getGenericType()); return typeProducer.createValue(param, context.getHttpHeaders().getRequestHeaders(), parameter.getDefaultValue()); } HeaderParameterResolver(HeaderParam headerParam, TypeProducerFactory typeProducerFactory); }
HeaderParameterResolver implements ParameterResolver<HeaderParam> { @Override public Object resolve(Parameter parameter, ApplicationContext context) throws Exception { String param = this.headerParam.value(); TypeProducer typeProducer = typeProducerFactory.createTypeProducer(parameter.getParameterClass(), parameter.getGenericType()); return typeProducer.createValue(param, context.getHttpHeaders().getRequestHeaders(), parameter.getDefaultValue()); } HeaderParameterResolver(HeaderParam headerParam, TypeProducerFactory typeProducerFactory); @Override Object resolve(Parameter parameter, ApplicationContext context); }
HeaderParameterResolver implements ParameterResolver<HeaderParam> { @Override public Object resolve(Parameter parameter, ApplicationContext context) throws Exception { String param = this.headerParam.value(); TypeProducer typeProducer = typeProducerFactory.createTypeProducer(parameter.getParameterClass(), parameter.getGenericType()); return typeProducer.createValue(param, context.getHttpHeaders().getRequestHeaders(), parameter.getDefaultValue()); } HeaderParameterResolver(HeaderParam headerParam, TypeProducerFactory typeProducerFactory); @Override Object resolve(Parameter parameter, ApplicationContext context);  }