@Test public void willCreateAnIogiParameterForEachRequestParameterValue() throws Exception { ResourceMethod anyMethod = buyA; requestParameterIs(anyMethod, "name", "a", "b"); final InstantiatorWithErrors mockInstantiator = mock(InstantiatorWithErrors.class); final Parameters expectedParamters = new Parameters( Arrays.asList(new Parameter("name", "a"), new Parameter("name", "b"))); IogiParametersProvider iogiProvider = new IogiParametersProvider(nameProvider, request, mockInstantiator); iogiProvider.getParametersFor(anyMethod, errors, null); verify(mockInstantiator).instantiate(any(Target.class), eq(expectedParamters), eq(errors)); }
public Object[] getParametersFor(ResourceMethod method, List<Message> errors, ResourceBundle bundle) { Parameters parameters = parseParameters(servletRequest); List<Target<Object>> targets = createTargets(method); List<Object> arguments = instantiateParameters(parameters, targets, errors); return arguments.toArray(); }
IogiParametersProvider implements ParametersProvider { public Object[] getParametersFor(ResourceMethod method, List<Message> errors, ResourceBundle bundle) { Parameters parameters = parseParameters(servletRequest); List<Target<Object>> targets = createTargets(method); List<Object> arguments = instantiateParameters(parameters, targets, errors); return arguments.toArray(); } }
IogiParametersProvider implements ParametersProvider { public Object[] getParametersFor(ResourceMethod method, List<Message> errors, ResourceBundle bundle) { Parameters parameters = parseParameters(servletRequest); List<Target<Object>> targets = createTargets(method); List<Object> arguments = instantiateParameters(parameters, targets, errors); return arguments.toArray(); } IogiParametersProvider(ParameterNameProvider provider, HttpServletRequest parameters, InstantiatorWithErrors instantiator); }
IogiParametersProvider implements ParametersProvider { public Object[] getParametersFor(ResourceMethod method, List<Message> errors, ResourceBundle bundle) { Parameters parameters = parseParameters(servletRequest); List<Target<Object>> targets = createTargets(method); List<Object> arguments = instantiateParameters(parameters, targets, errors); return arguments.toArray(); } IogiParametersProvider(ParameterNameProvider provider, HttpServletRequest parameters, InstantiatorWithErrors instantiator); Object[] getParametersFor(ResourceMethod method, List<Message> errors, ResourceBundle bundle); }
IogiParametersProvider implements ParametersProvider { public Object[] getParametersFor(ResourceMethod method, List<Message> errors, ResourceBundle bundle) { Parameters parameters = parseParameters(servletRequest); List<Target<Object>> targets = createTargets(method); List<Object> arguments = instantiateParameters(parameters, targets, errors); return arguments.toArray(); } IogiParametersProvider(ParameterNameProvider provider, HttpServletRequest parameters, InstantiatorWithErrors instantiator); Object[] getParametersFor(ResourceMethod method, List<Message> errors, ResourceBundle bundle);  }