@Test
public void should_return_an_import_report_saying_that_widget_is_going_to_be_overwritten_when_element_already_exists_in_repository() throws Exception {

    Widget widget = aWidget().id("aWidget").custom().build();
    Widget existingWidgetInRepo = aWidget().id("aWidget").favorite().custom().build();
    when(widgetLoader.load(widgetUnzippedPath.resolve("widget.json"))).thenReturn(widget);
    when(widgetRepository.exists(widget.getId())).thenReturn(true);
    when(widgetRepository.get(widget.getId())).thenReturn(existingWidgetInRepo);
    ImportReport report = widgetImporter.doImport(anImport(widgetImportPath));
    assertThat(report.getElement()).isEqualTo(existingWidgetInRepo);
    assertThat(report.isOverwritten()).isTrue();
}