add Mockito inline dependency #3328
Draft
GitHub Actions / Test report (ubuntu-latest, JDK 11)
failed
Jun 7, 2024 in 0s
1831 tests run, 0 skipped, 3 failed.
Annotations
github-actions / Test report (ubuntu-latest, JDK 11)
TestServlets.testEditServlet
Failed to release mocks
This should not happen unless you are using a third-party mock maker
Raw output
org.mockito.exceptions.base.MockitoException:
Failed to release mocks
This should not happen unless you are using a third-party mock maker
at com.adobe.acs.commons.redirectmaps.impl.TestServlets.init(TestServlets.java:235)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
Caused by: org.mockito.exceptions.base.MockitoException:
Mockito couldn't inject mock dependency on field 'private org.apache.sling.api.resource.Resource com.adobe.acs.commons.redirectmaps.models.RedirectMapModel.redirectMap' that is annotated with @InjectMocks in your test,
because there were multiple matching mocks (i.e. fields annotated with @Mock and having matching type): mockSlingRequest, mockSlingResponse, mockFileResource, mockResource, mockMapContentResource.
If you have multiple fields of same type in your class under test then consider naming the @Mock fields identically to the respective class under test's fields, so Mockito can match them by name.
... 2 more
github-actions / Test report (ubuntu-latest, JDK 11)
TestServlets.testRemoveEntryServlet
Failed to release mocks
This should not happen unless you are using a third-party mock maker
Raw output
org.mockito.exceptions.base.MockitoException:
Failed to release mocks
This should not happen unless you are using a third-party mock maker
at com.adobe.acs.commons.redirectmaps.impl.TestServlets.init(TestServlets.java:235)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
Caused by: org.mockito.exceptions.base.MockitoException:
Mockito couldn't inject mock dependency on field 'private org.apache.sling.api.resource.Resource com.adobe.acs.commons.redirectmaps.models.RedirectMapModel.redirectMap' that is annotated with @InjectMocks in your test,
because there were multiple matching mocks (i.e. fields annotated with @Mock and having matching type): mockResource, mockFileResource, mockMapContentResource, mockSlingResponse, mockSlingRequest.
If you have multiple fields of same type in your class under test then consider naming the @Mock fields identically to the respective class under test's fields, so Mockito can match them by name.
... 2 more
github-actions / Test report (ubuntu-latest, JDK 11)
TestServlets.testAddEntryServlet
Failed to release mocks
This should not happen unless you are using a third-party mock maker
Raw output
org.mockito.exceptions.base.MockitoException:
Failed to release mocks
This should not happen unless you are using a third-party mock maker
at com.adobe.acs.commons.redirectmaps.impl.TestServlets.init(TestServlets.java:235)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
Caused by: org.mockito.exceptions.base.MockitoException:
Mockito couldn't inject mock dependency on field 'private org.apache.sling.api.resource.Resource com.adobe.acs.commons.redirectmaps.models.RedirectMapModel.redirectMap' that is annotated with @InjectMocks in your test,
because there were multiple matching mocks (i.e. fields annotated with @Mock and having matching type): mockResource, mockFileResource, mockSlingResponse, mockSlingRequest, mockMapContentResource.
If you have multiple fields of same type in your class under test then consider naming the @Mock fields identically to the respective class under test's fields, so Mockito can match them by name.
... 2 more
Loading