Details
Description
The issue is described here :
http://www.mail-archive.com/dev@jbehave.codehaus.org/msg09141.html
There is an example project attached
Description
The scenario fails because
"org.jbehave.core.steps.ParameterConverters$ParameterConvertionFailed: No parameter converter for interface java.util.List'
If i debug, he passes through the StringListConverter, but in the accept method the type is not an instance of ParameterizedType, because in the StepCreator class you use method.getParameterTypes() that doesn't retrieve de generics but the Class type (so java.util.List)
Solution
StepCreator at line 805 :
https://github.com/jbehave/jbehave-core/blob/master/jbehave-core/src/main/java/org/jbehave/core/steps/StepCreator.java
Should be :
Type[] parameterTypes = method.getGenericParameterTypes();
And the Parameter class should receive a Type instead of a Class type
Activity
Field | Original Value | New Value |
---|---|---|
Affects Version/s | 3.9.5 [ 20598 ] | |
Affects Version/s | 3.9.4 [ 20449 ] |
Summary | StepCreator doesn't take Type parameters but Class<?> of parameters | StepCreator doesn't support method generics parameters |
Description |
The issue is described here :
http://www.mail-archive.com/dev@jbehave.codehaus.org/msg09141.html There is an example project attached Description : >> > The scenario fails because >> "org.jbehave.core.steps.ParameterConverters$ParameterConvertionFailed: No >> parameter converter for interface java.util.List' >> > >> > >> > If i debug, he passes through the StringListConverter, but in the >> accept method the type is not an instance of ParameterizedType, because in >> the StepCreator class you use method.getParameterTypes() that doesn't >> retrieve de generics but the Class type (so java.util.List) >> > >> > I think that you should use for that Parameter class the Type and not >> the Class |
The issue is described here :
http://www.mail-archive.com/dev@jbehave.codehaus.org/msg09141.html There is an example project attached *Description* The scenario fails because "org.jbehave.core.steps.ParameterConverters$ParameterConvertionFailed: No parameter converter for interface java.util.List' If i debug, he passes through the StringListConverter, but in the accept method the type is not an instance of ParameterizedType, because in the StepCreator class you use method.getParameterTypes() that doesn't retrieve de generics but the Class type (so java.util.List) *Solution* StepCreator at line 805 : https://github.com/jbehave/jbehave-core/blob/master/jbehave-core/src/main/java/org/jbehave/core/steps/StepCreator.java Should be : Type[] parameterTypes = method.getGenericParameterTypes(); And the Parameter class should receive a Type instead of a Class type |
Resolution | Fixed [ 1 ] | |
Assignee | Mauro Talevi [ maurotalevi ] | |
Status | Open [ 1 ] | Resolved [ 5 ] |