public AMSimulator() {
    this.responseQueue = new LinkedBlockingQueue<>();
  }
@Test
  public void testAMSimulator() throws Exception {
    // Register one app
    MockAMSimulator app = new MockAMSimulator();
    String appId = "app1";
    String queue = "default";
    List<ContainerSimulator> containers = new ArrayList<>();
    HashMap<ApplicationId, AMSimulator> map = new HashMap<>();

    UserName mockUser = mock(UserName.class);
    when(mockUser.getValue()).thenReturn("user1");
    AMDefinitionRumen amDef =
        AMDefinitionRumen.Builder.create()
        .withUser(mockUser)
        .withQueue(queue)
        .withJobId(appId)
        .withJobStartTime(0)
        .withJobFinishTime(1000000L)
        .withAmResource(SLSConfiguration.getAMContainerResource(conf))
        .withTaskContainers(containers)
        .build();
    app.init(amDef, rm, null, true, 0, 1000, map);
    app.firstStep();

    verifySchedulerMetrics(appId);

    Assert.assertEquals(1, rm.getRMContext().getRMApps().size());
    Assert.assertNotNull(rm.getRMContext().getRMApps().get(app.appId));

    // Finish this app
    app.lastStep();
  }