Avoid magic values in RevisionDiffIT
The updated commit message literal is used as magic value in multiple tests of RevisionDiffIT. Introduce a common constant that represents what the test value means, so that tests become more readable. Change-Id: I8d9f00e343169b135550b83d47974f7a2e4d4cd3
This commit is contained in:
committed by
David Ostrovsky
parent
91b6fce590
commit
463eb89a91
@@ -72,6 +72,7 @@ public class RevisionDiffIT extends AbstractDaemonTest {
|
||||
.mapToObj(number -> String.format("Line %d\n", number))
|
||||
.collect(joining());
|
||||
private static final String FILE_CONTENT2 = "1st line\n2nd line\n3rd line\n";
|
||||
private static final String UPDATED_COMMIT_MESSAGE = "An unchanged patchset";
|
||||
|
||||
private boolean intraline;
|
||||
private ObjectId commit1;
|
||||
@@ -406,7 +407,7 @@ public class RevisionDiffIT extends AbstractDaemonTest {
|
||||
gApi.changes().id(changeId).edit().modifyFile(filePath, RawInputUtil.create(fileContent));
|
||||
gApi.changes().id(changeId).edit().publish();
|
||||
String previousPatchSetId = gApi.changes().id(changeId).get().currentRevision;
|
||||
gApi.changes().id(changeId).edit().modifyCommitMessage("An unchanged patchset");
|
||||
gApi.changes().id(changeId).edit().modifyCommitMessage(UPDATED_COMMIT_MESSAGE);
|
||||
gApi.changes().id(changeId).edit().publish();
|
||||
|
||||
DiffInfo diffInfo =
|
||||
@@ -428,7 +429,7 @@ public class RevisionDiffIT extends AbstractDaemonTest {
|
||||
gApi.changes().id(changeId).edit().modifyFile(filePath, RawInputUtil.create(fileContent));
|
||||
gApi.changes().id(changeId).edit().publish();
|
||||
String previousPatchSetId = gApi.changes().id(changeId).get().currentRevision;
|
||||
gApi.changes().id(changeId).edit().modifyCommitMessage("An unchanged patchset");
|
||||
gApi.changes().id(changeId).edit().modifyCommitMessage(UPDATED_COMMIT_MESSAGE);
|
||||
gApi.changes().id(changeId).edit().publish();
|
||||
|
||||
DiffInfo diffInfo =
|
||||
@@ -446,7 +447,7 @@ public class RevisionDiffIT extends AbstractDaemonTest {
|
||||
gApi.changes().id(changeId).edit().modifyFile(filePath, RawInputUtil.create(fileContent));
|
||||
gApi.changes().id(changeId).edit().publish();
|
||||
String previousPatchSetId = gApi.changes().id(changeId).get().currentRevision;
|
||||
gApi.changes().id(changeId).edit().modifyCommitMessage("An unchanged patchset");
|
||||
gApi.changes().id(changeId).edit().modifyCommitMessage(UPDATED_COMMIT_MESSAGE);
|
||||
gApi.changes().id(changeId).edit().publish();
|
||||
|
||||
DiffInfo diffInfo =
|
||||
|
||||
Reference in New Issue
Block a user