|
2 | 2 |
|
3 | 3 | import io.cucumber.messages.types.Envelope;
|
4 | 4 | import io.cucumber.query.Query;
|
| 5 | +import io.cucumber.query.Repository; |
5 | 6 |
|
6 | 7 | import java.io.IOException;
|
7 | 8 | import java.io.OutputStream;
|
|
12 | 13 | import java.util.List;
|
13 | 14 | import java.util.function.Function;
|
14 | 15 |
|
| 16 | +import static io.cucumber.query.Repository.RepositoryFeature.INCLUDE_ATTACHMENTS; |
| 17 | +import static io.cucumber.query.Repository.RepositoryFeature.INCLUDE_GHERKIN_DOCUMENTS; |
| 18 | +import static io.cucumber.query.Repository.RepositoryFeature.INCLUDE_HOOKS; |
| 19 | +import static io.cucumber.query.Repository.RepositoryFeature.INCLUDE_STEP_DEFINITIONS; |
15 | 20 | import static java.util.Objects.requireNonNull;
|
16 | 21 |
|
17 | 22 | /**
|
|
23 | 28 | public final class MessagesToJsonWriter implements AutoCloseable {
|
24 | 29 |
|
25 | 30 | private final OutputStreamWriter out;
|
26 |
| - private final Query query = new Query(); |
| 31 | + private final Repository repository = Repository.builder() |
| 32 | + .feature(INCLUDE_ATTACHMENTS, true) |
| 33 | + .feature(INCLUDE_GHERKIN_DOCUMENTS, true) |
| 34 | + .feature(INCLUDE_HOOKS, true) |
| 35 | + .feature(INCLUDE_STEP_DEFINITIONS, true) |
| 36 | + .build(); |
| 37 | + private final Query query = new Query(repository); |
27 | 38 | private final Serializer serializer;
|
28 | 39 | private final Function<URI, String> uriFormatter;
|
29 | 40 | private boolean streamClosed = false;
|
@@ -69,7 +80,7 @@ public void write(Envelope envelope) throws IOException {
|
69 | 80 | if (streamClosed) {
|
70 | 81 | throw new IOException("Stream closed");
|
71 | 82 | }
|
72 |
| - query.update(envelope); |
| 83 | + repository.update(envelope); |
73 | 84 | }
|
74 | 85 |
|
75 | 86 | /**
|
|
0 commit comments