forked from D-Net/dnet-hadoop
code formatted
This commit is contained in:
parent
753c2a72bd
commit
9d94648f3b
|
@ -23,10 +23,15 @@ class CrossrefMappingTest {
|
||||||
val mapper = new ObjectMapper()
|
val mapper = new ObjectMapper()
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
def testMissingAuthorParser():Unit = {
|
def testMissingAuthorParser(): Unit = {
|
||||||
val json: String = Source.fromInputStream(getClass.getResourceAsStream("/eu/dnetlib/doiboost/crossref/s41567-022-01757-y.json")).mkString
|
val json: String = Source
|
||||||
|
.fromInputStream(getClass.getResourceAsStream("/eu/dnetlib/doiboost/crossref/s41567-022-01757-y.json"))
|
||||||
|
.mkString
|
||||||
val result = Crossref2Oaf.convert(json)
|
val result = Crossref2Oaf.convert(json)
|
||||||
result.filter(o => o.isInstanceOf[Publication]).map(p=> p.asInstanceOf[Publication]).foreach(p =>assertTrue(p.getAuthor.size()>0))
|
result
|
||||||
|
.filter(o => o.isInstanceOf[Publication])
|
||||||
|
.map(p => p.asInstanceOf[Publication])
|
||||||
|
.foreach(p => assertTrue(p.getAuthor.size() > 0))
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
|
@ -1293,6 +1293,7 @@ class MappersTest {
|
||||||
p.getInstance().get(0).getAlternateIdentifier().forEach(x -> System.out.println(x.getValue()));
|
p.getInstance().get(0).getAlternateIdentifier().forEach(x -> System.out.println(x.getValue()));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void testNotWellFormed() throws IOException {
|
void testNotWellFormed() throws IOException {
|
||||||
final String xml = IOUtils
|
final String xml = IOUtils
|
||||||
|
|
Loading…
Reference in New Issue