@@ -0,0 +1,2430 @@
+// Copyright (C) 2013 The Android Open Source Project%0A//%0A// Licensed under the Apache License, Version 2.0 (the %22License%22);%0A// you may not use this file except in compliance with the License.%0A// You may obtain a copy of the License at%0A//%0A// http://www.apache.org/licenses/LICENSE-2.0%0A//%0A// Unless required by applicable law or agreed to in writing, software%0A// distributed under the License is distributed on an %22AS IS%22 BASIS,%0A// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A// See the License for the specific language governing permissions and%0A// limitations under the License.%0A%0Apackage com.google.gerrit.acceptance.rest.group;%0A%0Aimport static com.google.gerrit.acceptance.rest.group.GroupAssert.assertGroupInfo;%0A%0Aimport com.google.common.reflect.TypeToken;%0Aimport com.google.gerrit.acceptance.AbstractDaemonTest;%0Aimport com.google.gerrit.acceptance.AccountCreator;%0Aimport com.google.gerrit.acceptance.RestResponse;%0Aimport com.google.gerrit.acceptance.RestSession;%0Aimport com.google.gerrit.acceptance.TestAccount;%0Aimport com.google.gerrit.reviewdb.client.AccountGroup;%0Aimport com.google.gerrit.server.account.GroupCache;%0Aimport com.google.gson.Gson;%0Aimport com.google.inject.Inject;%0A%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0A%0Aimport java.io.IOException;%0A%0Apublic class GetGroupIT extends AbstractDaemonTest %7B%0A%0A  @Inject%0A  private AccountCreator accounts;%0A%0A  @Inject%0A  private GroupCache groupCache;%0A%0A  private TestAccount admin;%0A  private RestSession session;%0A%0A  @Before%0A  public void setUp() throws Exception %7B%0A    admin = accounts.create(%22admin%22, %22admin@example.com%22, %22Administrator%22,%0A            %22Administrators%22);%0A    session = new RestSession(admin);%0A  %7D%0A%0A  @Test%0A  public void testGetGroup() throws IOException %7B%0A    AccountGroup adminGroup = groupCache.get(new AccountGroup.NameKey(%22Administrators%22));%0A%0A    // by UUID%0A    testGetGroup(%22/groups/%22 + adminGroup.getGroupUUID().get(), adminGroup);%0A%0A    // by name%0A    testGetGroup(%22/groups/%22 + adminGroup.getName(), adminGroup);%0A%0A    // by legacy numeric ID%0A    testGetGroup(%22/groups/%22 + adminGroup.getId().get(), adminGroup);%0A  %7D%0A%0A  private void testGetGroup(String url, AccountGroup expectedGroup) throws IOException %7B%0A    RestResponse r = session.get(url);%0A    @SuppressWarnings(%22serial%22)%0A    GroupInfo group = (new Gson()).fromJson(r.getReader(), new TypeToken%3CGroupInfo%3E() %7B%7D.getType());%0A    assertGroupInfo(expectedGroup, group);%0A  %7D%0A%7D%0A

Add acceptance test to retrieve group via REST