Make the tests compilable

This commit is contained in:
Sandro La Bruzzo 2023-05-10 09:05:23 +02:00
parent 706631586b
commit 883dcd910e
4 changed files with 15 additions and 18 deletions

View File

@ -15,7 +15,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
public class MdStoreClientTest {
@Test
public void testMongoCollection() throws IOException {
final MdstoreClient client = new MdstoreClient("mongodb://localhost:27017", "mdstore");

View File

@ -1,25 +1,21 @@
package eu.dnetlib.dhp.common.vocabulary;
import static org.mockito.Mockito.lenient;
import java.io.IOException;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import eu.dnetlib.dhp.schema.oaf.Qualifier;
import eu.dnetlib.enabling.is.lookup.rmi.ISLookUpException;
import eu.dnetlib.enabling.is.lookup.rmi.ISLookUpService;
import org.apache.commons.io.IOUtils;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.Mock;
import org.mockito.junit.jupiter.MockitoExtension;
import eu.dnetlib.dhp.schema.oaf.Qualifier;
import eu.dnetlib.enabling.is.lookup.rmi.ISLookUpException;
import eu.dnetlib.enabling.is.lookup.rmi.ISLookUpService;
import java.io.IOException;
import java.util.List;
import java.util.Objects;
import static org.mockito.Mockito.lenient;
@ExtendWith(MockitoExtension.class)
public class VocabularyTest {
@ -69,11 +65,12 @@ public class VocabularyTest {
} else {
System.out.println("syn=" + s1 + " term = " + t1.getClassid() + " " + t1.getClassname());
Qualifier synonymAsQualifier = vocabularies.getSynonymAsQualifier("dnet:result_typologies", t1.getClassid());
if (synonymAsQualifier!= null)
System.out
.println(
vocabularies.getSynonymAsQualifier("dnet:result_typologies", t1.getClassid()).getClassname());
synonymAsQualifier.getClassname());
}
}
}
}

View File

@ -50,7 +50,7 @@
"pid": []
}
],
"resulttype": "other",
"resulttype": "otherresearchproduct",
"language": {
"classid": "UNKNOWN",
"classname": "Unknown",

View File

@ -639,9 +639,9 @@ object DataciteToOAFTransformation {
Relation.RELCLASS.exists(r.relationType) && validIdentifiersInRelation(r.relatedIdentifierType)
)
.map(r => {
val subRelType = Relation.SUBRELTYPE.valueOf(r.relationType)
val rc = Relation.RELCLASS.valueOf(r.relationType)
val target = DHPUtils.generateUnresolvedIdentifier(r.relatedIdentifier, r.relatedIdentifierType)
relation(id, target, subRelType, Relation.RELCLASS.valueOf(r.relationType), date)
relation(id, target, rc.getSubRel, rc, date)
})
val citationRels: List[Relation] = rels
.filter(r =>validIdentifiersInRelation(r.relatedIdentifierType) &&