在 jbehave 3 示例中,我可以将参数视为“double”,因此我尝试使用字符串以外的其他类型,但是当我尝试添加这样的布尔参数时
public void theUserShouldBeRedirectedToHomePage(@Named("should?") boolean should)
我得到一个参数类型错误:
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)
(另外,我使用的是 2.3 版,而不是 jbehave 的 3 版)
我的 jbehave 版本有问题吗?哪个是使用布尔参数的正确方法?