This commit is contained in:
Miriam Baglioni 2020-08-11 15:42:35 +02:00
parent a169d7e7c1
commit 7dfd56df9d
3 changed files with 7 additions and 6 deletions

View File

@ -1,12 +1,12 @@
package eu.dnetlib.dhp.oa.graph.dump; package eu.dnetlib.dhp.oa.graph.dump;
import eu.dnetlib.dhp.schema.dump.oaf.graph.*;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.JsonNode;
import com.github.victools.jsonschema.generator.*; import com.github.victools.jsonschema.generator.*;
import eu.dnetlib.dhp.schema.dump.oaf.community.CommunityResult;
public class GenerateJsonSchema { public class GenerateJsonSchema {
@ -19,7 +19,7 @@ public class GenerateJsonSchema {
configBuilder.forFields().withDescriptionResolver(field -> "Description of " + field.getDeclaredName()); configBuilder.forFields().withDescriptionResolver(field -> "Description of " + field.getDeclaredName());
SchemaGeneratorConfig config = configBuilder.build(); SchemaGeneratorConfig config = configBuilder.build();
SchemaGenerator generator = new SchemaGenerator(config); SchemaGenerator generator = new SchemaGenerator(config);
JsonNode jsonSchema = generator.generateSchema(CommunityResult.class); JsonNode jsonSchema = generator.generateSchema(Relation.class);
System.out.println(jsonSchema.toString()); System.out.println(jsonSchema.toString());
} }

View File

@ -1,3 +1,4 @@
package eu.dnetlib.dhp.oa.graph.dump; package eu.dnetlib.dhp.oa.graph.dump;
import java.io.IOException; import java.io.IOException;

View File

@ -22,7 +22,7 @@ public class ZenodoUploadTest {
private static String workingDir; private static String workingDir;
private final String URL_STRING = "https://sandbox.zenodo.org/api/deposit/depositions"; private final String URL_STRING = "https://sandbox.zenodo.org/api/deposit/depositions";
private final String ACCESS_TOKEN = "5ImUj0VC1ICg4ifK5dc3AGzJhcfAB4osxrFlsr8WxHXxjaYgCE0hY8HZcDoe"; private final String ACCESS_TOKEN = "";
@BeforeAll @BeforeAll
public static void beforeAll() throws IOException { public static void beforeAll() throws IOException {
@ -143,7 +143,7 @@ public class ZenodoUploadTest {
.println( .println(
new Gson() new Gson()
.toJson( .toJson(
SendToZenodoHDFS Utils
.readCommunityMap( .readCommunityMap(
fs, getClass() fs, getClass()
.getResource("/eu/dnetlib/dhp/oa/graph/dump/communityMapPath/communitymap.json") .getResource("/eu/dnetlib/dhp/oa/graph/dump/communityMapPath/communitymap.json")