@Test
public void testRequestInterceptorChainCreation() throws Exception {

  RequestInterceptor root =
      super.getAMRMProxyService().createRequestInterceptorChain();
  int index = 0;
  while (root != null) {
    switch (index) {
    case 0:
    case 1:
    case 2:
      Assert.assertEquals(PassThroughRequestInterceptor.class.getName(),
          root.getClass().getName());
      break;
    case 3:
      Assert.assertEquals(MockRequestInterceptor.class.getName(), root
          .getClass().getName());
      break;
    }
    root = root.getNextInterceptor();
    index++;
  }
  Assert.assertEquals(
      "The number of interceptors in chain does not match",
      Integer.toString(4), Integer.toString(index));
}