@Test public void testGetScientificName() throws Exception { CSVRecordInfo<CoLTaxonCsvField> record = mock(CSVRecordInfo.class); ETLStatistics etlStatistics = new ETLStatistics(); when(record.get(CoLTaxonCsvField.taxonID)).thenReturn("6931872"); when(record.get(CoLTaxonCsvField.identifier)).thenReturn("urn:lsid:catalogueoflife.org:taxon:6703cbb5-e478-11e5-86e7-bc764e092680:col20150315"); when(record.get(CoLTaxonCsvField.datasetID)).thenReturn("67"); when(record.get(CoLTaxonCsvField.datasetName)).thenReturn("ITIS Bees in Species 2000 & ITIS Catalogue of Life: 23rd March 2016"); when(record.get(CoLTaxonCsvField.acceptedNameUsageID)).thenReturn("test_acceptedNameUsageID"); when(record.get(CoLTaxonCsvField.parentNameUsageID)).thenReturn("27000241"); when(record.get(CoLTaxonCsvField.taxonomicStatus)).thenReturn("accepted name"); when(record.get(CoLTaxonCsvField.taxonRank)).thenReturn("species"); when(record.get(CoLTaxonCsvField.verbatimTaxonRank)).thenReturn("test_verbatimTaxonRank"); when(record.get(CoLTaxonCsvField.scientificName)).thenReturn("Bombus affinis Cresson, 1863"); when(record.get(CoLTaxonCsvField.kingdom)).thenReturn("Animalia"); when(record.get(CoLTaxonCsvField.phylum)).thenReturn("Arthropoda"); when(record.get(CoLTaxonCsvField.classRank)).thenReturn("Insecta"); when(record.get(CoLTaxonCsvField.family)).thenReturn("Apidae"); when(record.get(CoLTaxonCsvField.superfamily)).thenReturn("Apoidea"); when(record.get(CoLTaxonCsvField.genericName)).thenReturn("Bombus"); when(record.get(CoLTaxonCsvField.subgenus)).thenReturn("test_subgenus"); when(record.get(CoLTaxonCsvField.specificEpithet)).thenReturn("affinis"); when(record.get(CoLTaxonCsvField.infraspecificEpithet)).thenReturn("test_infraspecificEpithet"); when(record.get(CoLTaxonCsvField.scientificNameAuthorship)).thenReturn("Cresson, 1863"); when(record.get(CoLTaxonCsvField.source)).thenReturn("test_source"); when(record.get(CoLTaxonCsvField.namePublishedIn)).thenReturn("test_namePublishedIn"); when(record.get(CoLTaxonCsvField.nameAccordingTo)).thenReturn("test_nameAccordingTo"); when(record.get(CoLTaxonCsvField.modified)).thenReturn("30-Sep-2008"); when(record.get(CoLTaxonCsvField.description)).thenReturn("test_desc"); when(record.get(CoLTaxonCsvField.taxonConceptID)).thenReturn("test_taxonConceptID"); when(record.get(CoLTaxonCsvField.scientificNameID)).thenReturn("ITS-714782"); when(record.get(CoLTaxonCsvField.references)).thenReturn("https: CoLTaxonTransformer coLTaxonTransformer = new CoLTaxonTransformer(etlStatistics); CommonReflectionUtil.setField(AbstractTransformer.class, coLTaxonTransformer, "objectID", "6931872"); CommonReflectionUtil.setField(AbstractTransformer.class, coLTaxonTransformer, "input", record); Object returned = ReflectionUtil.call(coLTaxonTransformer, "getScientificName", new Class[] {}, new Object[] {}); ScientificName name = (ScientificName) returned; ScientificName expected = new ScientificName(); expected.setFullScientificName("Bombus affinis Cresson, 1863"); expected.setGenusOrMonomial("Bombus"); expected.setSubgenus("test_subgenus"); expected.setSpecificEpithet("affinis"); expected.setInfraspecificEpithet("test_infraspecificEpithet"); expected.setAuthorshipVerbatim("Cresson, 1863"); expected.setTaxonomicStatus(TaxonomicStatus.ACCEPTED_NAME); expected.setScientificNameGroup("bombus affinis test_infraspecificepithet"); assertNotNull("01", returned); assertEquals("02", expected.getFullScientificName(), name.getFullScientificName()); assertEquals("03", expected.getGenusOrMonomial(), name.getGenusOrMonomial()); assertEquals("04", expected.getSubgenus(), name.getSubgenus()); assertEquals("05", expected.getSpecificEpithet(), name.getSpecificEpithet()); assertEquals("06", expected.getInfraspecificEpithet(), name.getInfraspecificEpithet()); assertEquals("07", expected.getAuthorshipVerbatim(), name.getAuthorshipVerbatim()); assertEquals("08", expected.getTaxonomicStatus(), name.getTaxonomicStatus()); assertEquals("09", expected.getScientificNameGroup(), name.getScientificNameGroup()); }
private ScientificName getScientificName() { ScientificName sn = new ScientificName(); sn.setFullScientificName(input.get(scientificName)); sn.setGenusOrMonomial(input.get(genericName)); sn.setSubgenus(input.get(subgenus)); sn.setSpecificEpithet(input.get(specificEpithet)); sn.setInfraspecificEpithet(input.get(infraspecificEpithet)); sn.setAuthorshipVerbatim(input.get(scientificNameAuthorship)); sn.setTaxonomicStatus(TaxonomicStatus.ACCEPTED_NAME); TransformUtil.setScientificNameGroup(sn); return sn; }
CoLTaxonTransformer extends AbstractCSVTransformer<CoLTaxonCsvField, Taxon> { private ScientificName getScientificName() { ScientificName sn = new ScientificName(); sn.setFullScientificName(input.get(scientificName)); sn.setGenusOrMonomial(input.get(genericName)); sn.setSubgenus(input.get(subgenus)); sn.setSpecificEpithet(input.get(specificEpithet)); sn.setInfraspecificEpithet(input.get(infraspecificEpithet)); sn.setAuthorshipVerbatim(input.get(scientificNameAuthorship)); sn.setTaxonomicStatus(TaxonomicStatus.ACCEPTED_NAME); TransformUtil.setScientificNameGroup(sn); return sn; } }
CoLTaxonTransformer extends AbstractCSVTransformer<CoLTaxonCsvField, Taxon> { private ScientificName getScientificName() { ScientificName sn = new ScientificName(); sn.setFullScientificName(input.get(scientificName)); sn.setGenusOrMonomial(input.get(genericName)); sn.setSubgenus(input.get(subgenus)); sn.setSpecificEpithet(input.get(specificEpithet)); sn.setInfraspecificEpithet(input.get(infraspecificEpithet)); sn.setAuthorshipVerbatim(input.get(scientificNameAuthorship)); sn.setTaxonomicStatus(TaxonomicStatus.ACCEPTED_NAME); TransformUtil.setScientificNameGroup(sn); return sn; } CoLTaxonTransformer(ETLStatistics stats); }
CoLTaxonTransformer extends AbstractCSVTransformer<CoLTaxonCsvField, Taxon> { private ScientificName getScientificName() { ScientificName sn = new ScientificName(); sn.setFullScientificName(input.get(scientificName)); sn.setGenusOrMonomial(input.get(genericName)); sn.setSubgenus(input.get(subgenus)); sn.setSpecificEpithet(input.get(specificEpithet)); sn.setInfraspecificEpithet(input.get(infraspecificEpithet)); sn.setAuthorshipVerbatim(input.get(scientificNameAuthorship)); sn.setTaxonomicStatus(TaxonomicStatus.ACCEPTED_NAME); TransformUtil.setScientificNameGroup(sn); return sn; } CoLTaxonTransformer(ETLStatistics stats);  }
CoLTaxonTransformer extends AbstractCSVTransformer<CoLTaxonCsvField, Taxon> { private ScientificName getScientificName() { ScientificName sn = new ScientificName(); sn.setFullScientificName(input.get(scientificName)); sn.setGenusOrMonomial(input.get(genericName)); sn.setSubgenus(input.get(subgenus)); sn.setSpecificEpithet(input.get(specificEpithet)); sn.setInfraspecificEpithet(input.get(infraspecificEpithet)); sn.setAuthorshipVerbatim(input.get(scientificNameAuthorship)); sn.setTaxonomicStatus(TaxonomicStatus.ACCEPTED_NAME); TransformUtil.setScientificNameGroup(sn); return sn; } CoLTaxonTransformer(ETLStatistics stats);   }