@Test
public void should_return_list_of_asset_needed_by_widgets_in_container() throws Exception {

    Component component1 = mockComponentFor(aWidget(), "id1", anAsset().withName("myfile.js").withType(AssetType.JAVASCRIPT));
    Component component2 = mockComponentFor(aWidget(), "id2", anAsset().withName("myfile.js").withType(AssetType.JAVASCRIPT));
    when(widgetRepository.get("pbContainer")).thenReturn(aWidget().build());
    Set<Asset> assets = assetVisitor.visit(aContainer().with(component1, component2).build());
    assertThat(assets).extracting("name").containsExactly("myfile.js", "myfile.js");
    assertThat(assets).extracting("componentId").contains("id2", "id1");
}