@Test
  public void shouldGetState() throws InterruptedException {
    // Given
    Map<String, Object> headers = new HashMap<String, Object>();
    headers.put(HEADER_MACHINE, machine);
    mock.expectedBodiesReceived(VM_STATE);

    // When
    sendBody(startTest, "GetState", headers);

    // Then
    mock.assertIsSatisfied();
    assertEquals(machine, MACHINE_NAME_USED.getValue());
  }
  @Test
  public void shouldPowerDown() throws InterruptedException {
    // Given
    Map<String, Object> headers = new HashMap<String, Object>();
    headers.put(HEADER_MACHINE, machine);
    mockLockedSession();

    // When
    sendBody(startTest, "PowerDown", headers);

    // Then
    verify(CONSOLE).powerDown();
    assertEquals(machine, MACHINE_NAME_USED.getValue());
  }
  @Test
  public void shouldRestoreCurrentSnapshot() throws InterruptedException {
    // Given
    Map<String, Object> headers = new HashMap<String, Object>();
    headers.put(HEADER_MACHINE, machine);
    mockLockedSession();

    // When
    sendBody(startTest, "RestoreCurrentSnapshot", headers);

    // Then
    verify(CONSOLE).restoreSnapshot(any(ISnapshot.class));
    verify(MACHINE).getCurrentSnapshot();
    assertEquals(machine, MACHINE_NAME_USED.getValue());
  }