kiwiproject / kiwi

A set of Java utilities that we could not find in Guava or Apache Commons...or we just felt like having our own version.
MIT License
12 stars 1 forks source link

Fix bug in test: KiwiIOTest.CloseQuietly.shouldClose_XMLStreamWriter #1177

Closed sleberknight closed 3 months ago

sleberknight commented 3 months ago

This test throws a javax.xml.stream.XMLStreamException when the XMLStreamWriter is closed using KiwiIO.closeQuietly, with the error message:

Trying to write END_DOCUMENT when document has no root (ie. trying to output empty document).

As a result, we were not testing the case when closing it succeeds.

To fix, it can either be mocked, or we can use the XMLStreamWriter to write a simple XMl document, then close it.