@Test(expected = IllegalArgumentException.class) public void shouldThrowIllegalArgumentExceptionOnRawParametersCountNullAndMethodHasParameters() throws Exception { String rawParameters[] = null; Method method = ReflectionUtils.findMethod(TestClass.class, "testMethod", Long.class, Boolean.class); converter.convert(method, rawParameters); }
@Override public Object[] convert(Method method, String[] rawParameters) { if (rawParameters == null) { if (method.getParameterCount() > 0) throw new IllegalArgumentException(ILLEGAL_PARAMETERS_COUNT_MESSAGE); else return EMPTY_PARAMETERS; } else if (rawParameters.length != method.getParameterCount()) throw new IllegalArgumentException(ILLEGAL_PARAMETERS_COUNT_MESSAGE); return doConvert(method, rawParameters); }
AbstractMethodParameterConverter implements MethodParameterConverter { @Override public Object[] convert(Method method, String[] rawParameters) { if (rawParameters == null) { if (method.getParameterCount() > 0) throw new IllegalArgumentException(ILLEGAL_PARAMETERS_COUNT_MESSAGE); else return EMPTY_PARAMETERS; } else if (rawParameters.length != method.getParameterCount()) throw new IllegalArgumentException(ILLEGAL_PARAMETERS_COUNT_MESSAGE); return doConvert(method, rawParameters); } }
AbstractMethodParameterConverter implements MethodParameterConverter { @Override public Object[] convert(Method method, String[] rawParameters) { if (rawParameters == null) { if (method.getParameterCount() > 0) throw new IllegalArgumentException(ILLEGAL_PARAMETERS_COUNT_MESSAGE); else return EMPTY_PARAMETERS; } else if (rawParameters.length != method.getParameterCount()) throw new IllegalArgumentException(ILLEGAL_PARAMETERS_COUNT_MESSAGE); return doConvert(method, rawParameters); }  }
AbstractMethodParameterConverter implements MethodParameterConverter { @Override public Object[] convert(Method method, String[] rawParameters) { if (rawParameters == null) { if (method.getParameterCount() > 0) throw new IllegalArgumentException(ILLEGAL_PARAMETERS_COUNT_MESSAGE); else return EMPTY_PARAMETERS; } else if (rawParameters.length != method.getParameterCount()) throw new IllegalArgumentException(ILLEGAL_PARAMETERS_COUNT_MESSAGE); return doConvert(method, rawParameters); }  @Override Object[] convert(Method method, String[] rawParameters); }
AbstractMethodParameterConverter implements MethodParameterConverter { @Override public Object[] convert(Method method, String[] rawParameters) { if (rawParameters == null) { if (method.getParameterCount() > 0) throw new IllegalArgumentException(ILLEGAL_PARAMETERS_COUNT_MESSAGE); else return EMPTY_PARAMETERS; } else if (rawParameters.length != method.getParameterCount()) throw new IllegalArgumentException(ILLEGAL_PARAMETERS_COUNT_MESSAGE); return doConvert(method, rawParameters); }  @Override Object[] convert(Method method, String[] rawParameters);  }