-
Task
-
Resolution: Fixed
-
L3 - Default
-
None
Acceptance Criteria (Required on creation):
- The test sometimes fails with
RepositoryService$$EnhancerByMockitoWithCGLIB$$66a546dc cannot be returned by getIdentityService() getIdentityService() should return IdentityService *** If you're unsure why you're getting above error read on. Due to the nature of the syntax above problem might occur because: 1. This exception *might* occur in wrongly written multi-threaded tests. Please refer to Mockito FAQ on limitations of concurrency testing. 2. A spy is stubbed using when(spy.foo()).then() syntax. It is safer to stub spies - - with doReturn|Throw() family of methods. More in javadocs for Mockito.spy() method.
Hints (Optional):
- My assumption is that there is some kind of race condition between Tomcat using the Mocks (e.g. by calling the servlet filters and the test setting them up in @Before)
- e.g. https://ci.cambpm.camunda.cloud/view/all/job/7.14/view/Broken/job/7.14-engine-rest-UNIT-resteasy3/ fails with this, also the resteasy profile
- In the two example failures I saw, this was in NoServletAuthenticationFilterTest.testFailingAuthenticationCheck