@Test
public void should_refresh_component_assets_from_disk() throws Exception {

    Page page = aPage().withId("page-id")
            .withAsset(anAsset().withName("existing-asset.js")).build();
    temporaryFolder.newFolder("page-id", "assets", "css");
    write(pagesPath.resolve("page-id/assets/css/file1.css"), "<style>.maclass1{}</style>".getBytes());
    write(pagesPath.resolve("page-id/assets/css/file2.css"), "<style>.maclass2{}</style>".getBytes());
    when(pageRepository.resolvePath("page-id")).thenReturn(pagesPath.resolve("page-id"));
    assetRepository.refreshAssets(page);
    assertThat(page.getAssets()).hasSize(3);
    assertThat(page.getAssets()).extracting("name").contains("file1.css", "file2.css", "existing-asset.js");
    verify(pageRepository).updateLastUpdateAndSave(page);
}