From 7d806a434c548ab28eaba20c05145d0ce466a804 Mon Sep 17 00:00:00 2001 From: "sandro.labruzzo" Date: Wed, 28 Feb 2024 09:31:58 +0100 Subject: [PATCH] formatted code --- .../collection/orcid/OrcidGetUpdatesFile.java | 1 - .../doiboost/crossref/CrossrefMappingTest.scala | 11 ++++++++--- .../src/main/java/eu/dnetlib/dhp/MoveResult.java | 2 +- .../raw/CopyHdfsOafSparkApplicationTest.java | 16 ++++++++-------- .../eu/dnetlib/dhp/oa/graph/raw/MappersTest.java | 1 + .../dhp/oa/provision/XmlRecordFactoryTest.java | 8 ++++---- 6 files changed, 22 insertions(+), 17 deletions(-) diff --git a/dhp-workflows/dhp-aggregation/src/main/java/eu/dnetlib/dhp/collection/orcid/OrcidGetUpdatesFile.java b/dhp-workflows/dhp-aggregation/src/main/java/eu/dnetlib/dhp/collection/orcid/OrcidGetUpdatesFile.java index eb23a204f1..d9afd0796f 100644 --- a/dhp-workflows/dhp-aggregation/src/main/java/eu/dnetlib/dhp/collection/orcid/OrcidGetUpdatesFile.java +++ b/dhp-workflows/dhp-aggregation/src/main/java/eu/dnetlib/dhp/collection/orcid/OrcidGetUpdatesFile.java @@ -156,7 +156,6 @@ public class OrcidGetUpdatesFile { } }); - } } diff --git a/dhp-workflows/dhp-doiboost/src/test/scala/eu/dnetlib/dhp/doiboost/crossref/CrossrefMappingTest.scala b/dhp-workflows/dhp-doiboost/src/test/scala/eu/dnetlib/dhp/doiboost/crossref/CrossrefMappingTest.scala index c27cebf65a..9bf1e1f53c 100644 --- a/dhp-workflows/dhp-doiboost/src/test/scala/eu/dnetlib/dhp/doiboost/crossref/CrossrefMappingTest.scala +++ b/dhp-workflows/dhp-doiboost/src/test/scala/eu/dnetlib/dhp/doiboost/crossref/CrossrefMappingTest.scala @@ -23,10 +23,15 @@ class CrossrefMappingTest { val mapper = new ObjectMapper() @Test - def testMissingAuthorParser():Unit = { - val json: String = Source.fromInputStream(getClass.getResourceAsStream("/eu/dnetlib/doiboost/crossref/s41567-022-01757-y.json")).mkString + def testMissingAuthorParser(): Unit = { + val json: String = Source + .fromInputStream(getClass.getResourceAsStream("/eu/dnetlib/doiboost/crossref/s41567-022-01757-y.json")) + .mkString 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 diff --git a/dhp-workflows/dhp-enrichment/src/main/java/eu/dnetlib/dhp/MoveResult.java b/dhp-workflows/dhp-enrichment/src/main/java/eu/dnetlib/dhp/MoveResult.java index c71ccb4391..6731f2332b 100644 --- a/dhp-workflows/dhp-enrichment/src/main/java/eu/dnetlib/dhp/MoveResult.java +++ b/dhp-workflows/dhp-enrichment/src/main/java/eu/dnetlib/dhp/MoveResult.java @@ -30,7 +30,7 @@ public class MoveResult implements Serializable { public static void main(String[] args) throws Exception { String jsonConfiguration = IOUtils .toString( - MoveResult.class + MoveResult.class .getResourceAsStream( "/eu/dnetlib/dhp/wf/subworkflows/input_moveresult_parameters.json")); diff --git a/dhp-workflows/dhp-graph-mapper/src/test/java/eu/dnetlib/dhp/oa/graph/raw/CopyHdfsOafSparkApplicationTest.java b/dhp-workflows/dhp-graph-mapper/src/test/java/eu/dnetlib/dhp/oa/graph/raw/CopyHdfsOafSparkApplicationTest.java index 1f55593778..3c6fc9c7fc 100644 --- a/dhp-workflows/dhp-graph-mapper/src/test/java/eu/dnetlib/dhp/oa/graph/raw/CopyHdfsOafSparkApplicationTest.java +++ b/dhp-workflows/dhp-graph-mapper/src/test/java/eu/dnetlib/dhp/oa/graph/raw/CopyHdfsOafSparkApplicationTest.java @@ -64,14 +64,14 @@ public class CopyHdfsOafSparkApplicationTest { @Test void isOafType_Datacite_ORP() throws IOException { assertTrue( - CopyHdfsOafSparkApplication - .isOafType( - IOUtils - .toString( - getClass() - .getResourceAsStream( - "/eu/dnetlib/dhp/oa/graph/raw/datacite_orp.json")), - "otherresearchproduct")); + CopyHdfsOafSparkApplication + .isOafType( + IOUtils + .toString( + getClass() + .getResourceAsStream( + "/eu/dnetlib/dhp/oa/graph/raw/datacite_orp.json")), + "otherresearchproduct")); } } diff --git a/dhp-workflows/dhp-graph-mapper/src/test/java/eu/dnetlib/dhp/oa/graph/raw/MappersTest.java b/dhp-workflows/dhp-graph-mapper/src/test/java/eu/dnetlib/dhp/oa/graph/raw/MappersTest.java index a6bbd30cff..405f91b9f1 100644 --- a/dhp-workflows/dhp-graph-mapper/src/test/java/eu/dnetlib/dhp/oa/graph/raw/MappersTest.java +++ b/dhp-workflows/dhp-graph-mapper/src/test/java/eu/dnetlib/dhp/oa/graph/raw/MappersTest.java @@ -1293,6 +1293,7 @@ class MappersTest { p.getInstance().get(0).getAlternateIdentifier().forEach(x -> System.out.println(x.getValue())); } + @Test void testNotWellFormed() throws IOException { final String xml = IOUtils diff --git a/dhp-workflows/dhp-graph-provision/src/test/java/eu/dnetlib/dhp/oa/provision/XmlRecordFactoryTest.java b/dhp-workflows/dhp-graph-provision/src/test/java/eu/dnetlib/dhp/oa/provision/XmlRecordFactoryTest.java index ef6370bf3a..ba9572b173 100644 --- a/dhp-workflows/dhp-graph-provision/src/test/java/eu/dnetlib/dhp/oa/provision/XmlRecordFactoryTest.java +++ b/dhp-workflows/dhp-graph-provision/src/test/java/eu/dnetlib/dhp/oa/provision/XmlRecordFactoryTest.java @@ -249,12 +249,12 @@ public class XmlRecordFactoryTest { final ContextMapper contextMapper = new ContextMapper(); final XmlRecordFactory xmlRecordFactory = new XmlRecordFactory(contextMapper, false, - XmlConverterJob.schemaLocation); + XmlConverterJob.schemaLocation); final Publication p = OBJECT_MAPPER - .readValue( - IOUtils.toString(getClass().getResourceAsStream("iris-odf-4.json")), - Publication.class); + .readValue( + IOUtils.toString(getClass().getResourceAsStream("iris-odf-4.json")), + Publication.class); final String xml = xmlRecordFactory.build(new JoinedEntity<>(p));