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