forked from D-Net/dnet-hadoop
formatted code
This commit is contained in:
parent
e468e99100
commit
7d806a434c
|
@ -156,7 +156,6 @@ public class OrcidGetUpdatesFile {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -30,7 +30,7 @@ public class MoveResult implements Serializable {
|
||||||
public static void main(String[] args) throws Exception {
|
public static void main(String[] args) throws Exception {
|
||||||
String jsonConfiguration = IOUtils
|
String jsonConfiguration = IOUtils
|
||||||
.toString(
|
.toString(
|
||||||
MoveResult.class
|
MoveResult.class
|
||||||
.getResourceAsStream(
|
.getResourceAsStream(
|
||||||
"/eu/dnetlib/dhp/wf/subworkflows/input_moveresult_parameters.json"));
|
"/eu/dnetlib/dhp/wf/subworkflows/input_moveresult_parameters.json"));
|
||||||
|
|
||||||
|
|
|
@ -64,14 +64,14 @@ public class CopyHdfsOafSparkApplicationTest {
|
||||||
@Test
|
@Test
|
||||||
void isOafType_Datacite_ORP() throws IOException {
|
void isOafType_Datacite_ORP() throws IOException {
|
||||||
assertTrue(
|
assertTrue(
|
||||||
CopyHdfsOafSparkApplication
|
CopyHdfsOafSparkApplication
|
||||||
.isOafType(
|
.isOafType(
|
||||||
IOUtils
|
IOUtils
|
||||||
.toString(
|
.toString(
|
||||||
getClass()
|
getClass()
|
||||||
.getResourceAsStream(
|
.getResourceAsStream(
|
||||||
"/eu/dnetlib/dhp/oa/graph/raw/datacite_orp.json")),
|
"/eu/dnetlib/dhp/oa/graph/raw/datacite_orp.json")),
|
||||||
"otherresearchproduct"));
|
"otherresearchproduct"));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -249,12 +249,12 @@ public class XmlRecordFactoryTest {
|
||||||
final ContextMapper contextMapper = new ContextMapper();
|
final ContextMapper contextMapper = new ContextMapper();
|
||||||
|
|
||||||
final XmlRecordFactory xmlRecordFactory = new XmlRecordFactory(contextMapper, false,
|
final XmlRecordFactory xmlRecordFactory = new XmlRecordFactory(contextMapper, false,
|
||||||
XmlConverterJob.schemaLocation);
|
XmlConverterJob.schemaLocation);
|
||||||
|
|
||||||
final Publication p = OBJECT_MAPPER
|
final Publication p = OBJECT_MAPPER
|
||||||
.readValue(
|
.readValue(
|
||||||
IOUtils.toString(getClass().getResourceAsStream("iris-odf-4.json")),
|
IOUtils.toString(getClass().getResourceAsStream("iris-odf-4.json")),
|
||||||
Publication.class);
|
Publication.class);
|
||||||
|
|
||||||
final String xml = xmlRecordFactory.build(new JoinedEntity<>(p));
|
final String xml = xmlRecordFactory.build(new JoinedEntity<>(p));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue