void () { Repository repository = initRepository("foo"); LocalTask defaultTask = myTaskManager.getActiveTask(); LocalTaskImpl foo = myTaskManager.createLocalTask("foo"); final LocalTask localTask = myTaskManager.activateTask(foo, false); myTaskManager.createBranch(localTask, defaultTask, myTaskManager.suggestBranchName(localTask), null); createAndCommitChanges(repository); ApplicationManager.getApplication().invokeAndWait(() -> myTaskManager.mergeBranch(localTask)); repository.update(); assertEquals(getDefaultBranchName(), repository.getCurrentBranchName()); assertEquals(1, getNumberOfBranches(repository)); }