master #59

Closed
claudio.atzori wants to merge 3221 commits from master into stable_ids
1 changed files with 20 additions and 17 deletions
Showing only changes of commit 2e1eb96f9a - Show all commits

View File

@ -1,10 +1,10 @@
package eu.dnetlib.dhp.oa.graph.raw; package eu.dnetlib.dhp.oa.graph.raw;
import com.mongodb.client.MongoDatabase; import java.io.IOException;
import eu.dnetlib.dhp.common.MdstoreClient; import java.nio.file.Files;
import io.fares.junit.mongodb.MongoExtension; import java.nio.file.Path;
import io.fares.junit.mongodb.MongoForAllExtension;
import org.apache.commons.io.IOUtils; import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.bson.Document; import org.bson.Document;
@ -16,9 +16,11 @@ import org.junit.jupiter.api.io.TempDir;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import java.io.IOException; import com.mongodb.client.MongoDatabase;
import java.nio.file.Files;
import java.nio.file.Path; import eu.dnetlib.dhp.common.MdstoreClient;
import io.fares.junit.mongodb.MongoExtension;
import io.fares.junit.mongodb.MongoForAllExtension;
public class MigrateMongoMdstoresApplicationTest { public class MigrateMongoMdstoresApplicationTest {
@ -38,7 +40,6 @@ public class MigrateMongoMdstoresApplicationTest {
db.getCollection("metadataManager").insertOne(Document.parse(read("mdstore_metadataManager.json"))); db.getCollection("metadataManager").insertOne(Document.parse(read("mdstore_metadataManager.json")));
} }
@Test @Test
public void test_MdstoreClient() throws IOException { public void test_MdstoreClient() throws IOException {
try (MdstoreClient client = new MdstoreClient(mongo.getMongoClient(), MongoExtension.UNIT_TEST_DB)) { try (MdstoreClient client = new MdstoreClient(mongo.getMongoClient(), MongoExtension.UNIT_TEST_DB)) {
@ -61,8 +62,10 @@ public class MigrateMongoMdstoresApplicationTest {
app.execute("oai_dc", "store", "native"); app.execute("oai_dc", "store", "native");
} }
Assertions.assertTrue( Assertions
Files.list(tmpPath) .assertTrue(
Files
.list(tmpPath)
.filter(f -> seqFile.contains(f.getFileName().toString())) .filter(f -> seqFile.contains(f.getFileName().toString()))
.findFirst() .findFirst()
.isPresent()); .isPresent());