use of com.google.gerrit.acceptance.UseClockStep in project gerrit by GerritCodeReview.
the class SubmoduleSubscriptionsIT method superRepoCommitHasSameAuthorAsSubmoduleCommit.
@Test
@UseClockStep
public void superRepoCommitHasSameAuthorAsSubmoduleCommit() throws Exception {
// Make sure that the commit is created at an earlier timestamp than the submit timestamp.
allowMatchingSubmoduleSubscription(subKey, "refs/heads/master", superKey, "refs/heads/master");
createSubmoduleSubscription(superRepo, "master", subKey, "master");
PushOneCommit.Result pushResult = createChange(subRepo, "refs/heads/master", "Change", "a.txt", "some content", null);
approve(pushResult.getChangeId());
gApi.changes().id(pushResult.getChangeId()).current().submit();
// Expect that the author name/email is preserved for the superRepo commit, but a new author
// timestamp is used.
PersonIdent authorIdent = getAuthor(superRepo, "master");
assertThat(authorIdent.getName()).isEqualTo(admin.fullName());
assertThat(authorIdent.getEmailAddress()).isEqualTo(admin.email());
assertThat(authorIdent.getWhen()).isGreaterThan(pushResult.getCommit().getAuthorIdent().getWhen());
}
Aggregations