@Test
public void testClusterUserInfo() throws JSONException, Exception {

  ResourceManager mockRM = mock(ResourceManager.class);
  Configuration conf = new YarnConfiguration();
  HttpServletRequest mockHsr = mockHttpServletRequestByUserName("admin");
  when(mockRM.getRMLoginUser()).thenReturn("yarn");
  RMWebServices webSvc =
          new RMWebServices(mockRM, conf, mock(HttpServletResponse.class));
  ClusterUserInfo userInfo = webSvc.getClusterUserInfo(mockHsr);
  verifyClusterUserInfo(userInfo, "yarn", "admin");
}