Remove usages of System.currentTimeMillis() from gerrit-reviewdb
Unlike pure server code, reviewdb.client is used from GWT, so we cannot just use joda's DateTimeUtils.currentTimeMillis(). Instead, just introduce arguments where necessary. Passing TimeUtil.nowTs() is a bit cumbersome but usually short enough to type. Change-Id: I87ef09b0920bc36851bca893a2a37348ffc6bf3a
This commit is contained in:
@@ -25,6 +25,7 @@ import com.google.gerrit.reviewdb.client.AccountExternalId;
|
||||
import com.google.gerrit.reviewdb.client.AccountGroup;
|
||||
import com.google.gerrit.server.account.AccountCache;
|
||||
import com.google.gerrit.server.account.AccountState;
|
||||
import com.google.gerrit.server.util.TimeUtil;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
@@ -276,7 +277,7 @@ public class FromAddressGeneratorProviderTest extends TestCase {
|
||||
|
||||
private AccountState makeUser(final String name, final String email) {
|
||||
final Account.Id userId = new Account.Id(42);
|
||||
final Account account = new Account(userId);
|
||||
final Account account = new Account(userId, TimeUtil.nowTs());
|
||||
account.setFullName(name);
|
||||
account.setPreferredEmail(email);
|
||||
final AccountState s =
|
||||
|
||||
Reference in New Issue
Block a user