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(10);

  @Autowired
  private SimpleApplication application;

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

@@ -81,66 +81,11 @@
 nit.
-Rule;%0Aimport org.junit.Test;%0Aimport org.junit.rules.Timeou
+Tes
 t;%0Ai
@@ -236,24 +236,74 @@
 ngBootTest;%0A
+import org.springframework.test.annotation.Timed;%0A
 import org.s
@@ -478,65 +478,8 @@
  %7B%0A%0A
-  @Rule%0A  public Timeout timeout = Timeout.seconds(10);%0A%0A
   @A
@@ -533,16 +533,16 @@
 n;%0A%0A
-
   @Test%0A
   pu
@@ -537,16 +537,45 @@
   @Test%0A
+  @Timed(millis = 10 * 1000)%0A
   public

use spring @Timed (hopefully) fixes #144