@TargetSE(valueSE=TYPESE) @RetentionSE(valueSE=RUNTIMESE) @DocumentedSE @InheritedSE @BootstrapWith(value=SpringBootTestContextBootstrapper.class) @ExtendWith(value=org.springframework.test.context.junit.jupiter.SpringExtension.class) public @interface SpringBootTest
@ContextConfiguration(loader=...) が定義されていない場合、SpringBootContextLoader をデフォルトの ContextLoader として使用します。@Configuration が使用されておらず、明示的な classes が指定されていない場合、@SpringBootConfiguration を自動的に検索します。properties attribute を使用して、カスタム Environment プロパティを定義できます。args attribute を使用してアプリケーション引数を定義できます。defined または random ポートでリッスンしている完全に実行されている Web サーバーを開始する機能を含む、さまざまな webEnvironment モードのサポートを提供します。完全に実行されている Web サーバーを使用している Web テスト用に次の Bean を登録できます。
TestRestTemplateWebTestClientHttpGraphQlTesterContextConfiguration| 修飾子と型 | オプションの要素と説明 |
|---|---|
StringSE[] | args テスト対象のアプリケーションに渡す必要のあるアプリケーション引数。 |
ClassSE<?>[] | classesApplicationContext のロードに使用するコンポーネントクラス。 |
StringSE[] | properties テストの実行前に Spring Environment に追加する必要がある key = value 形式のプロパティ。 |
StringSE[] | valueproperties() のエイリアス。 |
SpringBootTest.WebEnvironment | webEnvironment 該当する場合に作成する Web 環境の型。 |
@AliasFor(value="properties") public abstract StringSE[] value
properties() のエイリアス。@AliasFor(value="value") public abstract StringSE[] properties
Environment に追加する必要がある key = value 形式のプロパティ。public abstract StringSE[] args
ApplicationArguments, SpringApplication.run(String...)public abstract ClassSE<?>[] classes
ApplicationContext のロードに使用するコンポーネントクラス。@ContextConfiguration(classes=...) を使用して指定することもできます。明示的なクラスが定義されていない場合、テストは、@SpringBootConfiguration 検索にフォールバックする前に、ネストされた @Configuration クラスを探します。ContextConfiguration.classes()public abstract SpringBootTest.WebEnvironment webEnvironment
SpringBootTest.WebEnvironment.MOCK です。