Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
各junitテストが実行された後、SpringがBeanを再作成し、再自動配線するという問題があります。テストクラスのポストコンストラクトで、Springにこれを1回だけ実行させたいのですが、これは私が設定したものです。
@DirtiesContext クラス モードを AFTER_CLASS に設定してみましたが、それでも問題は解決しませんでした。
何か案は?
乾杯。
クラスを作成できます。
@SpringJUnitConfig(classes = {ConfigClassOne.class, ConfigClassTwo.class, ConfigClassThree.class}) public abstract class ModelTest {}
テストクラスでそれを拡張します。アプリケーションコンテキストはすでにアノテーションで言及されているため、Bean は再作成されません。