@Test public void resolvesDecodedFormParamAsString() throws Exception { when(parameter.isEncoded()).thenReturn(false); when(typeProducer.createValue("foo", decodedForm, null)).thenReturn(decodedForm.getFirst("foo")); Object resolved = formParameterResolver.resolve(parameter, applicationContext); assertEquals(decodedForm.getFirst("foo"), resolved); assertThatMessageBodyWriterWasCalled(); }
@Override public Object resolve(org.everrest.core.Parameter parameter, ApplicationContext context) throws Exception { String param = this.formParam.value(); TypeProducer typeProducer = typeProducerFactory.createTypeProducer(parameter.getParameterClass(), parameter.getGenericType()); MultivaluedMap<String, String> form = readForm(context, !parameter.isEncoded()); return typeProducer.createValue(param, form, parameter.getDefaultValue()); }
FormParameterResolver implements ParameterResolver<FormParam> { @Override public Object resolve(org.everrest.core.Parameter parameter, ApplicationContext context) throws Exception { String param = this.formParam.value(); TypeProducer typeProducer = typeProducerFactory.createTypeProducer(parameter.getParameterClass(), parameter.getGenericType()); MultivaluedMap<String, String> form = readForm(context, !parameter.isEncoded()); return typeProducer.createValue(param, form, parameter.getDefaultValue()); } }
FormParameterResolver implements ParameterResolver<FormParam> { @Override public Object resolve(org.everrest.core.Parameter parameter, ApplicationContext context) throws Exception { String param = this.formParam.value(); TypeProducer typeProducer = typeProducerFactory.createTypeProducer(parameter.getParameterClass(), parameter.getGenericType()); MultivaluedMap<String, String> form = readForm(context, !parameter.isEncoded()); return typeProducer.createValue(param, form, parameter.getDefaultValue()); } FormParameterResolver(FormParam formParam, TypeProducerFactory typeProducerFactory); }
FormParameterResolver implements ParameterResolver<FormParam> { @Override public Object resolve(org.everrest.core.Parameter parameter, ApplicationContext context) throws Exception { String param = this.formParam.value(); TypeProducer typeProducer = typeProducerFactory.createTypeProducer(parameter.getParameterClass(), parameter.getGenericType()); MultivaluedMap<String, String> form = readForm(context, !parameter.isEncoded()); return typeProducer.createValue(param, form, parameter.getDefaultValue()); } FormParameterResolver(FormParam formParam, TypeProducerFactory typeProducerFactory); @Override Object resolve(org.everrest.core.Parameter parameter, ApplicationContext context); }
FormParameterResolver implements ParameterResolver<FormParam> { @Override public Object resolve(org.everrest.core.Parameter parameter, ApplicationContext context) throws Exception { String param = this.formParam.value(); TypeProducer typeProducer = typeProducerFactory.createTypeProducer(parameter.getParameterClass(), parameter.getGenericType()); MultivaluedMap<String, String> form = readForm(context, !parameter.isEncoded()); return typeProducer.createValue(param, form, parameter.getDefaultValue()); } FormParameterResolver(FormParam formParam, TypeProducerFactory typeProducerFactory); @Override Object resolve(org.everrest.core.Parameter parameter, ApplicationContext context);  }