Do you have any question about this error?
Message type: E = Error
Message class: CDS_UNIT_MESSAGE - Message Class
Message number: 035
Message text: Creation of test doubles is not permitted for &1
Since SAP believes that this specific error message is 'self-explanatory,' no more information has been given.The majority of messages in the SAP system have a message text, however this is frequently insufficient to comprehend or resolve the problem.
To make things easier, more detailed information is frequently added to describe the issue, how to fix it, and the necessary steps or configuration modifications.
Unfortunately, there isn't any extra information in this error notice.
First, use our AnswerBot below to get a possible cause and solution (requires a premium subscription).
Also, review the in-depth Common Questions & Answers listed below; you could discover a solution there or be able to connect with others who have faced similar challenges.
You can also try searching the SAP support portal (support.sap.com) but you need a special user ID to access it. It is possible that an SAP support note exists that provides additional details about the mistake or even steps for fixing it.
CDS_UNIT_MESSAGE035
- Creation of test doubles is not permitted for &1 ?The SAP error message CDS_UNIT_MESSAGE035, which states "Creation of test doubles is not permitted for &1," typically occurs in the context of Core Data Services (CDS) and ABAP Unit testing. This error indicates that the system is trying to create a test double (a mock or stub) for a CDS view or entity that does not allow it.
Cause:
The primary cause of this error is that the CDS view or entity you are trying to test is not designed to support test doubles. This can happen for several reasons:
- Non-Deterministic Behavior: The CDS view may have non-deterministic behavior or dependencies on database state that cannot be easily mocked.
- Complex Logic: The logic within the CDS view may be too complex or involve database operations that are not suitable for unit testing.
- Restrictions in CDS: Certain CDS features or annotations may restrict the ability to create test doubles.
Solution:
To resolve this error, consider the following approaches:
Refactor the Code: If possible, refactor the logic in your CDS view to make it more testable. This might involve breaking down complex views into simpler components that can be tested individually.
Use Integration Tests: Instead of unit tests with test doubles, consider using integration tests that run against a real database. This way, you can validate the behavior of the CDS view without needing to create test doubles.
Check Annotations: Review the annotations used in your CDS view. Some annotations may prevent the creation of test doubles. Ensure that the view is designed with testability in mind.
Mocking Alternatives: If you need to test the logic that depends on the CDS view, consider mocking the service or class that consumes the CDS view instead of the view itself.
Consult Documentation: Refer to the SAP documentation for any specific guidelines or limitations regarding unit testing with CDS views.
Related Information:
By following these steps, you should be able to address the CDS_UNIT_MESSAGE035 error and improve the testability of your CDS views.
Get instant SAP help. Start your 7-day free trial now.
CDS_UNIT_MESSAGE034
Session variable '&1' is not valid
Self-Explanatory Message Since SAP believes that this specific error message is 'self-explanatory,' no more information has been given.The majority of...
CDS_UNIT_MESSAGE033
&1 is mentioned more than once as CDS under test.
Self-Explanatory Message Since SAP believes that this specific error message is 'self-explanatory,' no more information has been given.The majority of...
CDS_UNIT_MESSAGE100
Insertion failed. Source type '&1' does not match target type '&2'
Self-Explanatory Message Since SAP believes that this specific error message is 'self-explanatory,' no more information has been given.The majority of...
CDS_UNIT_MESSAGE101
&1
Self-Explanatory Message Since SAP believes that this specific error message is 'self-explanatory,' no more information has been given.The majority of...
Click on this link to search all SAP messages.