@Test
  public void should_fail_to_close_more_than_once() {
    final ProcessEngine processEngine = processEngineConfiguration.buildProcessEngine();
    delegate = new ProcessEngineDelegate(processEngine);
    delegate.closeProcessEngine();

    thrown.expect(IllegalStateException.class);
    delegate.closeProcessEngine();
  }
  @Test
  public void should_fail_to_re_initialize_engine_after_close_when_configuration() {

    final ProcessEngine processEngine = processEngineConfiguration.buildProcessEngine();
    delegate = new ProcessEngineDelegate(processEngine);

    delegate.closeProcessEngine();
    assertThat(delegate.isInitialized(), is(false));

    delegate.initProcessEngine();
    assertThat(delegate.isInitialized(), is(true));
  }