@TargetSE(valueSE=TYPESE) @RetentionSE(valueSE=RUNTIMESE) @DocumentedSE @InheritedSE @BootstrapWith(value=org.springframework.boot.test.autoconfigure.webservices.client.WebServiceClientTestContextBootstrapper.class) @ExtendWith(value=org.springframework.test.context.junit.jupiter.SpringExtension.class) @OverrideAutoConfiguration(enabled=false) @TypeExcludeFilters(value=WebServiceClientExcludeFilter.class) @AutoConfigureCache @AutoConfigureMockWebServiceServer @AutoConfigureWebServiceClient @ImportAutoConfiguration public @interface WebServiceClientTest
WebServiceTemplateBuilder
を使用する Bean のみに焦点を当てている場合に使用できます。デフォルトでは、WebServiceClientTest
でアノテーションが付けられたテストも MockWebServiceServer
を自動構成します。WebServiceTemplateBuilder
を使用せず、代わりに WebServiceTemplate
を直接注入する Bean をテストする場合は、@AutoConfigureWebServiceClient(registerWebServiceTemplate=true)
を追加できます。
JUnit 4 を使用する場合、このアノテーションは @RunWith(SpringRunner.class)
と組み合わせて使用する必要があります。
修飾子と型 | オプションの要素と説明 |
---|---|
ClassSE<?>[] | components テストするコンポーネントを指定します。 |
ClassSE<?>[] | excludeAutoConfiguration このテストに適用する必要がある自動構成の除外。 |
ComponentScan.Filter[] | excludeFilters それ以外の場合はアプリケーションコンテキストに追加される Bean のフィルタリングに使用できる除外フィルターのセット。 |
ComponentScan.Filter[] | includeFilters 他の方法でフィルタリングされた Bean をアプリケーションコンテキストに追加するために使用できる一連の組み込みフィルター。 |
StringSE[] | properties テストの実行前に Spring Environment に追加する必要がある key = value 形式のプロパティ。 |
boolean | useDefaultFilters @SpringBootApplication でデフォルトのフィルタリングを使用するかどうかを決定します。 |
ClassSE<?>[] | value テストするコンポーネントを指定します。 |
public abstract StringSE[] properties
Environment
に追加する必要がある key = value 形式のプロパティ。@AliasFor(value="components") public abstract ClassSE<?>[] value
components()
のエイリアスであり、他の属性が定義されていない場合に簡潔にするために使用できます。詳細については、components()
を参照してください。components()
public abstract boolean useDefaultFilters
@SpringBootApplication
で使用するかどうかを決定します。デフォルトでは、@JsonComponent
および Module
Bean のみが含まれています。includeFilters()
, excludeFilters()
public abstract ComponentScan.Filter[] includeFilters
public abstract ComponentScan.Filter[] excludeFilters
@AliasFor(annotation=ImportAutoConfiguration.class, attribute="exclude") public abstract ClassSE<?>[] excludeAutoConfiguration