@Component注釈付きのクラスを除外することは可能ですか?
JUnit テストから特別なクラスを除外したいと考えています。
私のプロジェクトには でxEventHandler注釈が付けられたクラスが@Componentあり、junit テスト中にこのクラスを使用したくありません。
私の ApplicationTestContext.xml は次のようになります。
<context:component-scan base-package="com.company">
...
<context:exclude-filter expression="com\.company\.xyz\.xEventHandler.java " type="regex"/>
...
</context:component-scan>
ただし、@Component注釈のためにクラスが入力されます(たとえば、そのクラスからを削除すると機能@Componentします)。
どうすれば修正できますか?