jeudi 4 février 2021

Mockito and ScopedModel

I'm trying to fix a test since I have implemented ScopedModelDescendant to get data to fill up my page with information for the user.

The issue I'm facing is that it seems I can not mock ScopedModel with mockito. Somehow is asking me to specify some properties which does not occur with other classes I have been mocking so far.

this is my build for the widget

This is how my app is being configured

enter image description here

So far so good, my app is working properly and I can invoke ScopedModelDescendant anywhere without injecting anything in my widgets. But when running my test I'm getting this error

enter image description here

And this is how I'm configuring my test

enter image description here

I know I should be doinng something like this

class MockScopedModel extends Mock implements ScopedModel<MockMainModel>{}

But if I do that in order to mock sopedModel I get this error/warning

enter image description here

Does anyone know how to mock the scopedModel properly? Am I missing something here?

Aucun commentaire:

Enregistrer un commentaire