Add unit tests for PageListItemLabelsUseCase - #11281
Conversation
|
You can test the changes on this Pull Request by downloading the APK here. |
jd-alexander
left a comment
There was a problem hiding this comment.
Hi @malinajirka great test suite! It works as intended! Based on the comments I made on the page item labels PR, this one might get updated with more tests depending on your thoughts. So once you respond about to this, we can move forward here.
Tests updated in e8ce3a0. I decided to replace the static access to UploadUtils with an injectable wrapper. These tests are supposed to be unit test testing only I created a ticket #11285 - for adding unit tests for the UploadUtils method. It's ready for another round, thanks! |
There was a problem hiding this comment.
Thanks for these changes @malinajirka! Looks good!
For some reason when I am running the test locally I am getting this exception.
org.mockito.exceptions.base.MockitoException:
Mockito cannot mock this class: class org.wordpress.android.ui.uploads.UploadUtilsWrapper.
Can not mock final classes with the following settings :
- explicit serialization (e.g. withSettings().serializable())
- extra interfaces (e.g. withSettings().extraInterfaces(...))
You are seeing this disclaimer because Mockito is configured to create inlined mocks.
You can learn about inline mocks and their limitations under item #39 of the Mockito class javadoc.
I am going to look into my setup to see if it might be causing the issue; possibly the JDK. Will merge these changes since the test are passing fine 🚢
That's quite weird. I have no idea what might be causing this issue. I've double checked it and I don't see such exception on my end. |
Adds unit tests for #11278
Review instruction
PR submission checklist:
RELEASE-NOTES.txtif necessary.