@Test public void throwsIllegalStateExceptionWhenFormMessageBodyReaderIsNotAvailable() throws Exception { Class<MultivaluedMap> type = MultivaluedMap.class; ParameterizedType genericType = newParameterizedType(type, String.class, String.class); when(applicationContext.getProviders().getMessageBodyReader(eq(type), eq(genericType), any(), eq(APPLICATION_FORM_URLENCODED_TYPE))) .thenReturn(null); thrown.expect(IllegalStateException.class); formParameterResolver.resolve(parameter, applicationContext); }
@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);  }