クラス EnabledIfCondition
java.lang.ObjectSE
org.springframework.test.context.junit.jupiter.EnabledIfCondition
- 実装されているすべてのインターフェース:
ExecutionCondition, Extension
EnabledIfCondition は、JUnit Jupiter テストフレームワークと組み合わせて Spring TestContext フレームワークを使用するときに @EnabledIf アノテーションをサポートする ExecutionCondition です。@EnabledIf が存在しない状態で EnabledIfCondition を使用しようとすると、ConditionEvaluationResult が有効になります。
- 導入:
- 5.0
- 作成者:
- Sam Brannen
- 関連事項:
コンストラクターの概要
コンストラクター方法の概要
修飾子と型メソッド説明protected <A extends AnnotationSE>
ConditionEvaluationResultevaluateAnnotation(ClassSE<A> annotationType, FunctionSE<A, StringSE> expressionExtractor, FunctionSE<A, StringSE> reasonExtractor, FunctionSE<A, BooleanSE> loadContextExtractor, boolean enabledOnTrue, ExtensionContext context) 提供されたExtensionContextについて、AnnotatedElementSE の提供されたアノテーション型を介して構成された式を評価します。対応するテストクラスまたはテストメソッドに@EnabledIfが存在し、構成された式がtrueと評価される場合、コンテナーとテストが有効になります。
コンストラクターの詳細
EnabledIfCondition
public EnabledIfCondition()
メソッドの詳細
evaluateExecutionCondition
対応するテストクラスまたはテストメソッドに@EnabledIfが存在し、構成された式がtrueと評価される場合、コンテナーとテストが有効になります。evaluateAnnotation
protected <A extends AnnotationSE> ConditionEvaluationResult evaluateAnnotation(ClassSE<A> annotationType, FunctionSE<A, StringSE> expressionExtractor, FunctionSE<A, StringSE> reasonExtractor, FunctionSE<A, BooleanSE> loadContextExtractor, boolean enabledOnTrue, ExtensionContext context) 提供されたExtensionContextについて、AnnotatedElementSE の提供されたアノテーション型を介して構成された式を評価します。- パラメーター:
annotationType- 処理するアノテーションの型expressionExtractor- アノテーションから式を抽出する関数reasonExtractor- アノテーションから理由を抽出する関数loadContextExtractor- アノテーションからloadContextフラグを抽出する関数enabledOnTrue- 式がtrueと評価された場合、返されるConditionEvaluationResultがenabledであるかどうかを示しますcontext-ExtensionContext- 戻り値:
- コンテナーまたはテストを有効にする場合は
enabled。それ以外の場合はdisabled