diff --git a/src/test/java/eu/dnetlib/app/directindex/clients/ProjectClientTest.java b/src/test/java/eu/dnetlib/app/directindex/clients/ProjectClientTest.java new file mode 100644 index 0000000..bcee7e1 --- /dev/null +++ b/src/test/java/eu/dnetlib/app/directindex/clients/ProjectClientTest.java @@ -0,0 +1,39 @@ +package eu.dnetlib.app.directindex.clients; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; + +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +import eu.dnetlib.app.directindex.clients.ProjectClient.ProjectInfo; + +class ProjectClientTest { + + // Class Under test + private ProjectClient projectClient; + + @BeforeEach + public void initEach() { + projectClient = new ProjectClient(); + } + + @Test + void testResolveProjectLink() { + final ProjectInfo p = projectClient.resolveProjectLink("info:eu-repo/grantAgreement/EC/FP7/244909/EU/Making Capabilities Work/WorkAble"); + + assertNotNull(p); + assertEquals("corda_______::0035b3243c4f8a19718a7848188215f8", p.getId()); + assertEquals("244909", p.getCode()); + assertEquals("WorkAble", p.getAcronym()); + assertEquals("Making Capabilities Work", p.getTitle()); + assertEquals("ec__________::EC", p.getFunderId()); + assertEquals("European Commission", p.getFunderName()); + assertEquals("EC", p.getFunderShortName()); + assertEquals("ec__________::EC::FP7", p.getFundingId()); + assertEquals("FP7", p.getFundingName()); + assertEquals("EU", p.getJurisdiction()); + + } + +}