Closed GoogleCodeExporter closed 8 years ago
Corrected a line:
doCallRealMethod().doReturn(false).when(sub).method(DUMMY_STR);
Original comment by hellovid...@gmail.com
on 14 Feb 2014 at 9:47
Corrected Annotation:
Replace @Before with @Test
Original comment by hellovid...@gmail.com
on 14 Feb 2014 at 9:50
Return types of methods in SubClass and SuperClass are different.
Are you sure that there is no more changes?
Original comment by albers...@gmail.com
on 24 Feb 2014 at 11:22
@alberskib is correct, the signature of method is different, so there is no
overriding there, which means you have to stub both methods.
And anyway as you are using the answer that call real method, the bytecode
still reference the method of the super class, there's is no polymorphism when
the `super` keyword is used.
Also I strongly advise you to avoid partial mocks, it can be a
maintainance/evolutivity hell. You may want to refactor your design to use
common behavioral patterns of the GoF, like the *strategy pattern*
I'm invalidating the issue, please raise a comment if you think it's really an
issue.
Thanks for reporting though.
Brice
Original comment by brice.du...@gmail.com
on 4 Mar 2014 at 9:36
Apologies for the delayed response. Signature of both the methods is same. It
was a typo when I posted above example.
Original comment by hellovid...@gmail.com
on 5 Mar 2014 at 3:08
Original issue reported on code.google.com by
hellovid...@gmail.com
on 14 Feb 2014 at 9:42