@Test public void testVal() throws Exception { ETLStatistics etlStatistics = new ETLStatistics(); String actual = null; LineNumberReader lnr; FileReader fr = new FileReader(nsrFile); lnr = new LineNumberReader(fr, 4096); String json; while ((json = lnr.readLine()) != null) { NsrTaxonTransformer taxonTransformer = new NsrTaxonTransformer(etlStatistics); List<Taxon> taxa = taxonTransformer.transform(json); Taxon taxon = taxa.get(0); actual = NsrImportUtil.val(taxon.getVernacularNames().get(0).getName()); } String expectedNameValue = "Scandinavische zilvermeeuw"; assertNotNull("01", actual); assertEquals("02", expectedNameValue, actual); }
static String val(JsonNode jsonNode, String childTag) { String s = jsonNode.get(childTag).asText(); if (s == null) return null; return (s = s.trim()).length() == 0 ? null : s; }
NsrImportUtil { static String val(JsonNode jsonNode, String childTag) { String s = jsonNode.get(childTag).asText(); if (s == null) return null; return (s = s.trim()).length() == 0 ? null : s; } }
NsrImportUtil { static String val(JsonNode jsonNode, String childTag) { String s = jsonNode.get(childTag).asText(); if (s == null) return null; return (s = s.trim()).length() == 0 ? null : s; } private  NsrImportUtil(); }
NsrImportUtil { static String val(JsonNode jsonNode, String childTag) { String s = jsonNode.get(childTag).asText(); if (s == null) return null; return (s = s.trim()).length() == 0 ? null : s; } private  NsrImportUtil();  }
NsrImportUtil { static String val(JsonNode jsonNode, String childTag) { String s = jsonNode.get(childTag).asText(); if (s == null) return null; return (s = s.trim()).length() == 0 ? null : s; } private  NsrImportUtil();   }