From 2740b95f99ed5ea254ea67a9a9e07e7918c1417b Mon Sep 17 00:00:00 2001 From: "miriam.baglioni" Date: Mon, 21 Jun 2021 09:16:05 +0200 Subject: [PATCH] - --- .../dhp/ircdl_extention/WrongOrcidTest.java | 90 +++++++++++++++++++ 1 file changed, 90 insertions(+) diff --git a/dhp-workflows/dhp-aggregation/src/test/java/eu/dnetlib/dhp/ircdl_extention/WrongOrcidTest.java b/dhp-workflows/dhp-aggregation/src/test/java/eu/dnetlib/dhp/ircdl_extention/WrongOrcidTest.java index 873a0aafce..b5cc6787d5 100644 --- a/dhp-workflows/dhp-aggregation/src/test/java/eu/dnetlib/dhp/ircdl_extention/WrongOrcidTest.java +++ b/dhp-workflows/dhp-aggregation/src/test/java/eu/dnetlib/dhp/ircdl_extention/WrongOrcidTest.java @@ -1,5 +1,95 @@ package eu.dnetlib.dhp.ircdl_extention; +import java.util.ArrayList; +import java.util.Arrays; + +import org.apache.neethi.Assertion; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; + +import eu.dnetlib.dhp.ircdl_extention.model.Orcid; +import eu.dnetlib.dhp.ircdl_extention.model.Result; +import scala.Tuple2; + public class WrongOrcidTest { + + @Test + public void wrongOrcidFalse() throws Exception { + Assertions + .assertTrue( + Utils + .filterFunction( + new Tuple2<>(Result.newInstance("veigas pires cristina"), + Orcid + .newInstance( + "cristina", "veiga pires", "c veiga pires", + Arrays.asList("c c veiga pires"))))); + + } + + @Test + public void wrongOrcidFalse2() throws Exception { + Assertions + .assertTrue( + Utils + .filterFunction( + new Tuple2<>(Result.newInstance("yushkevich p"), + Orcid + .newInstance( + "paul", "yushkevich", "paul a yushkevich", + new ArrayList<>())))); + + } + + @Test + public void wrongOrcidFalse3() throws Exception { + Assertions + .assertTrue( + Utils + .filterFunction( + new Tuple2<>(Result.newInstance("ghosh ss"), + Orcid + .newInstance( + "satrajit", "ghosh", + "satra", + Arrays.asList("satra","satrajit s ghosh"))))); + + } + + @Test + public void wrongOrcidTrue() throws Exception { + Assertions + .assertFalse( + Utils + .filterFunction( + new Tuple2<>(Result.newInstance("kluft lukas"), + Orcid + .newInstance( + "satrajit", "ghosh", + "satra", + Arrays.asList("satra","satrajit s ghosh"))))); + + } + + @Test + public void wrongOrcidFalse4() throws Exception { + Assertions + .assertTrue( + Utils + .filterFunction( + new Tuple2<>(Result.newInstance("schulz s a"), + Orcid + .newInstance( + "sebastian", "schulz", + "sebastian a schulz", + new ArrayList<>())))); + + } + + + + + + }