Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ public List<Map<String, Object>> processListData(List<BrAPIGermplasm> germplasm,

// Use the entry number in the list map if generated
if(new UUID(0,0).compareTo(germplasmListId) == 0) {
row.put("Entry No", germplasmEntry.getAdditionalInfo().get(BrAPIAdditionalInfoFields.GERMPLASM_IMPORT_ENTRY_NUMBER).getAsInt());
// Not downloading a real list, use GID (https://breedinginsight.atlassian.net/browse/BI-2266).
row.put("Entry No", Integer.valueOf(germplasmEntry.getAccessionNumber()));
} else {
row.put("Entry No", germplasmEntry.getAdditionalInfo()
.getAsJsonObject(BrAPIAdditionalInfoFields.GERMPLASM_LIST_ENTRY_NUMBERS).get(germplasmListId.toString()).getAsInt());
Expand Down Expand Up @@ -153,6 +154,7 @@ public List<BrAPIGermplasm> getGermplasmByList(UUID programId, String listDbId)
return germplasm;
} else throw new ApiException();
}

public DownloadFile exportGermplasm(UUID programId, FileType fileExtension) throws IllegalArgumentException, ApiException, IOException {
List<Column> columns = GermplasmFileColumns.getOrderedColumns();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,8 @@ public void getGermplasmListExport() {
assertEquals(expectedColumnNames, resultTable.columnNames(), "Incorrect columns were exported");
assertEquals(2, resultTable.rowCount(), "Wrong number of rows were exported");
assertEquals("Germplasm A", resultTable.get(0, 1), "Incorrect data exported");
assertEquals("2", resultTable.get(0, 6), "Incorrect data exported");
// Check that "GID" column matches "Entry No" for both (https://breedinginsight.atlassian.net/browse/BI-2266).
assertEquals(resultTable.get(0,0), resultTable.get(0, 6), "Incorrect data exported");
assertEquals(resultTable.get(1,0), resultTable.get(1, 6), "Incorrect data exported");
}
}