@Test
public void should_return_an_import_report_saying_that_page_is_going_to_be_overwritten_when_element_already_exists_in_repository() throws Exception {

    Page page = pMocks.mockPageToBeImported();
    Page existingPageInRepo = aPage().withUUID(page.getUUID()).withName("alreadyHere").build();
    when(pageRepository.getByUUID(page.getUUID())).thenReturn(existingPageInRepo);
    when(pageRepository.get(existingPageInRepo.getId())).thenReturn(existingPageInRepo);
    ImportReport report = pageImporter.doImport(anImport(pageImportPath));
    assertThat(report.getElement()).isEqualTo(page);
    assertThat(report.getOverwrittenElement()).isEqualTo(existingPageInRepo);
    assertThat(report.isOverwritten()).isTrue();
}