Skip to content

Commit

Permalink
Add test (#548)
Browse files Browse the repository at this point in the history
  • Loading branch information
dr0i committed Sep 20, 2024
1 parent 76b7a06 commit b57e9e4
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,21 @@ public void issue336_createRecordWithTopLevelLeader_dummy() {
assertEquals(expected, actual);
}

@Test
public void issue548_createRecordWithTypeAttributeInRecordTagAndLeader() {
encoder.startRecord(RECORD_ID);
encoder.literal("type", "Bibliographic");
encoder.startEntity(Marc21EventNames.LEADER_ENTITY);
encoder.literal(Marc21EventNames.LEADER_ENTITY, "dummy");
encoder.endEntity();
encoder.endRecord();
encoder.closeStream();
String expected = XML_DECLARATION + XML_ROOT_OPEN + "<marc:record type=\"Bibliographic\">" +
"<marc:leader>dummy</marc:leader></marc:record>" + XML_MARC_COLLECTION_END_TAG;
String actual = resultCollector.toString();
assertEquals(expected, actual);
}

@Test
public void issue336_createRecordWithTopLevelLeader_defaultMarc21Xml() {
issue336_createRecordWithTopLevelLeader(encoder, "00000naa a2200000uc 4500");
Expand Down

0 comments on commit b57e9e4

Please sign in to comment.