@Test public void testCreateVernacularName() { CSVRecordInfo<CoLVernacularNameCsvField> csvRecordInfo = mock(CSVRecordInfo.class); when(csvRecordInfo.get(CoLVernacularNameCsvField.taxonID)).thenReturn("6931870"); when(csvRecordInfo.get(CoLVernacularNameCsvField.vernacularName)).thenReturn("pinhead spot"); when(csvRecordInfo.get(CoLVernacularNameCsvField.language)).thenReturn("English US"); when(csvRecordInfo.get(CoLVernacularNameCsvField.countryCode)).thenReturn("USA"); when(csvRecordInfo.get(CoLVernacularNameCsvField.locality)).thenReturn(""); when(csvRecordInfo.get(CoLVernacularNameCsvField.transliteration)).thenReturn(""); Object returned = ReflectionUtil.callStatic(CoLVernacularNameBatchTransformer.class, "createVernacularName", new Class[] {CSVRecordInfo.class}, new Object[] {csvRecordInfo}); VernacularName actual = (VernacularName) returned; String expectedVenecularName = "pinhead spot"; String expectedLangauge = "English US"; assertNotNull("01",actual); assertEquals("02",expectedVenecularName, actual.getName()); assertEquals("03",expectedLangauge, actual.getLanguage()); }
private static VernacularName createVernacularName( CSVRecordInfo<CoLVernacularNameCsvField> input) { VernacularName vn = new VernacularName(); vn.setName(input.get(vernacularName)); vn.setLanguage(input.get(language)); return vn; }
CoLVernacularNameBatchTransformer { private static VernacularName createVernacularName( CSVRecordInfo<CoLVernacularNameCsvField> input) { VernacularName vn = new VernacularName(); vn.setName(input.get(vernacularName)); vn.setLanguage(input.get(language)); return vn; } }
CoLVernacularNameBatchTransformer { private static VernacularName createVernacularName( CSVRecordInfo<CoLVernacularNameCsvField> input) { VernacularName vn = new VernacularName(); vn.setName(input.get(vernacularName)); vn.setLanguage(input.get(language)); return vn; } CoLVernacularNameBatchTransformer(); }
CoLVernacularNameBatchTransformer { private static VernacularName createVernacularName( CSVRecordInfo<CoLVernacularNameCsvField> input) { VernacularName vn = new VernacularName(); vn.setName(input.get(vernacularName)); vn.setLanguage(input.get(language)); return vn; } CoLVernacularNameBatchTransformer();  }
CoLVernacularNameBatchTransformer { private static VernacularName createVernacularName( CSVRecordInfo<CoLVernacularNameCsvField> input) { VernacularName vn = new VernacularName(); vn.setName(input.get(vernacularName)); vn.setLanguage(input.get(language)); return vn; } CoLVernacularNameBatchTransformer();   }