From 313c4b1a729c45d35d9e6b05b00d45b40dd9f01e Mon Sep 17 00:00:00 2001 From: Kirill Likhodedov Date: Thu, 22 May 2014 18:27:37 +0400 Subject: [PATCH] [git] cleanup: move method to the only place in tests where it is used --- .../git4idea/src/git4idea/history/GitLogRecord.java | 6 ------ .../tests/git4idea/history/GitLogParserTest.java | 10 ++++++++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/plugins/git4idea/src/git4idea/history/GitLogRecord.java b/plugins/git4idea/src/git4idea/history/GitLogRecord.java index cb8f9f1cec13..e5b8735e0d4e 100644 --- a/plugins/git4idea/src/git4idea/history/GitLogRecord.java +++ b/plugins/git4idea/src/git4idea/history/GitLogRecord.java @@ -118,12 +118,6 @@ class GitLogRecord { } } - String getAuthorAndCommitter() { - String author = String.format("%s <%s>", myOptions.get(AUTHOR_NAME), myOptions.get(AUTHOR_EMAIL)); - String committer = String.format("%s <%s>", myOptions.get(COMMITTER_NAME), myOptions.get(COMMITTER_EMAIL)); - return GitUtil.adjustAuthorName(author, committer); - } - String getFullMessage() { return mySupportsRawBody ? getRawBody().trim() : ((getSubject() + "\n\n" + getBody()).trim()); } diff --git a/plugins/git4idea/tests/git4idea/history/GitLogParserTest.java b/plugins/git4idea/tests/git4idea/history/GitLogParserTest.java index 8f054d08a12e..e8dfd458f45e 100644 --- a/plugins/git4idea/tests/git4idea/history/GitLogParserTest.java +++ b/plugins/git4idea/tests/git4idea/history/GitLogParserTest.java @@ -21,7 +21,6 @@ import com.intellij.openapi.vcs.FilePath; import com.intellij.openapi.vcs.VcsException; import com.intellij.openapi.vcs.changes.Change; import com.intellij.openapi.vfs.VirtualFile; -import com.intellij.testFramework.LightVirtualFile; import com.intellij.util.Function; import com.intellij.util.containers.ContainerUtil; import git4idea.GitUtil; @@ -184,7 +183,7 @@ public class GitLogParserTest extends GitPlatformTest { String expectedAuthorAndCommitter = GitUtil.adjustAuthorName( String.format("%s <%s>", expected.getAuthorName(), expected.getAuthorEmail()), String.format("%s <%s>", expected.getCommitterName(), expected.getCommitterEmail())); - assertEquals(expectedAuthorAndCommitter, actual.getAuthorAndCommitter()); + assertEquals(expectedAuthorAndCommitter, getAuthorAndCommitter(actual)); assertEquals(expected.getSubject(), actual.getSubject()); @@ -201,6 +200,13 @@ public class GitLogParserTest extends GitPlatformTest { } } + @NotNull + String getAuthorAndCommitter(@NotNull GitLogRecord actual) { + String author = String.format("%s <%s>", actual.getAuthorName(), actual.getAuthorEmail()); + String committer = String.format("%s <%s>", actual.getCommitterName(), actual.getCommitterEmail()); + return GitUtil.adjustAuthorName(author, committer); + } + private void assertPaths(List actualPaths, List expectedPaths) { List actual = ContainerUtil.map(actualPaths, new Function() { @Override