Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/398.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java Cucumber无法识别我的字符串参数_Java_Junit_Cucumber_Cucumber Java_Cucumber Junit - Fatal编程技术网

Java Cucumber无法识别我的字符串参数

Java Cucumber无法识别我的字符串参数,java,junit,cucumber,cucumber-java,cucumber-junit,Java,Junit,Cucumber,Cucumber Java,Cucumber Junit,Cucumber无法识别字符串参数,我想将其用作货币。它只识别int值。(它查找步骤,因为其他步骤有效) 它显示以下错误消息: There were undefined steps. You can implement missing steps with the snippets below: @When("I deposit {int} of GBP") public void i_deposit_of_GBP(Integer int1) { // Write code here

Cucumber无法识别字符串参数,我想将其用作货币。它只识别int值。(它查找步骤,因为其他步骤有效)

它显示以下错误消息:

There were undefined steps. You can implement missing steps with the snippets below:

@When("I deposit {int} of GBP")
public void i_deposit_of_GBP(Integer int1) {
    // Write code here that turns the phrase above into concrete actions
    throw new cucumber.api.PendingException();
}

@Then("My balance is {int} of GBP")
public void my_balance_is_of_GBP(Integer int1) {
    // Write code here that turns the phrase above into concrete actions
    throw new cucumber.api.PendingException();
}
  • 假设我创建了一个帐户
  • 当我存入100英镑时
  • 那么我的余额是100英镑
有什么问题吗?

来自

{string}匹配单引号或双引号字符串, 例如“香蕉分割”或“香蕉分割”(但不是香蕉分割)

对于没有任何引号(或空格)的货币代码,您需要{word},因此:

 @When("I deposit {int} of {word}")
 @When("I deposit {int} of {word}")