Skip to content

Commit

Permalink
fix: corrected failing testcase for #2762
Browse files Browse the repository at this point in the history
  • Loading branch information
Julien Kronegg committed Jul 17, 2023
1 parent 2d43dfb commit aab945b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,22 @@
import java.util.UUID;

class StubPickleStepTestStep implements PickleStepTestStep {
private final String pattern;
private final String stepText;

public StubPickleStepTestStep() {
this.pattern = null;
this.stepText = null;
}

public StubPickleStepTestStep(String pattern, String stepText) {
this.pattern = pattern;
this.stepText = stepText;
}

@Override
public String getPattern() {
return null;
return pattern;
}

@Override
Expand Down Expand Up @@ -43,7 +55,7 @@ public URI getUri() {

@Override
public String getStepText() {
return null;
return stepText;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class UsageFormatterTest {
void resultWithPassedStep() {
OutputStream out = new ByteArrayOutputStream();
UsageFormatter usageFormatter = new UsageFormatter(out);
TestStep testStep = new StubPickleStepTestStep();
TestStep testStep = new StubPickleStepTestStep("stepDef", "step");
Result result = new Result(Status.PASSED, Duration.ofMillis(12345L), null);

usageFormatter
Expand All @@ -49,7 +49,7 @@ void resultWithPassedStep() {
void resultWithPassedAndFailedStep() {
OutputStream out = new ByteArrayOutputStream();
UsageFormatter usageFormatter = new UsageFormatter(out);
TestStep testStep = new StubPickleStepTestStep();
TestStep testStep = new StubPickleStepTestStep("stepDef", "step");

Result passed = new Result(Status.PASSED, Duration.ofSeconds(12345L), null);
usageFormatter
Expand All @@ -72,7 +72,7 @@ void resultWithPassedAndFailedStep() {
void resultWithZeroDuration() {
OutputStream out = new ByteArrayOutputStream();
UsageFormatter usageFormatter = new UsageFormatter(out);
TestStep testStep = new StubPickleStepTestStep();
TestStep testStep = new StubPickleStepTestStep("stepDef", "step");
Result result = new Result(Status.PASSED, Duration.ZERO, null);

usageFormatter
Expand All @@ -92,7 +92,7 @@ void resultWithZeroDuration() {
void resultWithNullDuration() {
OutputStream out = new ByteArrayOutputStream();
UsageFormatter usageFormatter = new UsageFormatter(out);
PickleStepTestStep testStep = new StubPickleStepTestStep();
PickleStepTestStep testStep = new StubPickleStepTestStep("stepDef", "step");
Result result = new Result(Status.PASSED, Duration.ZERO, null);

usageFormatter
Expand Down

0 comments on commit aab945b

Please sign in to comment.