@Test
public void should_force_an_import_when_another_page_with_same_id_exist() throws Exception {

    wMocks.mockWidgetsAsAddedDependencies();
    Page page = pMocks.mockPageToBeImported();
    page.setName("myPage");
    Page existingPageInRepo = aPage().withUUID(page.getUUID()).withId("alreadyHere").withName("alreadyHere").build();
    when(pageRepository.getByUUID(page.getUUID())).thenReturn(existingPageInRepo);
    when(pageRepository.get(existingPageInRepo.getId())).thenReturn(existingPageInRepo);
    when(pageRepository.exists(page.getId())).thenReturn(true);
    when(pageRepository.getNextAvailableId(page.getName())).thenReturn("myPage1");
    Import anImport = new Import(pageImporter, "import-uuid", pageImportPath);
    ImportReport report = pageImporter.forceImport(anImport);
    assertThat(report.getOverwrittenElement()).isEqualTo(existingPageInRepo);
    assertThat(report.isOverwritten()).isTrue();
    assertThat(report.getStatus()).isEqualTo(ImportReport.Status.IMPORTED);
    assertThat(page.getId()).isEqualTo("myPage1");
    verify(pageRepository).delete(existingPageInRepo.getId());
    verify(pageRepository).updateLastUpdateAndSave(any(Page.class));
}