@RetentionSE(valueSE=RUNTIMESE) @TargetSE(valueSE={METHODSE,ANNOTATION_TYPESE}) @DocumentedSE @EventListener(value=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 を使用します。
AfterTestExecutionEvent| 修飾子と型 | オプションの要素と説明 |
|---|---|
StringSE | valueEventListener.condition() のエイリアス。 |
@AliasFor(annotation=EventListener.class, attribute="condition") public abstract StringSE value
EventListener.condition() のエイリアス。