@Test
public void setCoverageReport() {

    AuditLog auditLogMock = mock(AuditLog.class);
    CoverageReportView.Presenter presenterSpy = spy(CoverageReportView.Presenter.class);
    scenarioSimulationEditorBusinessClientWrapper.setCoverageReport(presenterSpy);
    verify(presenterSpy, times(1)).populateCoverageReport(eq(DMN), eq(null));
    //
    reset(presenterSpy, simulationRunMetadataMock, scenarioSimulationEditorBusinessClientWrapper);
    scenarioSimulationEditorBusinessClientWrapper.lastRunResult = simulationRunResultMock;
    scenarioSimulationEditorBusinessClientWrapper.setCoverageReport(presenterSpy);
    verify(presenterSpy, times(1)).populateCoverageReport(eq(DMN), eq(simulationRunMetadataMock));
    verify(presenterSpy, never()).setDownloadReportCommand(any());
    //
    reset(presenterSpy, simulationRunMetadataMock, scenarioSimulationEditorBusinessClientWrapper);
    when(simulationRunMetadataMock.getAuditLog()).thenReturn(auditLogMock);
    scenarioSimulationEditorBusinessClientWrapper.lastRunResult = simulationRunResultMock;
    scenarioSimulationEditorBusinessClientWrapper.setCoverageReport(presenterSpy);
    verify(presenterSpy, times(1)).populateCoverageReport(eq(DMN), eq(simulationRunMetadataMock));
    verify(presenterSpy, times(1)).setDownloadReportCommand(commandArgumentCaptor.capture());
    commandArgumentCaptor.getValue().execute();
    verify(scenarioSimulationEditorBusinessClientWrapper, times(1)).onDownloadReportToCsv(eq(exportCallBackMock),
                                                                                          isA(ScenarioSimulationHasBusyIndicatorDefaultErrorCallback.class),
                                                                                          eq(simulationRunMetadataMock),
                                                                                          eq(DMN));
    //
    reset(presenterSpy, simulationRunMetadataMock, scenarioSimulationEditorBusinessClientWrapper);
    scenarioSimulationEditorBusinessClientWrapper.lastRunResult = null;
    when(scenarioSimulationEditorPresenterMock.getDataManagementStrategy()).thenReturn(mock(AbstractDMODataManagementStrategy.class));
    scenarioSimulationEditorBusinessClientWrapper.setCoverageReport(presenterSpy);
    verify(presenterSpy, times(1)).populateCoverageReport(eq(RULE), eq(null));
    //
    reset(presenterSpy, simulationRunMetadataMock, scenarioSimulationEditorBusinessClientWrapper);
    scenarioSimulationEditorBusinessClientWrapper.lastRunResult = simulationRunResultMock;
    scenarioSimulationEditorBusinessClientWrapper.setCoverageReport(presenterSpy);
    verify(presenterSpy, times(1)).populateCoverageReport(eq(RULE), eq(simulationRunMetadataMock));
    verify(presenterSpy, never()).setDownloadReportCommand(any());
    //
    reset(presenterSpy, simulationRunMetadataMock, scenarioSimulationEditorBusinessClientWrapper);
    when(simulationRunMetadataMock.getAuditLog()).thenReturn(auditLogMock);
    scenarioSimulationEditorBusinessClientWrapper.lastRunResult = simulationRunResultMock;
    scenarioSimulationEditorBusinessClientWrapper.setCoverageReport(presenterSpy);
    verify(presenterSpy, times(1)).populateCoverageReport(eq(RULE), eq(simulationRunMetadataMock));
    verify(presenterSpy, times(1)).setDownloadReportCommand(commandArgumentCaptor.capture());
    commandArgumentCaptor.getValue().execute();
    verify(scenarioSimulationEditorBusinessClientWrapper, times(1)).onDownloadReportToCsv(eq(exportCallBackMock),
                                                                                          isA(ScenarioSimulationHasBusyIndicatorDefaultErrorCallback.class),
                                                                                          eq(simulationRunMetadataMock),
                                                                                          eq(RULE));
}