Skip to content

Commit 09e5052

Browse files
Julien KroneggU117293
authored andcommitted
fix: corrected failing testcase for #2762
1 parent 48c5a66 commit 09e5052

File tree

2 files changed

+18
-6
lines changed

2 files changed

+18
-6
lines changed

cucumber-core/src/test/java/io/cucumber/core/plugin/StubPickleStepTestStep.java

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,22 @@
1010
import java.util.UUID;
1111

1212
class StubPickleStepTestStep implements PickleStepTestStep {
13+
private final String pattern;
14+
private final String stepText;
15+
16+
public StubPickleStepTestStep() {
17+
this.pattern = null;
18+
this.stepText = null;
19+
}
20+
21+
public StubPickleStepTestStep(String pattern, String stepText) {
22+
this.pattern = pattern;
23+
this.stepText = stepText;
24+
}
1325

1426
@Override
1527
public String getPattern() {
16-
return null;
28+
return pattern;
1729
}
1830

1931
@Override
@@ -43,7 +55,7 @@ public URI getUri() {
4355

4456
@Override
4557
public String getStepText() {
46-
return null;
58+
return stepText;
4759
}
4860

4961
@Override

cucumber-core/src/test/java/io/cucumber/core/plugin/UsageFormatterTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class UsageFormatterTest {
3030
void resultWithPassedStep() {
3131
OutputStream out = new ByteArrayOutputStream();
3232
UsageFormatter usageFormatter = new UsageFormatter(out);
33-
TestStep testStep = new StubPickleStepTestStep();
33+
TestStep testStep = new StubPickleStepTestStep("stepDef", "step");
3434
Result result = new Result(Status.PASSED, Duration.ofMillis(12345L), null);
3535

3636
usageFormatter
@@ -49,7 +49,7 @@ void resultWithPassedStep() {
4949
void resultWithPassedAndFailedStep() {
5050
OutputStream out = new ByteArrayOutputStream();
5151
UsageFormatter usageFormatter = new UsageFormatter(out);
52-
TestStep testStep = new StubPickleStepTestStep();
52+
TestStep testStep = new StubPickleStepTestStep("stepDef", "step");
5353

5454
Result passed = new Result(Status.PASSED, Duration.ofSeconds(12345L), null);
5555
usageFormatter
@@ -72,7 +72,7 @@ void resultWithPassedAndFailedStep() {
7272
void resultWithZeroDuration() {
7373
OutputStream out = new ByteArrayOutputStream();
7474
UsageFormatter usageFormatter = new UsageFormatter(out);
75-
TestStep testStep = new StubPickleStepTestStep();
75+
TestStep testStep = new StubPickleStepTestStep("stepDef", "step");
7676
Result result = new Result(Status.PASSED, Duration.ZERO, null);
7777

7878
usageFormatter
@@ -92,7 +92,7 @@ void resultWithZeroDuration() {
9292
void resultWithNullDuration() {
9393
OutputStream out = new ByteArrayOutputStream();
9494
UsageFormatter usageFormatter = new UsageFormatter(out);
95-
PickleStepTestStep testStep = new StubPickleStepTestStep();
95+
PickleStepTestStep testStep = new StubPickleStepTestStep("stepDef", "step");
9696
Result result = new Result(Status.PASSED, Duration.ZERO, null);
9797

9898
usageFormatter

0 commit comments

Comments
 (0)