Switch @SpringBootTest to UseMainMethod.NEVER by default

See gh-22405
This commit is contained in:
Phillip Webb
2022-09-15 12:37:26 -07:00
parent 48f3cd75d4
commit 7f5785182d
12 changed files with 17 additions and 139 deletions

View File

@@ -131,7 +131,7 @@ public @interface SpringBootTest {
* @return the type of main method usage
* @since 3.0.0
*/
UseMainMethod useMainMethod() default UseMainMethod.WHEN_AVAILABLE;
UseMainMethod useMainMethod() default UseMainMethod.NEVER;
/**
* An enumeration web environment modes.

View File

@@ -55,7 +55,7 @@ class SpringBootTestAnnotation implements ContextCustomizer {
private SpringBootTestAnnotation(SpringBootTest annotation) {
this.args = (annotation != null) ? annotation.args() : NO_ARGS;
this.webEnvironment = (annotation != null) ? annotation.webEnvironment() : WebEnvironment.NONE;
this.useMainMethod = (annotation != null) ? annotation.useMainMethod() : UseMainMethod.WHEN_AVAILABLE;
this.useMainMethod = (annotation != null) ? annotation.useMainMethod() : UseMainMethod.NEVER;
}
@Override