@Test
public void testGetGrantedAuthorities() throws Exception {

  String username = "user";
  AmbariLdapAuthoritiesPopulator populator = createMockBuilder(AmbariLdapAuthoritiesPopulator.class)
      .withConstructor(helper, userDAO, memberDAO, privilegeDAO, users).createMock();
  expect(userEntity.getActive()).andReturn(true);
  expect(users.getUserPrivileges(userEntity)).andReturn(Collections.singletonList(privilegeEntity));
  expect(userDAO.findLdapUserByName(username)).andReturn(userEntity);
  replayAll();
  populator.getGrantedAuthorities(userData, username);
  verifyAll();
}