HtmlExportStep implements ExportStep<Page> { @Override public void execute(Zipper zipper, Page page) throws IOException { zipper.addDirectoryToZip( get(resourceLoader.getResource(BACKEND_RESOURCES + "runtime").getURI()), ALL_DIRECTORIES, ALL_FILES, RESOURCES); byte[] html = generator.generateHtml(page).getBytes(StandardCharsets.UTF_8); zipper.addToZip(html, RESOURCES + "/index.html"); } @Inject  HtmlExportStep(HtmlGenerator generator, ResourceLoader resourceLoader); @Override void execute(Zipper zipper, Page page);  }
@Test public void should_export_webapp_generator_folder() throws Exception { step.execute(zipper, aPage().build()); verify(zipper).addDirectoryToZip(get(new File("src/test/resources/generator").toURI()), ALL_DIRECTORIES, ALL_FILES, "resources"); }
@Test public void should_export_generated_html() throws Exception { when(htmlGenerator.generateHtml(any(Page.class))).thenReturn("foobar"); step.execute(zipper, aPage().build()); verify(zipper).addToZip("foobar".getBytes(), "resources/index.html"); }