deltaspike-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gerhard Petracek <gerhard.petra...@gmail.com>
Subject Re: CDITestRunner and mocks
Date Tue, 15 Sep 2015 15:28:22 GMT
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 <jpochat@axway.com>:

> 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.
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message