@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
プロパティを定義できます。defined
または random
ポートでリッスンしている完全に実行されている Web サーバーを開始する機能を含む、さまざまな webEnvironment
モードのサポートを提供します。TestRestTemplate
および / または WebTestClient
Bean を登録します。ContextConfiguration
修飾子と型 | オプションの要素と説明 |
---|---|
ClassSE<?>[] | classes ApplicationContext のロードに使用するアノテーション付きクラス。 |
StringSE[] | properties テストの実行前に Spring Environment に追加する必要がある key = value 形式のプロパティ。 |
StringSE[] | value properties() のエイリアス。 |
SpringBootTest.WebEnvironment | webEnvironment 該当する場合に作成する Web 環境の型。 |
@AliasFor(value="properties") public abstract StringSE[] value
properties()
のエイリアス。@AliasFor(value="value") public abstract StringSE[] properties
Environment
に追加する必要がある key = value 形式のプロパティ。public abstract ClassSE<?>[] classes
ApplicationContext
のロードに使用するアノテーション付きクラス。@ContextConfiguration(classes=...)
を使用して指定することもできます。明示的なクラスが定義されていない場合、テストは SpringBootConfiguration
検索にフォールバックする前に、ネストされた @Configuration
クラスを検索します。ContextConfiguration.classes()
public abstract SpringBootTest.WebEnvironment webEnvironment
SpringBootTest.WebEnvironment.MOCK
です。Copyright © 2019 Pivotal Software, Inc.. All rights reserved.