Add project watches to AccountState

We need the project watches in AccountState so that we can add watched
projects to the account index later.

This change requires a manual flush of the account cache.

Change-Id: I3bbeb623c20588a0cd44e5398a7a4079d9a79f32
Signed-off-by: Edwin Kempin <ekempin@google.com>
This commit is contained in:
Edwin Kempin
2016-07-04 16:33:38 +02:00
parent 22ca9734e7
commit ae27c46ea3
10 changed files with 75 additions and 60 deletions

View File

@@ -29,7 +29,8 @@ public class FakeQueryBuilder extends ChangeQueryBuilder {
FakeQueryBuilder.class),
new ChangeQueryBuilder.Arguments(null, null, null, null, null, null,
null, null, null, null, null, null, null, null, null, null, null,
null, null, null, indexes, null, null, null, null, null, null, null));
null, null, null, indexes, null, null, null, null, null, null, null,
null));
}
@Operator

View File

@@ -25,6 +25,7 @@ import com.google.gerrit.common.TimeUtil;
import com.google.gerrit.reviewdb.client.Account;
import com.google.gerrit.reviewdb.client.AccountExternalId;
import com.google.gerrit.reviewdb.client.AccountGroup;
import com.google.gerrit.reviewdb.client.AccountProjectWatch;
import com.google.gerrit.server.account.AccountCache;
import com.google.gerrit.server.account.AccountState;
@@ -298,6 +299,7 @@ public class FromAddressGeneratorProviderTest {
account.setFullName(name);
account.setPreferredEmail(email);
return new AccountState(account, Collections.<AccountGroup.UUID> emptySet(),
Collections.<AccountExternalId> emptySet());
Collections.<AccountExternalId> emptySet(),
Collections.<AccountProjectWatch> emptySet());
}
}

View File

@@ -19,6 +19,7 @@ import com.google.gerrit.common.TimeUtil;
import com.google.gerrit.reviewdb.client.Account;
import com.google.gerrit.reviewdb.client.AccountExternalId;
import com.google.gerrit.reviewdb.client.AccountGroup;
import com.google.gerrit.reviewdb.client.AccountProjectWatch;
import com.google.gerrit.server.account.AccountCache;
import com.google.gerrit.server.account.AccountState;
@@ -73,8 +74,8 @@ public class FakeAccountCache implements AccountCache {
}
private static AccountState newState(Account account) {
return new AccountState(
account, ImmutableSet.<AccountGroup.UUID> of(),
ImmutableSet.<AccountExternalId> of());
return new AccountState(account, ImmutableSet.<AccountGroup.UUID> of(),
ImmutableSet.<AccountExternalId> of(),
ImmutableSet.<AccountProjectWatch> of());
}
}