Make the tests compilable
This commit is contained in:
parent
706631586b
commit
883dcd910e
|
@ -15,7 +15,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
|
||||||
public class MdStoreClientTest {
|
public class MdStoreClientTest {
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testMongoCollection() throws IOException {
|
public void testMongoCollection() throws IOException {
|
||||||
final MdstoreClient client = new MdstoreClient("mongodb://localhost:27017", "mdstore");
|
final MdstoreClient client = new MdstoreClient("mongodb://localhost:27017", "mdstore");
|
||||||
|
|
||||||
|
|
|
@ -1,25 +1,21 @@
|
||||||
|
|
||||||
package eu.dnetlib.dhp.common.vocabulary;
|
package eu.dnetlib.dhp.common.vocabulary;
|
||||||
|
|
||||||
import static org.mockito.Mockito.lenient;
|
import eu.dnetlib.dhp.schema.oaf.Qualifier;
|
||||||
|
import eu.dnetlib.enabling.is.lookup.rmi.ISLookUpException;
|
||||||
import java.io.IOException;
|
import eu.dnetlib.enabling.is.lookup.rmi.ISLookUpService;
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Objects;
|
|
||||||
|
|
||||||
import org.apache.commons.io.IOUtils;
|
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.BeforeEach;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.junit.jupiter.api.extension.ExtendWith;
|
import org.junit.jupiter.api.extension.ExtendWith;
|
||||||
import org.mockito.Mock;
|
import org.mockito.Mock;
|
||||||
import org.mockito.junit.jupiter.MockitoExtension;
|
import org.mockito.junit.jupiter.MockitoExtension;
|
||||||
|
|
||||||
import eu.dnetlib.dhp.schema.oaf.Qualifier;
|
import java.io.IOException;
|
||||||
import eu.dnetlib.enabling.is.lookup.rmi.ISLookUpException;
|
import java.util.List;
|
||||||
import eu.dnetlib.enabling.is.lookup.rmi.ISLookUpService;
|
import java.util.Objects;
|
||||||
|
|
||||||
|
import static org.mockito.Mockito.lenient;
|
||||||
|
|
||||||
@ExtendWith(MockitoExtension.class)
|
@ExtendWith(MockitoExtension.class)
|
||||||
public class VocabularyTest {
|
public class VocabularyTest {
|
||||||
|
@ -69,11 +65,12 @@ public class VocabularyTest {
|
||||||
} else {
|
} else {
|
||||||
System.out.println("syn=" + s1 + " term = " + t1.getClassid() + " " + t1.getClassname());
|
System.out.println("syn=" + s1 + " term = " + t1.getClassid() + " " + t1.getClassname());
|
||||||
|
|
||||||
|
Qualifier synonymAsQualifier = vocabularies.getSynonymAsQualifier("dnet:result_typologies", t1.getClassid());
|
||||||
|
if (synonymAsQualifier!= null)
|
||||||
System.out
|
System.out
|
||||||
.println(
|
.println(
|
||||||
vocabularies.getSynonymAsQualifier("dnet:result_typologies", t1.getClassid()).getClassname());
|
synonymAsQualifier.getClassname());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,7 +50,7 @@
|
||||||
"pid": []
|
"pid": []
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"resulttype": "other",
|
"resulttype": "otherresearchproduct",
|
||||||
"language": {
|
"language": {
|
||||||
"classid": "UNKNOWN",
|
"classid": "UNKNOWN",
|
||||||
"classname": "Unknown",
|
"classname": "Unknown",
|
||||||
|
|
|
@ -639,9 +639,9 @@ object DataciteToOAFTransformation {
|
||||||
Relation.RELCLASS.exists(r.relationType) && validIdentifiersInRelation(r.relatedIdentifierType)
|
Relation.RELCLASS.exists(r.relationType) && validIdentifiersInRelation(r.relatedIdentifierType)
|
||||||
)
|
)
|
||||||
.map(r => {
|
.map(r => {
|
||||||
val subRelType = Relation.SUBRELTYPE.valueOf(r.relationType)
|
val rc = Relation.RELCLASS.valueOf(r.relationType)
|
||||||
val target = DHPUtils.generateUnresolvedIdentifier(r.relatedIdentifier, r.relatedIdentifierType)
|
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
|
val citationRels: List[Relation] = rels
|
||||||
.filter(r =>validIdentifiersInRelation(r.relatedIdentifierType) &&
|
.filter(r =>validIdentifiersInRelation(r.relatedIdentifierType) &&
|
||||||
|
|
Loading…
Reference in New Issue