use of com.google.gerrit.server.account.AccountResolver.Result in project gerrit by GerritCodeReview.
the class AccountResolverTest method exceptionMessageAmbiguous.
@Test
public void exceptionMessageAmbiguous() throws Exception {
AccountResolver resolver = newAccountResolver();
assertThat(new UnresolvableAccountException(resolver.new Result("foo", ImmutableList.of(newAccount(3), newAccount(1)), ImmutableList.of()))).hasMessageThat().isEqualTo("Account 'foo' is ambiguous (at most 3 shown):\n1: Anonymous Name (1)\n3: Anonymous Name (3)");
}
use of com.google.gerrit.server.account.AccountResolver.Result in project gerrit by GerritCodeReview.
the class AccountResolverIT method bySelfInactive.
@Test
public void bySelfInactive() throws Exception {
gApi.accounts().id(user.id().get()).setActive(false);
requestScopeOperations.setApiUser(user.id());
assertThat(gApi.accounts().id("self").getActive()).isFalse();
Result result = resolveAsResult("self");
assertThat(result.asIdSet()).containsExactly(user.id());
assertThat(result.isSelf()).isTrue();
assertThat(result.asUniqueUser()).isSameInstanceAs(self.get());
}
Aggregations