add Mockito inline dependency #3328
Draft
GitHub Actions / Test report (windows-latest, JDK 17)
failed
Jun 7, 2024 in 0s
1831 tests run, 0 skipped, 3 failed.
Annotations
github-actions / Test report (windows-latest, JDK 17)
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:568)
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, mockResource, mockSlingResponse, mockMapContentResource, mockFileResource.
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 (windows-latest, JDK 17)
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:568)
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, mockFileResource, mockMapContentResource, mockResource, mockSlingResponse.
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 (windows-latest, JDK 17)
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:568)
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): mockFileResource, mockResource, 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