@Test
public void testTwoDifferentRegisterRequest() throws Exception {

  // Register the application first time
  RegisterApplicationMasterRequest registerReq =
      Records.newRecord(RegisterApplicationMasterRequest.class);
  registerReq.setHost(Integer.toString(testAppId));
  registerReq.setRpcPort(0);
  registerReq.setTrackingUrl("");
  RegisterApplicationMasterResponse registerResponse =
      interceptor.registerApplicationMaster(registerReq);
  Assert.assertNotNull(registerResponse);
  lastResponseId = 0;
  // Register the application second time with a different request obj
  registerReq = Records.newRecord(RegisterApplicationMasterRequest.class);
  registerReq.setHost(Integer.toString(testAppId));
  registerReq.setRpcPort(0);
  registerReq.setTrackingUrl("different");
  try {
    registerResponse = interceptor.registerApplicationMaster(registerReq);
    lastResponseId = 0;
    Assert.fail("Should throw if a different request obj is used");
  } catch (YarnException e) {
  }
}