mp911de / CleanArchitecture

CleanArchitecture Example
228 stars 68 forks source link

fix missing mock initialization in test #3

Closed euZebe closed 7 years ago

euZebe commented 7 years ago

Add mock initialization in test PlaceOrderImplTest. testPlaceOrderItemNotFound()

The lack of this call generates a test failure when using Optional instead of returning null in ItemRepository find method. This can be seen in the fork https://github.com/euzebe/cleanarchitecture, master branch.

mp911de commented 7 years ago

Thanks for your Pull-Request. That's rather an issue of Mockito and related to your own changes. I'd rather upgrade to Mockito 2.

mp911de commented 7 years ago

I upgraded to Mockito 2.6.8. Can you re-try you code with the update whether the fix solves your issue?

euZebe commented 7 years ago

OK, I missunderstood what was expected in this test. Sorry for that.