@Test
public void testFinishInvalidApplicationMaster() throws Exception {

  try {
    // Try to finish an application master that was not registered.
    finishApplicationMaster(4, FinalApplicationStatus.SUCCEEDED);
    Assert
        .fail("The request to finish application master should have failed");
  } catch (Throwable ex) {
    // This is expected. So nothing required here.
    LOG.info("Finish registration failed as expected because it was not registered");
  }
}