Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add Mockito inline dependency #3328

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

add mockito inline

7d5a280
Select commit
Loading
Failed to load commit list.
Sign in for the full log view
Draft

add Mockito inline dependency #3328

add mockito inline
7d5a280
Select commit
Loading
Failed to load commit list.
GitHub Actions / Test report (ubuntu-latest, JDK 11) failed Jun 7, 2024 in 0s

1831 tests run, 0 skipped, 3 failed.

Annotations

Check failure on line 235 in bundle/src/test/java/com/adobe/acs/commons/redirectmaps/impl/TestServlets.java

See this annotation in the file changed.

@github-actions 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

Check failure on line 235 in bundle/src/test/java/com/adobe/acs/commons/redirectmaps/impl/TestServlets.java

See this annotation in the file changed.

@github-actions 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

Check failure on line 235 in bundle/src/test/java/com/adobe/acs/commons/redirectmaps/impl/TestServlets.java

See this annotation in the file changed.

@github-actions 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