Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nquinquenel committed Sep 20, 2024
1 parent fd935df commit 9e40587
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@

import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.timeout;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyNoInteractions;
import static org.mockito.Mockito.when;
Expand Down Expand Up @@ -88,7 +89,7 @@ void testNoUnresolvedIssues() {
var result = handler.beforeCheckin(null, null);

assertThat(result).isEqualTo(CheckinHandler.ReturnResult.COMMIT);
verify(analysisSubmitter).analyzeFilesPreCommit(Collections.singleton(file));
verify(analysisSubmitter, timeout(1000)).analyzeFilesPreCommit(Collections.singleton(file));
verifyNoInteractions(toolWindow);
}

Expand Down Expand Up @@ -120,7 +121,7 @@ void testIssues() {
verify(toolWindow).openReportTab(analysisResultCaptor.capture());
var analysisResult = analysisResultCaptor.getValue();
assertThat(analysisResult.getFindings().getIssuesPerFile()).containsEntry(file, Set.of(issue));
verify(analysisSubmitter).analyzeFilesPreCommit(Collections.singleton(file));
verify(analysisSubmitter, timeout(1000)).analyzeFilesPreCommit(Collections.singleton(file));

}

Expand Down Expand Up @@ -154,6 +155,6 @@ void testSecretsIssues() {
verify(toolWindow).openReportTab(analysisResultCaptor.capture());
var analysisResult = analysisResultCaptor.getValue();
assertThat(analysisResult.getFindings().getIssuesPerFile()).containsEntry(file, Set.of(issue));
verify(analysisSubmitter).analyzeFilesPreCommit(Collections.singleton(file));
verify(analysisSubmitter, timeout(1000)).analyzeFilesPreCommit(Collections.singleton(file));
}
}

0 comments on commit 9e40587

Please sign in to comment.