diff --git a/src/main/groovy/au/org/ala/merit/GmsMapper.groovy b/src/main/groovy/au/org/ala/merit/GmsMapper.groovy index adffb0e67..48f2de7bf 100644 --- a/src/main/groovy/au/org/ala/merit/GmsMapper.groovy +++ b/src/main/groovy/au/org/ala/merit/GmsMapper.groovy @@ -26,7 +26,7 @@ class GmsMapper { static final REPORTING_THEME_COLUMN = 'PGAT_PRIORITY' static final FINANCIAL_YEAR_FUNDING_PREFIX = 'FUNDING_' - + static final FINANCIAL_YEAR_FUNDING_DESCRIPTION = "FINANCIAL_YEAR_FUNDING_DESCRIPTION" static MERIT_DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ") static final GMS_DATE_FORMAT = new SimpleDateFormat("dd/MM/yyyy") @@ -177,7 +177,7 @@ class GmsMapper { } } // Special case for MERI plan funding mapping - headers << "FINANCIAL_YEAR_FUNDING_DESCRIPTION" + headers << FINANCIAL_YEAR_FUNDING_DESCRIPTION descriptions << "Description of the funding for each financial year. Must be present for financial year funding amounts to be imported" for (int i : (18..30)) { @@ -199,7 +199,7 @@ class GmsMapper { mappingKeys.add(DATA_SUB_TYPE_COLUMN) mappingKeys.add(REPORTING_THEME_COLUMN) mappingKeys.add(FINANCIAL_YEAR_FUNDING_PREFIX) - mappingKeys.add("FINANCIAL_YEAR_FUNDING_DESCRIPTION") + mappingKeys.add(FINANCIAL_YEAR_FUNDING_DESCRIPTION) projectRows[0].keySet().each { key -> if (!key?.trim() || key == 'index') { diff --git a/src/test/groovy/au/org/ala/merit/GmsMapperSpec.groovy b/src/test/groovy/au/org/ala/merit/GmsMapperSpec.groovy index c23573a95..2ecd6d5e6 100644 --- a/src/test/groovy/au/org/ala/merit/GmsMapperSpec.groovy +++ b/src/test/groovy/au/org/ala/merit/GmsMapperSpec.groovy @@ -374,8 +374,9 @@ class GmsMapperSpec extends Specification{ then: "We are just checking every value in the spreadsheet is mappable and has a description" lines.size() == 4 + Map mappings = gmsMapper.projectMapping + gmsMapper.geographicInfoMapping lines[3].every {String value -> - gmsMapper.projectMapping[value].description != null + value == GmsMapper.FINANCIAL_YEAR_FUNDING_DESCRIPTION || value.startsWith(GmsMapper.FINANCIAL_YEAR_FUNDING_PREFIX) || mappings[value].description != null } }