@Test
public void testProxyUser() throws Exception {

  PasswordAuthentication pa = Authenticator.requestPasswordAuthentication(
      InetAddress.getLocalHost(), 80, null, null, null);
  Assert.assertNull(pa);
  System.setProperty("http.proxyUser", "abc");
  System.setProperty("http.proxyPassword", "def");
  AmbariServer.setupProxyAuth();
  pa = Authenticator.requestPasswordAuthentication(
      InetAddress.getLocalHost(), 80, null, null, null);
  Assert.assertNotNull(pa);
  Assert.assertEquals("abc", pa.getUserName());
  Assert.assertArrayEquals("def".toCharArray(), pa.getPassword());
}