当其他步骤正常工作时,Cucumber java抛出一个未定义的步骤

当其他步骤正常工作时,Cucumber java抛出一个未定义的步骤,java,spring,cucumber,gherkin,Java,Spring,Cucumber,Gherkin,我的功能文件中包含以下步骤: Then Validate in total, how much is <firstCreditor> owed by everyone else. They are owed £<firstCreditorValue> 我的规范类: package com.bsocial.integration; import io.cucumber.junit.Cucumber; import io.cucumber.junit.Cucumb

我的功能文件中包含以下步骤:

    Then Validate in total, how much is <firstCreditor> owed by everyone else. They are owed £<firstCreditorValue>
我的规范类:

package com.bsocial.integration;

import io.cucumber.junit.Cucumber;
import io.cucumber.junit.CucumberOptions;
import org.junit.runner.RunWith;

@RunWith(Cucumber.class)
@CucumberOptions(
        strict = true,
        monochrome=true,
        plugin = {"pretty", "html:build/cucumber-reports"},
        tags = {"@myproject"},
        features = {"classpath:features/IntegrationTestRequest.feature"}
)
public class IntegrationTestRequestSpecs {

}
我的gradle配置有:

    testCompile("io.cucumber:cucumber-core:${cucumberVersion}")
    testCompile("io.cucumber:cucumber-java8:${cucumberVersion}")
    testCompile("io.cucumber:cucumber-junit:${cucumberVersion}")
    testCompile("io.cucumber:cucumber-spring:${cucumberVersion}")
其中
cucumberVersion='4.7.4'

但我还是犯了一个错误:

The step "Validate in total, how much is David owed by everyone else. They are owed £2225.50" is undefined
io.cucumber.junit.UndefinedThrowable: The step "Validate in total, how much is David owed by everyone else. They are owed £2225.50" is undefined
我在这里读过几篇关于这个错误的帖子,但大多数似乎与胶水有关,在我的例子中,我确信它是有效的,因为这是唯一让我感到悲伤的一步

所有其他步骤都很好。我使用一个功能文件、一个规范类和一个步骤定义类,所有这些都非常普通,因为我甚至没有用我的类扩展或实现任何东西


有什么我没有检查的吗?

结果是问题出在我的步骤定义类中

我已将注释从

    @Then("^Validate in total, how much is (.+) owed by everyone else. They are owed £(.d)$")

注意:所有其他步骤都使用
(.+)
(.d)
很好,就是这个步骤出现了这个问题。我甚至想知道,当我从Word中复制步骤时,我是否最终得到了一个看不见的字符,或者我有一些特殊字符是无效的(例如:)。我还认为,也许,只是也许,然后有一个不同于其他注释的实现,并用
来代替它。
我不知道这是为什么,也不知道它是如何工作的,我确实看过《小黄瓜正则表达式指南》,但什么也没找到。也许有更好的线人能告诉我是什么问题

    @Then("^Validate in total, how much is (.+) owed by everyone else. They are owed £(.d)$")
    @Then("^Validate in total, how much is (.*) owed by everyone else. They are owed £(.*)$")