@Test
public void should_add_page_widgets_to_zip() throws Exception {

    repository.addWidget(aWidget().id("widget1"));
    repository.addWidget(aWidget().id("widget2"));
    Page page = aPage().with(
            aComponent("widget1"),
            aComponent("widget2"))
            .build();
    String content = "Mon   content   to                 minify";
    byte[] expected = Minifier.minify(content.getBytes());
    when(directiveFileGenerator.getWidgetsFilesUsedInPage(page)).thenReturn(Arrays.asList(Paths.get("widget1"),Paths
            .get("widget2")));
    when(directiveFileGenerator.concatenate(Arrays.asList(Paths.get("widget1"),Paths
            .get("widget2")))).thenReturn(content.getBytes());
    step.execute(zipper, page);
    verify(zipper).addToZip(repository.resolveWidgetJson("widget1"), "resources/widgets/widget1/widget1.json");
    verify(zipper).addToZip(repository.resolveWidgetJson("widget2"), "resources/widgets/widget2/widget2.json");
    verify(zipper).addToZip(expected, "resources/js/widgets-" + DigestUtils.sha1Hex(expected) + ".min.js");
}