@Test
  public void testSearchUserById() throws Exception {
    Capture<SearchRestriction[]> restrictions = new Capture<SearchRestriction[]>();
    expect(holder.getUserManager()).andReturn(userManager);
    expect(holder.getNexusRoleManager()).andReturn(nexusRoleManager).times(2);

    expect(userManager.searchUsers(capture(restrictions))).andReturn(Arrays.asList(user1, user2));
    expect(nexusRoleManager.getNexusRoles("user1")).andReturn(Arrays.asList("one", "two"));
    expect(nexusRoleManager.getNexusRoles("user2")).andReturn(Arrays.asList("two"));

    replay(holder, userManager, nexusRoleManager);

    Set<PlexusUser> set = locator.searchUserById("me");
    assertThat(set.size(), equalTo(2));
    assertThat(restrictions.getValue().length, equalTo(4));
    assertThat(restrictions.getValue()[1].getName(), equalTo(SearchContext.PRINCIPAL_NAME));
    assertThat(restrictions.getValue()[1].getValue(), equalTo("me"));

    verify(holder, userManager, nexusRoleManager);
  }