mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-09-03 04:26:12 +08:00
Automatically disable DevTools when running a Cucumber test
Closes gh-6412
This commit is contained in:
parent
e9c69f261d
commit
a6f443a953
@ -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",
|
||||
|
Loading…
Reference in New Issue
Block a user