Skip to content

Commit

Permalink
#2734 add orig file name to json printer test
Browse files Browse the repository at this point in the history
  • Loading branch information
sekmiller committed Mar 26, 2020
1 parent 1ed9ed1 commit 07f208b
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import edu.harvard.iq.dataverse.DataFile;
import edu.harvard.iq.dataverse.DataFileCategory;
import edu.harvard.iq.dataverse.DataFileTag;
import edu.harvard.iq.dataverse.DataTable;
import edu.harvard.iq.dataverse.Dataset;
import edu.harvard.iq.dataverse.DatasetField;
import edu.harvard.iq.dataverse.DatasetFieldCompoundValue;
Expand Down Expand Up @@ -154,6 +155,9 @@ public void testGetFileCategories() {
tag.setTypeByLabel("Survey");
dataFileTags.add(tag);
dataFile.setTags(dataFileTags);
DataTable dt = new DataTable();
dataFile.setDataTable(dt);
dataFile.getDataTable().setOriginalFileName("50by1000.dta");
fmd.setDatasetVersion(dsVersion);
fmd.setDataFile(dataFile);
List<DataFileCategory> fileCategories = new ArrayList<>();
Expand All @@ -171,6 +175,7 @@ public void testGetFileCategories() {
assertEquals("", jsonObject.getJsonObject("dataFile").getString("filename"));
assertEquals(-1, jsonObject.getJsonObject("dataFile").getInt("filesize"));
assertEquals(-1, jsonObject.getJsonObject("dataFile").getInt("rootDataFileId"));
assertEquals("50by1000.dta", jsonObject.getJsonObject("dataFile").getString("originalFileName"));
assertEquals("Survey", jsonObject.getJsonObject("dataFile").getJsonArray("tabularTags").getString(0));
}

Expand Down

0 comments on commit 07f208b

Please sign in to comment.