@Test
public void testSignalContainerEvent()
    throws IllegalArgumentException, IllegalAccessException, IOException {

  Map<ContainerId, ContainerLaunch> dummyMap = Collections
      .synchronizedMap(new HashMap<ContainerId, ContainerLaunch>());
  dummyMap.put(containerId, containerLaunch);
  SignalContainersLauncherEvent dummyEvent =
      mock(SignalContainersLauncherEvent.class);
  when(dummyEvent.getContainer()).thenReturn(container);
  when(container.getContainerId()).thenReturn(containerId);
  when(containerId.getApplicationAttemptId()).thenReturn(appAttemptId);
  when(containerId.getApplicationAttemptId().getApplicationId())
      .thenReturn(appId);
  Whitebox.setInternalState(spy, "running", dummyMap);
  when(dummyEvent.getType())
      .thenReturn(ContainersLauncherEventType.SIGNAL_CONTAINER);
  when(dummyEvent.getCommand())
      .thenReturn(SignalContainerCommand.GRACEFUL_SHUTDOWN);
  doNothing().when(containerLaunch)
      .signalContainer(SignalContainerCommand.GRACEFUL_SHUTDOWN);
  spy.handle(dummyEvent);
  assertEquals(1, dummyMap.size());
  Mockito.verify(containerLaunch, Mockito.times(1))
      .signalContainer(SignalContainerCommand.GRACEFUL_SHUTDOWN);
}