use of com.google.gerrit.extensions.common.AccountDetailInfo in project gerrit by GerritCodeReview.
the class GetAccountDetailIT method searchForSecondaryEmailRequiresModifyAccountPermission.
@Test
public void searchForSecondaryEmailRequiresModifyAccountPermission() throws Exception {
Account.Id id = accountOperations.newAccount().preferredEmail("preferred@email").addSecondaryEmail("secondary@email").create();
RestResponse r = userRestSession.get("/accounts/secondary/detail/");
r.assertStatus(404);
// The admin has MODIFY_ACCOUNT permission and can see the user.
r = adminRestSession.get("/accounts/secondary/detail/");
r.assertStatus(200);
AccountDetailInfo info = newGson().fromJson(r.getReader(), AccountDetailInfo.class);
assertThat(info._accountId).isEqualTo(id.get());
}
use of com.google.gerrit.extensions.common.AccountDetailInfo in project gerrit by GerritCodeReview.
the class GetAccountDetailIT method getDetailForExtensionPointAccountTag.
@Test
public void getDetailForExtensionPointAccountTag() throws Exception {
RestResponse r = userRestSession.get("/accounts/" + user.username() + "/detail/");
AccountDetailInfo info = newGson().fromJson(r.getReader(), AccountDetailInfo.class);
assertThat(info.tags).containsExactly("BASIC_USER");
}
use of com.google.gerrit.extensions.common.AccountDetailInfo in project gerrit by GerritCodeReview.
the class GetAccountDetailIT method getDetail.
@Test
public void getDetail() throws Exception {
RestResponse r = adminRestSession.get("/accounts/" + admin.username() + "/detail/");
AccountDetailInfo info = newGson().fromJson(r.getReader(), AccountDetailInfo.class);
assertAccountInfo(admin, info);
Account account = getAccount(admin.id());
assertThat(info.registeredOn.getTime()).isEqualTo(account.registeredOn().toEpochMilli());
}
Aggregations