code formatting

This commit is contained in:
Claudio Atzori 2021-05-20 16:13:06 +02:00
parent b695932ae4
commit ae5c28e54f
2 changed files with 13 additions and 11 deletions

View File

@ -28,7 +28,9 @@ public class OdfToOafMapper extends AbstractMdRecordToOafMapper {
@Override @Override
protected List<StructuredProperty> prepareTitles(final Document doc, final DataInfo info) { protected List<StructuredProperty> prepareTitles(final Document doc, final DataInfo info) {
return prepareListStructProps( return prepareListStructProps(
doc, "//*[local-name()='titles']/*[local-name()='title']|//*[local-name()='resource']/*[local-name()='title']", MAIN_TITLE_QUALIFIER, info); doc,
"//*[local-name()='titles']/*[local-name()='title']|//*[local-name()='resource']/*[local-name()='title']",
MAIN_TITLE_QUALIFIER, info);
} }
@Override @Override

View File

@ -331,7 +331,7 @@ public class MappersTest {
void testOdfBielefeld() throws IOException { void testOdfBielefeld() throws IOException {
final String xml = IOUtils.toString(getClass().getResourceAsStream("odf_bielefeld.xml")); final String xml = IOUtils.toString(getClass().getResourceAsStream("odf_bielefeld.xml"));
final List<Oaf> list = new OdfToOafMapper(vocs, false).processMdRecord(xml); final List<Oaf> list = new OdfToOafMapper(vocs, false, true).processMdRecord(xml);
assertEquals(1, list.size()); assertEquals(1, list.size());
assertTrue(list.get(0) instanceof Publication); assertTrue(list.get(0) instanceof Publication);
@ -345,9 +345,9 @@ public class MappersTest {
assertTrue(p.getAuthor().size() > 0); assertTrue(p.getAuthor().size() > 0);
final Optional<Author> author = p final Optional<Author> author = p
.getAuthor() .getAuthor()
.stream() .stream()
.findFirst(); .findFirst();
assertTrue(author.isPresent()); assertTrue(author.isPresent());
assertEquals("Potwarka, Luke R.", author.get().getFullname()); assertEquals("Potwarka, Luke R.", author.get().getFullname());
@ -363,12 +363,12 @@ public class MappersTest {
assertNotNull(p.getInstance()); assertNotNull(p.getInstance());
assertTrue(p.getInstance().size() > 0); assertTrue(p.getInstance().size() > 0);
p p
.getInstance() .getInstance()
.stream() .stream()
.forEach(i -> { .forEach(i -> {
assertNotNull(i.getAccessright()); assertNotNull(i.getAccessright());
assertEquals("OPEN", i.getAccessright().getClassid()); assertEquals("OPEN", i.getAccessright().getClassid());
}); });
assertEquals("UNKNOWN", p.getInstance().get(0).getRefereed().getClassid()); assertEquals("UNKNOWN", p.getInstance().get(0).getRefereed().getClassid());
} }