diff --git a/dhp-workflows/dhp-doiboost/src/test/java/eu/dnetlib/doiboost/orcid/MappingORCIDToOAFTest.scala b/dhp-workflows/dhp-doiboost/src/test/java/eu/dnetlib/doiboost/orcid/MappingORCIDToOAFTest.scala index cdda3b2af8..7628fb8535 100644 --- a/dhp-workflows/dhp-doiboost/src/test/java/eu/dnetlib/doiboost/orcid/MappingORCIDToOAFTest.scala +++ b/dhp-workflows/dhp-doiboost/src/test/java/eu/dnetlib/doiboost/orcid/MappingORCIDToOAFTest.scala @@ -12,6 +12,8 @@ import org.slf4j.{Logger, LoggerFactory} import java.nio.file.Path import scala.io.Source +import scala.collection.JavaConversions._ + class MappingORCIDToOAFTest { val logger: Logger = LoggerFactory.getLogger(ORCIDToOAF.getClass) val mapper = new ObjectMapper() @@ -63,9 +65,26 @@ class MappingORCIDToOAFTest { } + @Test + def testExtractDat1():Unit ={ + val aList: List[OrcidAuthor] = List(OrcidAuthor("0000-0002-4335-5309", Some("Lucrecia"), Some("Curto"), null, null, null ), + OrcidAuthor("0000-0001-7501-3330", Some("Emilio"), Some("Malchiodi"), null, null, null ), OrcidAuthor("0000-0002-5490-9186", Some("Sofia"), Some("Noli Truant"), null, null, null )) + + val orcid:ORCIDItem = ORCIDItem("10.1042/BCJ20160876", aList) + + val oaf = ORCIDToOAF.convertTOOAF(orcid) + assert(oaf.getPid.size() == 1) + oaf.getPid.toList.foreach(pid => assert(pid.getQualifier.getClassid.equals("doi"))) + oaf.getPid.toList.foreach(pid => assert(pid.getValue.equals("10.1042/BCJ20160876".toLowerCase()))) + //println(mapper.writeValueAsString(ORCIDToOAF.convertTOOAF(orcid))) + + + } + + }