アノテーションインターフェース AfterTestClass
@RetentionSE(RUNTIMESE)
@TargetSE({METHODSE,ANNOTATION_TYPESE})
@DocumentedSE
@EventListener(AfterTestClassEvent.class)
public @interface AfterTestClass
EventPublishingTestExecutionListener
によって発行された AfterTestClassEvent
を使用するために使用される @EventListener
アノテーション。 このアノテーションは、Spring Test ApplicationContext
内の @EventListener
-compliant メソッドで使用できます。たとえば、@Configuration
クラスのメソッドです。このアノテーションが付けられたメソッドは、TestExecutionListener.afterTestClass(org.springframework.test.context.TestContext)
ライフサイクルの一部として呼び出されます。
イベント処理は、オプションで SpEL 式(@AfterTestClass("event.testContext.testClass.name matches '.+IntegrationTests'")
など)を使用して条件付きにすることができます。
このアノテーションを有効にするには、EventPublishingTestExecutionListener
を登録する必要があります。たとえば、@TestExecutionListeners
経由。ただし、EventPublishingTestExecutionListener
はデフォルトで登録されていることに注意してください。
- 導入:
- 5.2
- 作成者:
- Frank Scheffler, Sam Brannen
- 関連事項:
オプション要素のサマリー
要素の詳細
value
EventListener.condition()
のエイリアス。- デフォルト:
- ""