mock cdi interceptors during junit tests


Staff member
I have a complex Java EE 6 app with a web module, an EJB module and some utility jars.

I want to do some integration tests with Junit. Therefore I use the openwebbeans cdi container (Thanks to Mr. Struberg <a href="" rel="nofollow"></a>)
It works perfectly. I can start a complete cdi container in a Junit test.

My problem is that I have some interceptors in my application which cannot run in a Junit test (MQ-, persistence- and transaction-interceptors). So I want to mock these interceptor implementations.

Does anybody know how to do this?