Skip to content

Commit 9c0b4af

Browse files
committed
Update test to show that marc:leader isn't pretty printed (#550)
1 parent 57f9344 commit 9c0b4af

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

metafacture-biblio/src/test/java/org/metafacture/biblio/marc21/MarcXmlEncoderTest.java

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,19 @@ public void createAnEmptyRecord() {
130130
@Test
131131
public void createARecordPrettyPrint() {
132132
encoder.setFormatted(true);
133-
addOneRecord(encoder);
133+
encoder.startRecord(RECORD_ID);
134+
encoder.startEntity(Marc21EventNames.LEADER_ENTITY);
135+
encoder.literal(Marc21EventNames.LEADER_ENTITY, "dummy");
136+
encoder.endEntity();
137+
encoder.literal("001", RECORD_ID);
138+
encoder.startEntity("010 ");
139+
encoder.literal("a", RECORD_ID);
140+
encoder.endEntity();
141+
encoder.endRecord();
134142
encoder.closeStream();
135-
String expected = XML_DECLARATION + "\n" + XML_ROOT_OPEN + "\n"// " <marc:record>\n"
143+
String expected = XML_DECLARATION + "\n" + XML_ROOT_OPEN + "\n"
136144
+ "\t<marc:record>\n"//
145+
+ "\t\t<marc:leader>dummy</marc:leader>\n"
137146
+ "\t\t<marc:controlfield tag=\"001\">92005291</marc:controlfield>\n"//
138147
+ "\t\t<marc:datafield tag=\"010\" ind1=\" \" ind2=\" \">\n"//
139148
+ "\t\t\t<marc:subfield code=\"a\">92005291</marc:subfield>\n"//

0 commit comments

Comments
 (0)