@Test
public void getUserGroups() throws Exception {

    this.mockMvc = MockMvcBuilders.webAppContextSetup(this.wac).build();
    final User editorUser = _userRepo.findOneByUsername("testuser-editor");
    final Group sampleGroup = _groupRepo.findByName("sample");
    this.mockHttpSession = loginAsAdmin();
    this.mockMvc.perform(get("/srv/api/users/" + editorUser.getId() + "/groups")
        .session(this.mockHttpSession)
        .accept(MediaType.parseMediaType("application/json")))
        .andExpect(status().isOk())
        .andExpect(jsonPath("$", hasSize(1)))
        .andExpect(jsonPath("$[0].id.groupId", is(sampleGroup.getId())))
        .andExpect(content().contentType(API_JSON_EXPECTED_ENCODING));
}