Replace assertions of hasSize(0) with isEmpty()

Change-Id: I94b11afec7e16a4bf5b7e38238ec94faabd3e921
This commit is contained in:
David Pursehouse
2019-09-19 09:51:32 +09:00
parent 35da932df6
commit cb21cfd12d
4 changed files with 5 additions and 5 deletions

View File

@@ -2003,7 +2003,7 @@ public class ChangeIT extends AbstractDaemonTest {
// Added reviewers not notified by default.
PushOneCommit.Result r = createWorkInProgressChange();
gApi.changes().id(r.getChangeId()).addReviewer(in);
assertThat(sender.getMessages()).hasSize(0);
assertThat(sender.getMessages()).isEmpty();
// Default notification handling can be overridden.
r = createWorkInProgressChange();
@@ -2017,7 +2017,7 @@ public class ChangeIT extends AbstractDaemonTest {
// that should be ignored.
r = createWorkInProgressChange();
gApi.changes().id(r.getChangeId()).current().review(batchIn);
assertThat(sender.getMessages()).hasSize(0);
assertThat(sender.getMessages()).isEmpty();
// Top-level notify property can force notifications when adding reviewer
// via PostReview.

View File

@@ -772,7 +772,7 @@ public class RevisionIT extends AbstractDaemonTest {
input.notify = NotifyHandling.NONE;
sender.clear();
gApi.changes().id(changeId).current().cherryPick(input);
assertThat(sender.getMessages()).hasSize(0);
assertThat(sender.getMessages()).isEmpty();
// Disable the notification. The user provided in the 'notifyDetails' should still be notified.
TestAccount userToNotify = accountCreator.user2();

View File

@@ -909,7 +909,7 @@ public class CommentsIT extends AbstractDaemonTest {
// PS2 has comments [c6, c9].
assertThat(getRevisionComments(changeId, ps2)).hasSize(2);
// PS3 has no comment.
assertThat(getRevisionComments(changeId, ps3)).hasSize(0);
assertThat(getRevisionComments(changeId, ps3)).isEmpty();
// PS4 has comments [c7, c8].
assertThat(getRevisionComments(changeId, ps4)).hasSize(2);

View File

@@ -53,7 +53,7 @@ public final class AuditLogReaderTest extends AbstractGroupTest {
@Test
public void createGroupAsServerIdent() throws Exception {
InternalGroup group = createGroup(1, "test-group", serverIdent, null);
assertThat(auditLogReader.getMembersAudit(allUsersRepo, group.getGroupUUID())).hasSize(0);
assertThat(auditLogReader.getMembersAudit(allUsersRepo, group.getGroupUUID())).isEmpty();
}
@Test