deltaspike-users mailing list archives

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

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

http://deltaspike.apache.org/documentation/test-control.html#MockFrameworks

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

deltaspike.testcontrol.mock-support.allow_mocked_beans=true
deltaspike.testcontrol.mock-support.allow_mocked_producers=true

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/apache-deltaspike.properties') 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 :(

Regards
LF

-- 
Med vänlig hälsning / Best regards

Lars-Fredrik Smedberg

STATEMENT OF CONFIDENTIALITY:
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 itsmeden@gmail.com, and destroy all copies of this
message and any attachments.

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