Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
lubitchv committed Dec 13, 2024
1 parent 1feeb22 commit 32de244
Show file tree
Hide file tree
Showing 3 changed files with 499 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,23 @@ public void testJson2DdiNoFiles() throws Exception {
XmlAssert.assertThat(result).and(datasetAsDdi).ignoreWhitespace().areSimilar();
}

@Test
public void testJson2DdiNoFilesTermsOfUse() throws Exception {
// given
Path datasetVersionJson = Path.of("src/test/java/edu/harvard/iq/dataverse/export/ddi/dataset-finch-terms-of-use.json");
String datasetVersionAsJson = Files.readString(datasetVersionJson, StandardCharsets.UTF_8);
Path ddiFile = Path.of("src/test/java/edu/harvard/iq/dataverse/export/ddi/dataset-finch-terms-of-use.xml");
String datasetAsDdi = XmlPrinter.prettyPrintXml(Files.readString(ddiFile, StandardCharsets.UTF_8));
logger.fine(datasetAsDdi);

// when
String result = DdiExportUtil.datasetDtoAsJson2ddi(datasetVersionAsJson);
logger.fine(result);

// then
XmlAssert.assertThat(result).and(datasetAsDdi).ignoreWhitespace().areSimilar();
}

@Test
public void testExportDDI() throws Exception {
// given
Expand Down
Loading

0 comments on commit 32de244

Please sign in to comment.