mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
vcs: fix Project memory leak via Mockito
This commit is contained in:
@@ -330,21 +330,16 @@ public class TaskVcsTest extends CodeInsightFixtureTestCase {
|
||||
private void commitChanges(LocalChangeList changeList, List<Change> changes) {
|
||||
String commitMessage = changeList.getName();
|
||||
|
||||
CheckinProjectPanel panel = Mockito.mock(CheckinProjectPanel.class);
|
||||
try {
|
||||
when(panel.getProject()).thenReturn(getProject());
|
||||
when(panel.getCommitMessage()).thenReturn(commitMessage);
|
||||
CheckinProjectPanel panel = Mockito.mock(CheckinProjectPanel.class, Mockito.withSettings().stubOnly());
|
||||
when(panel.getProject()).thenReturn(getProject());
|
||||
when(panel.getCommitMessage()).thenReturn(commitMessage);
|
||||
|
||||
CheckinHandler checkinHandler = new TaskCheckinHandlerFactory().createHandler(panel, new CommitContext());
|
||||
CheckinHandler checkinHandler = new TaskCheckinHandlerFactory().createHandler(panel, new CommitContext());
|
||||
|
||||
List<CheckinHandler> handlers = ContainerUtil.list(checkinHandler);
|
||||
CommitHelper helper = new CommitHelper(getProject(), changeList, changes, "Commit", commitMessage, handlers, false, true,
|
||||
new PseudoMap<>(), null);
|
||||
helper.doCommit();
|
||||
}
|
||||
finally {
|
||||
Mockito.reset(panel);
|
||||
}
|
||||
List<CheckinHandler> handlers = ContainerUtil.list(checkinHandler);
|
||||
CommitHelper helper = new CommitHelper(getProject(), changeList, changes, "Commit", commitMessage, handlers, false, true,
|
||||
new PseudoMap<>(), null);
|
||||
helper.doCommit();
|
||||
}
|
||||
|
||||
private LocalChangeList addChangeList(String title) {
|
||||
|
||||
Reference in New Issue
Block a user