In the jbehave 3 examples I can see parameters as “double”, so I tried to use other types besides string, but when I try to add a boolean parameter like this
public void theUserShouldBeRedirectedToHomePage(@Named("should?") boolean should)
I get an argument type error:
java.lang.IllegalArgumentException: argument type mismatch
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.jbehave.scenario.steps.CandidateStep$1.perform(CandidateStep.java:225)
at org.jbehave.scenario.ScenarioRunner$FineSoFar.run(ScenarioRunner.java:112)
(also, I’m using version 2.3, not 3 of jbehave)
Is it a problem with my jbehave version? which is the right way to use a boolean parameter?
I try this too. There is no default ParameterConverter for boolean/Boolean. You can easily add one.
http://jbehave.org/reference/stable/parameter-converters.html