EventRecorder: Add assertNoRefUpdatedEvents helper method
It's clearer to call assertNoRefUpdatedEvents than assertRefUpdatedEvents with an explicit empty array. Update ProjectIT to use it. Change-Id: I9142ee36782f5f04e265cd9482bb9e399c24d6fe
This commit is contained in:
parent
8be8301520
commit
27ba8e19b5
@ -138,6 +138,10 @@ public class EventRecorder {
|
||||
return events;
|
||||
}
|
||||
|
||||
public void assertNoRefUpdatedEvents(String project, String branch) throws Exception {
|
||||
getRefUpdatedEvents(project, branch, 0);
|
||||
}
|
||||
|
||||
public void assertRefUpdatedEvents(String project, String branch, String... expected)
|
||||
throws Exception {
|
||||
ImmutableList<RefUpdatedEvent> events =
|
||||
|
@ -41,9 +41,9 @@ public class ProjectIT extends AbstractDaemonTest {
|
||||
assertThat(name).isEqualTo(gApi.projects().create(name).get().name);
|
||||
|
||||
RevCommit head = getRemoteHead(name, RefNames.REFS_CONFIG);
|
||||
eventRecorder.assertRefUpdatedEvents(name, RefNames.REFS_CONFIG, null, head);
|
||||
|
||||
eventRecorder.assertRefUpdatedEvents(name, "refs/heads/master", new String[] {});
|
||||
eventRecorder.assertRefUpdatedEvents(name, RefNames.REFS_CONFIG, null, head);
|
||||
eventRecorder.assertNoRefUpdatedEvents(name, "refs/heads/master");
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -52,9 +52,9 @@ public class ProjectIT extends AbstractDaemonTest {
|
||||
assertThat(name).isEqualTo(gApi.projects().create(name + ".git").get().name);
|
||||
|
||||
RevCommit head = getRemoteHead(name, RefNames.REFS_CONFIG);
|
||||
eventRecorder.assertRefUpdatedEvents(name, RefNames.REFS_CONFIG, null, head);
|
||||
|
||||
eventRecorder.assertRefUpdatedEvents(name, "refs/heads/master", new String[] {});
|
||||
eventRecorder.assertRefUpdatedEvents(name, RefNames.REFS_CONFIG, null, head);
|
||||
eventRecorder.assertNoRefUpdatedEvents(name, "refs/heads/master");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
Loading…
Reference in New Issue
Block a user