IndentingXMLStreamWriter extends DelegatingXMLStreamWriter { @Override public void writeCharacters(String text) throws XMLStreamException { state = State.SEEN_DATA; super.writeCharacters(text); } IndentingXMLStreamWriter(XMLStreamWriter writer); @Override void writeStartDocument(); @Override void writeStartDocument(String version); @Override void writeStartDocument(String encoding, String version); @Override void writeStartElement(String localName); @Override void writeStartElement(String namespaceURI, String localName); @Override void writeStartElement(String prefix, String localName, String namespaceURI); @Override void writeEmptyElement(String namespaceURI, String localName); @Override void writeEmptyElement(String prefix, String localName, String namespaceURI); @Override void writeEmptyElement(String localName); @Override void writeEndElement(); @Override void writeCharacters(String text); @Override void writeCharacters(char[] text, int start, int len); @Override void writeCData(String data);  }
@Test void testWriteCharactersString() throws XMLStreamException { writer.writeCharacters(DATA); delegateInOrder.verify(delegateMock).writeCharacters(DATA); delegateInOrder.verifyNoMoreInteractions(); }
@Test void testWriteCharactersCharArrayIntInt() throws XMLStreamException { final char[] text = { 'a', 'b', 'c' }; final int start = 10; final int len = 20; writer.writeCharacters(text, start, len); delegateInOrder.verify(delegateMock).writeCharacters(text, start, len); delegateInOrder.verifyNoMoreInteractions(); }