@Test public void testGetCollectorsFieldNumber() throws Exception { CSVRecordInfo<BrahmsCsvField> record = mock(CSVRecordInfo.class); ETLStatistics etlStatistics = new ETLStatistics(); when(record.get(BrahmsCsvField.COLLECTOR, false)).thenReturn("Unknown "); when(record.get(BrahmsCsvField.PREFIX, false)).thenReturn(" "); when(record.get(BrahmsCsvField.NUMBER, false)).thenReturn("s.n. "); when(record.get(BrahmsCsvField.SUFFIX, false)).thenReturn(" "); BrahmsSpecimenTransformer brahmsSpecimenTransformer = new BrahmsSpecimenTransformer(etlStatistics); CommonReflectionUtil.setField(AbstractTransformer.class, brahmsSpecimenTransformer, "objectID", "L.3355550"); CommonReflectionUtil.setField(AbstractTransformer.class, brahmsSpecimenTransformer, "input", record); Object obj = CommonReflectionUtil.callMethod(null, CSVRecordInfo.class, brahmsSpecimenTransformer, "getCollectorsFieldNumber"); String actualCollectorsNumber = (String) obj; String expectedCollectionNumber = "Unknown s.n. "; assertNotNull("01",expectedCollectionNumber); assertEquals("02",expectedCollectionNumber, actualCollectorsNumber); }
private String getCollectorsFieldNumber() { StringBuilder sb = new StringBuilder(64); CSVRecordInfo<BrahmsCsvField> rec = input; sb.append(rec.get(COLLECTOR, false).trim()).append(' '); sb.append(rec.get(PREFIX, false).trim()).append(' '); sb.append(rec.get(NUMBER, false).trim()).append(' '); sb.append(rec.get(SUFFIX, false).trim()); return sb.toString(); }
BrahmsSpecimenTransformer extends BrahmsTransformer<Specimen> { private String getCollectorsFieldNumber() { StringBuilder sb = new StringBuilder(64); CSVRecordInfo<BrahmsCsvField> rec = input; sb.append(rec.get(COLLECTOR, false).trim()).append(' '); sb.append(rec.get(PREFIX, false).trim()).append(' '); sb.append(rec.get(NUMBER, false).trim()).append(' '); sb.append(rec.get(SUFFIX, false).trim()); return sb.toString(); } }
BrahmsSpecimenTransformer extends BrahmsTransformer<Specimen> { private String getCollectorsFieldNumber() { StringBuilder sb = new StringBuilder(64); CSVRecordInfo<BrahmsCsvField> rec = input; sb.append(rec.get(COLLECTOR, false).trim()).append(' '); sb.append(rec.get(PREFIX, false).trim()).append(' '); sb.append(rec.get(NUMBER, false).trim()).append(' '); sb.append(rec.get(SUFFIX, false).trim()); return sb.toString(); } BrahmsSpecimenTransformer(ETLStatistics stats); }
BrahmsSpecimenTransformer extends BrahmsTransformer<Specimen> { private String getCollectorsFieldNumber() { StringBuilder sb = new StringBuilder(64); CSVRecordInfo<BrahmsCsvField> rec = input; sb.append(rec.get(COLLECTOR, false).trim()).append(' '); sb.append(rec.get(PREFIX, false).trim()).append(' '); sb.append(rec.get(NUMBER, false).trim()).append(' '); sb.append(rec.get(SUFFIX, false).trim()); return sb.toString(); } BrahmsSpecimenTransformer(ETLStatistics stats);  }
BrahmsSpecimenTransformer extends BrahmsTransformer<Specimen> { private String getCollectorsFieldNumber() { StringBuilder sb = new StringBuilder(64); CSVRecordInfo<BrahmsCsvField> rec = input; sb.append(rec.get(COLLECTOR, false).trim()).append(' '); sb.append(rec.get(PREFIX, false).trim()).append(' '); sb.append(rec.get(NUMBER, false).trim()).append(' '); sb.append(rec.get(SUFFIX, false).trim()); return sb.toString(); } BrahmsSpecimenTransformer(ETLStatistics stats);   }