hi, ApplicationMockManager#addMock just works in @BeforeClass callbacks. everything else isn't portable across cdi-containers.
regards, gerhard http://www.irian.at Your JavaEE powerhouse - JavaEE Consulting, Development and Courses in English and German Professional Support for Apache MyFaces, DeltaSpike and OpenWebBeans 2015-09-15 16:25 GMT+02:00 Jérôme Pochat <[email protected]>: > Hi DeltaSpike users > > I'm facing issue with running multiple unit tests with CDITestRunner: > - CDI container is not restarted between tests because ScanService > consumes lot of time as there a lot of tests. > - Foo service depends on Bar service > - Foo and Bar are ApplicationScoped services > > Foo unit test: > - inject Foo reference > - register Bar mock using ApplicationMockManager > > Bar unit test: > - inject Bar reference ==> previous Bar mock is injected :-( > > How to unregister ApplicationScoped mock from CDI container? > > Any tips that could help me? > Thanks in advance. >
