deltaspike-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lars-Fredrik Smedberg <>
Subject Trying mocks using Deltaspike Test Control
Date Thu, 04 May 2017 06:54:44 GMT

I'm new to using Deltaspike Test Control (1.7.2) and trying to use Mockito
mocks as explained in

I my META-INF (which is on the classpath when running the tests) I have the
beans.xml and that contains


When calling ...addMock(...) on the injected DynamicMockManager I get the
following error message

java.lang.IllegalStateException: The support for mocked CDI-Beans is
disabled due to a reduced portability across different CDI-implementations.
Please set 'deltaspike.testcontrol.mock-support.allow_mocked_beans' and/or
'deltaspike.testcontrol.mock-support.allow_mocked_producers' to 'true' (in
'META-INF/') on your test-classpath.

Running tests using test control without mocks works fine...

Can anyone see what I'm doing wrong or what I'm missing? Probably something
easy!!.... been using Weld JUnit Extensions and CDIUnit before but never
Test Control :(


Med vänlig hälsning / Best regards

Lars-Fredrik Smedberg

The information contained in this electronic message and any
attachments to this message are intended for the exclusive use of the
address(es) and may contain confidential or privileged information. If
you are not the intended recipient, please notify Lars-Fredrik Smedberg
immediately at, and destroy all copies of this
message and any attachments.

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