BundleParser { public static String getSourceFromStatistics(String fileName, JsonObject statistics) { return getSourceFromObject(statistics, fileName); } private  BundleParser(); static String getHashFromStatistics(String fileContents); static JsonObject parseJsonStatistics(String fileContents); static String getSourceFromStatistics(String fileName,
            JsonObject statistics); static Element parseTemplateElement(String name,
            JsonObject statisticsJson); static Element parseTemplateElement(String fileName, String source);  }
@Test public void nonLocalTemplate_sourcesShouldBeFound() { final String source = BundleParser.getSourceFromStatistics( "./src/hello-world.js", stats); Assert.assertNotNull("Source expected in stats.json", source); }
@Test public void nonLocalTemplate_sourcesShouldBeFoundInTargetFolder() { final String source = BundleParser.getSourceFromStatistics( "./src/hello-world2.js", stats); Assert.assertNotNull("Source expected in stats.json", source); }
@Test public void frontendPrefix_sourcesShouldBeFound() { final String source = BundleParser.getSourceFromStatistics( "./frontend/src/hello-world.js", stats); Assert.assertNotNull("Source expected in stats.json", source); }
@Test public void frontendProtocol_sourcesShouldBeFound() { final String source = BundleParser.getSourceFromStatistics( "frontend: Assert.assertNotNull("Source expected in stats.json", source); }
@Test public void startsWithSingleLetterDirector_sourcesShouldNotBeFound() { final JsonObject module = Json.createObject(); module.put("name","a/src/hello-world.js"); module.put("source","some-source.js"); final String source = BundleParser.getSourceFromStatistics( "a/frontend/src/hello-world.js", module); Assert.assertNull("Source not expected in module", source); }