|
|
|
@ -1,5 +1,5 @@
|
|
|
|
|
/*
|
|
|
|
|
* Copyright 2012-2018 the original author or authors.
|
|
|
|
|
* Copyright 2012-2019 the original author or authors.
|
|
|
|
|
*
|
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
@ -25,6 +25,7 @@ import java.lang.annotation.Target;
|
|
|
|
|
|
|
|
|
|
import org.junit.jupiter.api.extension.ExtendWith;
|
|
|
|
|
|
|
|
|
|
import org.springframework.boot.ApplicationArguments;
|
|
|
|
|
import org.springframework.boot.SpringApplication;
|
|
|
|
|
import org.springframework.boot.SpringBootConfiguration;
|
|
|
|
|
import org.springframework.boot.WebApplicationType;
|
|
|
|
@ -55,6 +56,8 @@ import org.springframework.web.context.WebApplicationContext;
|
|
|
|
|
* specified.</li>
|
|
|
|
|
* <li>Allows custom {@link Environment} properties to be defined using the
|
|
|
|
|
* {@link #properties() properties attribute}.</li>
|
|
|
|
|
* <li>Allows application arguments to be defined using the {@link #args() args
|
|
|
|
|
* attribute}.</li>
|
|
|
|
|
* <li>Provides support for different {@link #webEnvironment() webEnvironment} modes,
|
|
|
|
|
* including the ability to start a fully running web server listening on a
|
|
|
|
|
* {@link WebEnvironment#DEFINED_PORT defined} or {@link WebEnvironment#RANDOM_PORT
|
|
|
|
@ -93,6 +96,14 @@ public @interface SpringBootTest {
|
|
|
|
|
@AliasFor("value")
|
|
|
|
|
String[] properties() default {};
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Application arguments that should be passed to the application under test.
|
|
|
|
|
* @return the application arguments to pass to the application under test.
|
|
|
|
|
* @see ApplicationArguments
|
|
|
|
|
* @see SpringApplication#run(String...)
|
|
|
|
|
*/
|
|
|
|
|
String[] args() default {};
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The <em>annotated classes</em> to use for loading an
|
|
|
|
|
* {@link org.springframework.context.ApplicationContext ApplicationContext}. Can also
|
|
|
|
@ -106,12 +117,6 @@ public @interface SpringBootTest {
|
|
|
|
|
*/
|
|
|
|
|
Class<?>[] classes() default {};
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Arguments that should be passed to the application under test.
|
|
|
|
|
* @return the arguments to pass to the application under test.
|
|
|
|
|
*/
|
|
|
|
|
String[] args() default {};
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The type of web environment to create when applicable. Defaults to
|
|
|
|
|
* {@link WebEnvironment#MOCK}.
|
|
|
|
|