• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

cucumber / cucumber-jvm / 3872
86%

Build:
DEFAULT BRANCH: master
Ran 06 Mar 2020 01:49PM UTC
Jobs 1
Files 356
Run time 52s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
3872

push

travis-ci

web-flow
[Java] Add @ParameterType(useRegexpMatchAsStrongTypeHint=true/false) (#1914)

Parameter types are registered with a regex. When a step definition is written
as a regular expression `cucumber-expressions` use the regex in the capture
group as a type hint.

When the type hint provided by the regex and the type hint provided by the
method (i.e. the types of its arguments) disagree about the type
`cucumber-expressions` prefers the hint provided by the regex.

When parameter types are declared with very simple regexes this may cause a
problem. For example:

```
import io.cucumber.java.ParameterType;
import io.cucumber.java.en.Given;

public class Main {

    private static class TypeA {}

    @ParameterType("\\w+")
    public TypeA typeA(String a) {
        return new TypeA();
    }

    @Given("a cucumber expression of {typeA}")
    public void an_object_of_type_a(TypeA a) {
        // works fine!
    }

    @Given("^a regular expression of (\\w+)$")
    public void an_object_of_type_b(String b) {
        // broken: will attempt to use the transformer for TypeA
    }
}
```

By using `@ParameterType(pattern="\\w+", useRegexpMatchAsStrongTypeHint=false)`
this behaviour can be changed to instead prefer the type hint from the method.

6555 of 7664 relevant lines covered (85.53%)

0.86 hits per line

Jobs
ID Job ID Ran Files Coverage
3 3872.3 (COVERAGE=true) 06 Mar 2020 01:49PM UTC 0
85.53
Travis Job 3872.3
Source Files on build 3872
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #3872
  • 95e0f82e on github
  • Prev Build on master (#3870)
  • Next Build on master (#3875)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc