Do you have a setter method for “observable” in ClubConfig? I would think that @InjectMocks would need that.
It might be worthwhile executing this code in the debugger. Run it both with and without the base class. When it gets into your CUT (code under test), look at the value of your “observable” variable. I think in one case it’s going to look like a normal “Observable” instance, but in the other it’s going to look like a mocked object. This will mostly just confirm what you’re seeing, but it’s useful to confirm this.
I would guess the complication is your initialization of the “observable” variable in the implicit constructor. It almost seems like in the failure case, the constructor initialization is happening AFTER the mock is injected, but that makes no sense.
--
You received this message because you are subscribed to the Google Groups "mockito" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
mockito+u...@googlegroups.com.
To post to this group, send email to moc...@googlegroups.com.
Visit this group at http://groups.google.com/group/mockito.
For more options, visit https://groups.google.com/groups/opt_out.