@Test
public void testSubmitApplicationMultipleSubmission()
    throws YarnException, IOException, InterruptedException {

  ApplicationId appId =
      ApplicationId.newInstance(System.currentTimeMillis(), 1);
  ApplicationSubmissionContextInfo context =
      new ApplicationSubmissionContextInfo();
  context.setApplicationId(appId.toString());
  // First attempt
  Response response = interceptor.submitApplication(context, null);
  Assert.assertNotNull(response);
  Assert.assertEquals(ACCEPTED, response.getStatus());
  SubClusterId scIdResult = stateStoreUtil.queryApplicationHomeSC(appId);
  Assert.assertNotNull(scIdResult);
  // First retry
  response = interceptor.submitApplication(context, null);
  Assert.assertNotNull(response);
  Assert.assertEquals(ACCEPTED, response.getStatus());
  SubClusterId scIdResult2 = stateStoreUtil.queryApplicationHomeSC(appId);
  Assert.assertNotNull(scIdResult2);
  Assert.assertEquals(scIdResult, scIdResult2);
}