@TargetSE(valueSE=TYPESE) @RetentionSE(valueSE=RUNTIMESE) @DocumentedSE @InheritedSE @BootstrapWith(value=org.springframework.boot.test.autoconfigure.webservices.server.WebServiceServerTestContextBootstrapper.class) @ExtendWith(value=org.springframework.test.context.junit.jupiter.SpringExtension.class) @OverrideAutoConfiguration(enabled=false) @TypeExcludeFilters(value=WebServiceServerTypeExcludeFilter.class) @AutoConfigureWebServiceServer @AutoConfigureMockWebServiceClient @ImportAutoConfiguration public @interface WebServiceServerTest
このアノテーションを使用すると、完全な自動構成が無効になり、代わりに Web サービスサーバーテストに関連する構成のみが適用されます(つまり、Endpoint
および EndpointInterceptor
Bean は適用されますが、@Component
、@Service
、@Repository
Bean は適用されません)。
通常、WebServiceServerTest
は @MockBean
または @Import
と組み合わせて使用され、Endpoint
Bean に必要なコラボレーターを作成します。
アプリケーション構成全体をロードして MockWebServiceClient を使用する場合は、このアノテーションではなく、@SpringBootTest
と @AutoConfigureMockWebServiceClient
の組み合わせを検討する必要があります。
AutoConfigureMockWebServiceClient
, AutoConfigureWebServiceServer
修飾子と型 | オプションの要素と説明 |
---|---|
ClassSE<?>[] | endpoints テストするエンドポイントを指定します。 |
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="endpoints") public abstract ClassSE<?>[] value
endpoints()
のエイリアスであり、他の属性が定義されていない場合に簡潔にするために使用できます。詳細については、endpoints()
を参照してください。endpoints()
public abstract boolean useDefaultFilters
@SpringBootApplication
で使用するかどうかを決定します。デフォルトでは、@Endpoint
(明示的な controllers
が定義されていない場合)のみが含まれます。includeFilters()
, excludeFilters()
public abstract ComponentScan.Filter[] includeFilters
public abstract ComponentScan.Filter[] excludeFilters
@AliasFor(annotation=ImportAutoConfiguration.class, attribute="exclude") public abstract ClassSE<?>[] excludeAutoConfiguration