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