From 29a5be14ab8e9acc54a46167289c599d65ed4859 Mon Sep 17 00:00:00 2001 From: Pascal Christoph Date: Fri, 27 Sep 2024 14:48:08 +0200 Subject: [PATCH] Test that footer is not written when record is empty (#543) This commit fails and so shows that, although the record is empty, the footer is written. --- .../org/metafacture/biblio/marc21/MarcXmlEncoderTest.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/metafacture-biblio/src/test/java/org/metafacture/biblio/marc21/MarcXmlEncoderTest.java b/metafacture-biblio/src/test/java/org/metafacture/biblio/marc21/MarcXmlEncoderTest.java index 8caac8d9..5b979e5a 100644 --- a/metafacture-biblio/src/test/java/org/metafacture/biblio/marc21/MarcXmlEncoderTest.java +++ b/metafacture-biblio/src/test/java/org/metafacture/biblio/marc21/MarcXmlEncoderTest.java @@ -389,4 +389,11 @@ public void shouldNotEncodeNestedTypeLiteralAsAttribute() { assertEquals(expected, actual); } + @Test + public void issue543_shouldNotWriteFooterWhenRecordIsEmpty() { + encoder.closeStream(); + String actual = resultCollector.toString(); + assertTrue(actual.isEmpty()); + } + }