NoSpaceBeforeCloseWriter extends XmlWriter { @Override public void write(String str) { if (" />".equals(str)) { out.write("/>"); } else { out.write(str); } } NoSpaceBeforeCloseWriter(XmlWriter out); @Override void write(String str); @Override void write(int c); @Override void flush(); @Override void close(); @Override String toString(); @Override void clearLineBuffer();  }
@Test void closeXmlTagShouldNotHaveSpace() { writer.write(" />"); verify(xmlWriter).write("/>"); }
@Test void charShouldBeDelegated() { int i = new Random().nextInt(); writer.write(i); verify(xmlWriter).write(i); }
@Test void testWriteDeprecated1() { final Executable testMethod = () -> writer.write(new char[0]); final UnsupportedOperationException thrown = assertThrows(UnsupportedOperationException.class, testMethod); assertThat(thrown.getMessage(), is(nullValue())); }
@Test void testWriteDeprecated2() { final Executable testMethod = () -> writer.write("", 0, 0); final UnsupportedOperationException thrown = assertThrows(UnsupportedOperationException.class, testMethod); assertThat(thrown.getMessage(), is(nullValue())); }
@Test void testWriteDeprecated3() { final Executable testMethod = () -> writer.write(new char[0], 0, 0); final UnsupportedOperationException thrown = assertThrows(UnsupportedOperationException.class, testMethod); assertThat(thrown.getMessage(), is(nullValue())); }