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

cucumber / cucumber-jvm / 3872 / 3
86%
master: 86%

Build:
DEFAULT BRANCH: master
Ran 06 Mar 2020 01:49PM UTC
Files 356
Run time 50s
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

06 Mar 2020 01:41PM UTC coverage: 85.53% (+0.002%) from 85.528%
COVERAGE=true

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

Source Files on job 3872.3 (COVERAGE=true)
  • Tree
  • List 0
  • Changed 3
  • Source Changed 3
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 3156
  • Travis Job 3872.3
  • 95e0f82e on github
  • Prev Job for COVERAGE=true on master (#3870.3)
  • Next Job for COVERAGE=true on master (#3875.3)
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