SpecobjectExporterFactory extends ExporterFactory { @Override protected Exporter createExporter(final Writer writer, final Stream<SpecificationItem> itemStream, final Newline newline) { final XMLStreamWriter xmlWriter = createXmlWriter(writer); final IndentingXMLStreamWriter indentingXmlWriter = new IndentingXMLStreamWriter(xmlWriter); return new SpecobjectExporter(itemStream, indentingXmlWriter, writer, newline); } SpecobjectExporterFactory();  static final String SUPPORTED_FORMAT; }
@Test void testCreateExporterWriterStreamOfSpecificationItemNewline() { final StringWriter writer = new StringWriter(); final SpecificationItem item = SpecificationItem.builder().id("art", "name", 42).build(); final Exporter exporter = factory.createExporter(writer, Stream.of(item), Newline.UNIX); exporter.runExport(); assertThat(writer.getBuffer().toString(), equalTo( "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<specdocument>\n <specobjects doctype=\"art\">\n <specobject>\n <id>name</id>\n <status>approved</status>\n <version>42</version>\n </specobject>\n </specobjects>\n</specdocument>")); }