Commit a6f443a9 authored by Andy Wilkinson's avatar Andy Wilkinson

Automatically disable DevTools when running a Cucumber test

Closes gh-6412
parent e9c69f26
......@@ -28,6 +28,7 @@ import java.util.Set;
* exploded) or when running from a test.
*
* @author Phillip Webb
* @author Andy Wilkinson
* @since 1.3.0
*/
public class DefaultRestartInitializer implements RestartInitializer {
......@@ -38,6 +39,7 @@ public class DefaultRestartInitializer implements RestartInitializer {
Set<String> skipped = new LinkedHashSet<String>();
skipped.add("org.junit.runners.");
skipped.add("org.springframework.boot.test.");
skipped.add("cucumber.runtime.");
SKIPPED_STACK_ELEMENTS = Collections.unmodifiableSet(skipped);
}
......
......@@ -27,6 +27,7 @@ import static org.hamcrest.Matchers.nullValue;
* Tests for {@link DefaultRestartInitializer}.
*
* @author Phillip Webb
* @author Andy Wilkinson
*/
public class DefaultRestartInitializerTests {
......@@ -80,6 +81,11 @@ public class DefaultRestartInitializerTests {
testSkipStack("org.springframework.boot.test.Something", true);
}
@Test
public void skipsDueToCucumber() throws Exception {
testSkipStack("cucumber.runtime.Runtime.run", true);
}
private void testSkipStack(String className, boolean expected) {
MockRestartInitializer initializer = new MockRestartInitializer(true);
StackTraceElement element = new StackTraceElement(className, "someMethod",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment