public abstract class ApplicationEventsHolder extends ObjectSE
ApplicationEvents
オブジェクトの形式で公開するホルダークラス。ApplicationEvents
はこのホルダーに登録され、ApplicationEventsTestExecutionListener
によって管理されます。
このクラスは public
ですが、Spring TestContext フレームワーク内またはサードパーティの拡張機能の実装での使用のみを目的としています。テスト作成者は、ApplicationEvents
の現在のインスタンスをテストクラスのフィールドに @Autowired
にするか、JUnit Jupiter と SpringExtension
を使用するときに、テストメソッドとライフサイクルメソッドのパラメーターを介して注入できるようにする必要があります。
ApplicationEvents
, RecordApplicationEvents
, ApplicationEventsTestExecutionListener
修飾子と型 | メソッドと説明 |
---|---|
static ApplicationEvents | getApplicationEvents() 現在のスレッドの ApplicationEvents を取得します。 |
static ApplicationEvents | getRequiredApplicationEvents() 現在のスレッドの ApplicationEvents を取得します。 |
cloneSE, equalsSE, finalizeSE, getClassSE, hashCodeSE, notifySE, notifyAllSE, toStringSE, waitSE, waitSE, waitSE
@Nullable public static ApplicationEvents getApplicationEvents()
ApplicationEvents
を取得します。ApplicationEvents
、または登録されていない場合は null
public static ApplicationEvents getRequiredApplicationEvents()
ApplicationEvents
を取得します。ApplicationEvents
IllegalStateExceptionSE
- ApplicationEvents
のインスタンスが現在のスレッドに登録されていない場合