You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's trying to call a super class constructor from within an injected method (and the constructor itself is now no longer calling its super class constructor).
This results in build errors.
Root cause
In this particular class the code instrumenter treated the constructor of a test class like a regular method and attempted to add per-test instrumentation, rewriting the constructor code to a helper method.
Workaround
Configure proper test patterns for the test detector. For example, to omit all inner classes, or to instrument only methods having given name or annotation. For example:
The text was updated successfully, but these errors were encountered:
marek-parfianowicz
changed the title
Test instrumentation of class constructors
Incorrect instrumentation of class constructors in test classes
Mar 14, 2024
For the following test source:
This is resulting in the following instrumented test code:
It's trying to call a super class constructor from within an injected method (and the constructor itself is now no longer calling its super class constructor).
This results in build errors.
Root cause
In this particular class the code instrumenter treated the constructor of a test class like a regular method and attempted to add per-test instrumentation, rewriting the constructor code to a helper method.
Workaround
Configure proper test patterns for the test detector. For example, to omit all inner classes, or to instrument only methods having given name or annotation. For example:
@Test
annotationtest
.*Test
References:
The text was updated successfully, but these errors were encountered: