@Test public void willCreateATargerForEachFormalParameterDeclaredByTheMethod() throws Exception { final ResourceMethod buyAHouse = buyA; requestParameterIs(buyAHouse, "house", ""); final InstantiatorWithErrors mockInstantiator = mock(InstantiatorWithErrors.class); IogiParametersProvider iogiProvider = new IogiParametersProvider(nameProvider, request, mockInstantiator); final Target<House> expectedTarget = Target.create(House.class, "house"); iogiProvider.getParametersFor(buyAHouse, errors, null); verify(mockInstantiator).instantiate(eq(expectedTarget), any(Parameters.class), 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);  }