@Test public void testGetTaxonomicStatus() { TaxonomicStatus actual = null; Object returned = null; ETLStatistics etlStatistics = new ETLStatistics(); NsrTaxonTransformer nsrTaxonTransformer = new NsrTaxonTransformer(etlStatistics); Name name = nsrTaxa.get(0).getNames()[0]; returned = ReflectionUtil.call(nsrTaxonTransformer, "getTaxonomicStatus", new Class[]{Name.class}, new Object[]{name}); actual = (TaxonomicStatus) returned; String expectedDateString = "accepted name"; assertNotNull("01", actual); assertEquals("02", expectedDateString, actual.toString()); }
private TaxonomicStatus getTaxonomicStatus(Name name) { String nameType = val(name.getNametype()); if (nameType == null) { stats.recordsRejected++; if (!suppressErrors) error("Record rejected! Missing or empty <nametype> for name: " + val(name.getFullname())); return null; } TaxonomicStatus status = translations.get(nameType); if (status == null) { stats.recordsRejected++; if (!suppressErrors) error("Record rejected! Invalid taxonomic status: " + nameType); return null; } return status; }
NsrTaxonTransformer extends AbstractJSONTransformer<Taxon> { private TaxonomicStatus getTaxonomicStatus(Name name) { String nameType = val(name.getNametype()); if (nameType == null) { stats.recordsRejected++; if (!suppressErrors) error("Record rejected! Missing or empty <nametype> for name: " + val(name.getFullname())); return null; } TaxonomicStatus status = translations.get(nameType); if (status == null) { stats.recordsRejected++; if (!suppressErrors) error("Record rejected! Invalid taxonomic status: " + nameType); return null; } return status; } }
NsrTaxonTransformer extends AbstractJSONTransformer<Taxon> { private TaxonomicStatus getTaxonomicStatus(Name name) { String nameType = val(name.getNametype()); if (nameType == null) { stats.recordsRejected++; if (!suppressErrors) error("Record rejected! Missing or empty <nametype> for name: " + val(name.getFullname())); return null; } TaxonomicStatus status = translations.get(nameType); if (status == null) { stats.recordsRejected++; if (!suppressErrors) error("Record rejected! Invalid taxonomic status: " + nameType); return null; } return status; } NsrTaxonTransformer(ETLStatistics stats); }
NsrTaxonTransformer extends AbstractJSONTransformer<Taxon> { private TaxonomicStatus getTaxonomicStatus(Name name) { String nameType = val(name.getNametype()); if (nameType == null) { stats.recordsRejected++; if (!suppressErrors) error("Record rejected! Missing or empty <nametype> for name: " + val(name.getFullname())); return null; } TaxonomicStatus status = translations.get(nameType); if (status == null) { stats.recordsRejected++; if (!suppressErrors) error("Record rejected! Invalid taxonomic status: " + nameType); return null; } return status; } NsrTaxonTransformer(ETLStatistics stats);  }
NsrTaxonTransformer extends AbstractJSONTransformer<Taxon> { private TaxonomicStatus getTaxonomicStatus(Name name) { String nameType = val(name.getNametype()); if (nameType == null) { stats.recordsRejected++; if (!suppressErrors) error("Record rejected! Missing or empty <nametype> for name: " + val(name.getFullname())); return null; } TaxonomicStatus status = translations.get(nameType); if (status == null) { stats.recordsRejected++; if (!suppressErrors) error("Record rejected! Invalid taxonomic status: " + nameType); return null; } return status; } NsrTaxonTransformer(ETLStatistics stats);   }