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
I started to integrate jcabi-aspects into an already built Spring application with JSR-303 Hibernate-Validator based annotations. The @loggable seems to work displaying the time, etc. But the existing TestNG test cases fail at weird code locations. Weird since the @NotNull annotation should not fail because a properly mocked instance of the argument is being passed in the test. I can verify this by removing the ajc plugin from the build->plugins in pom.xml and running the test. Of course, everything works properly.
I am not sure why the MethodValidator of jcabi is being invoked at the stack trace below. Please let me know what I should check. Thanks!!
I am using jcabi-aspects v.0.22.5 and aspectjrt v.1.5.4
**javax.validation.ConstraintViolationException: may not be null**
at com.jcabi.aspects.aj.MethodValidator.checkForViolations(MethodValidator.java:189)
at com.jcabi.aspects.aj.MethodValidator.validateMethod(MethodValidator.java:154)
at com.jcabi.aspects.aj.MethodValidator.beforeMethod(MethodValidator.java:87)
at ...
I also see this in the logs for init JMockit mocks ...
---
FAILED CONFIGURATION: @BeforeMethod xxx
org.mockito.exceptions.misusing.InvalidUseOfMatchersException:
Misplaced argument matcher detected here:
-> at ....
You cannot use argument matchers outside of verification or stubbing.
Examples of correct usage of argument matchers:
when(mock.get(anyInt())).thenReturn(null);
doThrow(new RuntimeException()).when(mock).someVoidMethod(anyObject());
verify(mock).someMethod(contains("foo"))
Also, this error might show up because you use argument matchers with methods that cannot be mocked.
Following methods _cannot_ be stubbed/verified: final/private/equals()/hashCode().
Mocking methods declared on non-public parent classes is not supported.
The text was updated successfully, but these errors were encountered:
I started to integrate jcabi-aspects into an already built Spring application with JSR-303 Hibernate-Validator based annotations. The @loggable seems to work displaying the time, etc. But the existing TestNG test cases fail at weird code locations. Weird since the @NotNull annotation should not fail because a properly mocked instance of the argument is being passed in the test. I can verify this by removing the ajc plugin from the build->plugins in pom.xml and running the test. Of course, everything works properly.
I am not sure why the MethodValidator of jcabi is being invoked at the stack trace below. Please let me know what I should check. Thanks!!
I am using jcabi-aspects v.0.22.5 and aspectjrt v.1.5.4
I also see this in the logs for init JMockit mocks ...
The text was updated successfully, but these errors were encountered: