Skip to content

Commit

Permalink
Add test-case for issue #278
Browse files Browse the repository at this point in the history
(cherry picked from commit 25f2da3)
  • Loading branch information
cboehme committed Dec 19, 2018
1 parent 07a88d1 commit ba0bc9f
Showing 1 changed file with 13 additions and 2 deletions.
Expand Up @@ -15,6 +15,8 @@
*/
package org.metafacture.biblio.marc21;

import static org.metafacture.biblio.marc21.Marc21EventNames.LEADER_ENTITY;
import static org.metafacture.biblio.marc21.Marc21EventNames.RECORD_STATUS_LITERAL;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.matches;
import static org.mockito.Mockito.verify;
Expand All @@ -35,8 +37,6 @@
*/
public final class Marc21EncoderTest {

private static final String LEADER_LITERAL = "leader";

private Marc21Encoder marc21Encoder;

@Mock
Expand Down Expand Up @@ -102,4 +102,15 @@ public void issue231ShouldIgnoreTypeLiterals() {
verify(receiver).process(any(String.class));
}

@Test
public void issue278ShouldNotFailWhenProcessingLeaderEntity() {
marc21Encoder.startRecord("");
marc21Encoder.startEntity(LEADER_ENTITY);
marc21Encoder.literal(RECORD_STATUS_LITERAL, "a");
marc21Encoder.endEntity();
marc21Encoder.endRecord();

verify(receiver).process(any(String.class));
}

}

0 comments on commit ba0bc9f

Please sign in to comment.