void (File wc1, String expectedText) { assertTrue(wc1.isDirectory()); final VirtualFile vf = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(wc1); final UpdatedFiles files = UpdatedFiles.create(); final UpdateSession session = vcs.getUpdateEnvironment().updateDirectories(new FilePath[]{VcsUtil.getFilePath(vf)}, files, new EmptyProgressIndicator(), new Ref<>()); assertTrue(session.getExceptions() != null && !session.getExceptions().isEmpty()); assertFalse(session.isCanceled()); assertTrue(session.getExceptions().get(0).getMessage().contains(expectedText)); if (myIsSecure) { ++ myExpectedCreds; ++ myExpectedCert; } }