|
3 | 3 | import io.cucumber.core.eventbus.EventBus;
|
4 | 4 | import io.cucumber.core.runtime.TimeServiceEventBus;
|
5 | 5 | import io.cucumber.messages.types.Envelope;
|
6 |
| -import io.cucumber.messages.types.Hook; |
7 |
| -import io.cucumber.messages.types.ParameterType; |
8 |
| -import io.cucumber.messages.types.SourceReference; |
9 |
| -import io.cucumber.messages.types.StepDefinition; |
10 |
| -import io.cucumber.messages.types.StepDefinitionPattern; |
11 |
| -import io.cucumber.messages.types.StepDefinitionPatternType; |
12 | 6 | import io.cucumber.messages.types.TestRunFinished;
|
13 | 7 | import io.cucumber.messages.types.TestRunStarted;
|
14 | 8 | import io.cucumber.messages.types.Timestamp;
|
15 | 9 | import org.junit.jupiter.api.Test;
|
16 | 10 |
|
17 | 11 | import java.io.ByteArrayOutputStream;
|
18 | 12 | import java.time.Clock;
|
19 |
| -import java.util.Collections; |
20 | 13 | import java.util.UUID;
|
21 | 14 | import java.util.regex.Matcher;
|
22 | 15 | import java.util.regex.Pattern;
|
@@ -48,54 +41,6 @@ void writes_index_html() throws Throwable {
|
48 | 41 | extractCucumberMessages(bytes), STRICT);
|
49 | 42 | }
|
50 | 43 |
|
51 |
| - @Test |
52 |
| - void ignores_step_definitions() throws Throwable { |
53 |
| - ByteArrayOutputStream bytes = new ByteArrayOutputStream(); |
54 |
| - HtmlFormatter formatter = new HtmlFormatter(bytes); |
55 |
| - EventBus bus = new TimeServiceEventBus(Clock.systemUTC(), UUID::randomUUID); |
56 |
| - formatter.setEventPublisher(bus); |
57 |
| - |
58 |
| - TestRunStarted testRunStarted = new TestRunStarted(new Timestamp(10L, 0L), null); |
59 |
| - bus.send(Envelope.of(testRunStarted)); |
60 |
| - |
61 |
| - StepDefinition stepDefinition = new StepDefinition( |
62 |
| - "", |
63 |
| - new StepDefinitionPattern("", StepDefinitionPatternType.CUCUMBER_EXPRESSION), |
64 |
| - SourceReference.of("https://example.com")); |
65 |
| - bus.send(Envelope.of(stepDefinition)); |
66 |
| - |
67 |
| - Hook hook = new Hook("", |
68 |
| - null, |
69 |
| - SourceReference.of("https://example.com"), |
70 |
| - null, null); |
71 |
| - bus.send(Envelope.of(hook)); |
72 |
| - |
73 |
| - // public ParameterType(String name, List<String> regularExpressions, |
74 |
| - // Boolean preferForRegularExpressionMatch, Boolean useForSnippets, |
75 |
| - // String id) { |
76 |
| - ParameterType parameterType = new ParameterType( |
77 |
| - "", |
78 |
| - Collections.emptyList(), |
79 |
| - true, |
80 |
| - false, |
81 |
| - "", |
82 |
| - null); |
83 |
| - bus.send(Envelope.of(parameterType)); |
84 |
| - |
85 |
| - TestRunFinished testRunFinished = new TestRunFinished( |
86 |
| - null, |
87 |
| - true, |
88 |
| - new Timestamp(15L, 0L), |
89 |
| - null, null); |
90 |
| - bus.send(Envelope.of(testRunFinished)); |
91 |
| - |
92 |
| - assertEquals("[" + |
93 |
| - "{\"testRunStarted\":{\"timestamp\":{\"nanos\":0,\"seconds\":10}}}," + |
94 |
| - "{\"testRunFinished\":{\"success\":true,\"timestamp\":{\"nanos\":0,\"seconds\":15}}}" + |
95 |
| - "]", |
96 |
| - extractCucumberMessages(bytes), STRICT); |
97 |
| - } |
98 |
| - |
99 | 44 | private static String extractCucumberMessages(ByteArrayOutputStream bytes) {
|
100 | 45 | Pattern pattern = Pattern.compile("^.*window\\.CUCUMBER_MESSAGES = (\\[.+]);.*$", Pattern.DOTALL);
|
101 | 46 | Matcher matcher = pattern.matcher(new String(bytes.toByteArray(), UTF_8));
|
|
0 commit comments