package org.camunda.bpm.spring.boot.starter.example.cloud.simple;

import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.Timeout;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

@RunWith(SpringRunner.class)
@SpringBootTest(classes = { SimpleApplication.class })
public class SimpleApplicationTest {

  @Rule
  public Timeout timeout = Timeout.seconds(5);

  @Autowired
  private SimpleApplication application;

  @Test
  public void would_fail_if_process_not_completed_after_5_seconds() throws InterruptedException {
    while (!application.contextClosed && !application.isProcessInstanceFinished()) {
      Thread.sleep(500L);
    }
  }
}

@@ -530,17 +530,18 @@
 seconds(
-5
+10
 );%0A%0A  @A
@@ -655,17 +655,18 @@
 d_after_
-5
+10
 _seconds

increase timeout, (hopefully) fixes #144