Thanks for quick reply Brice,
I take your comments for granted.
However I'm already using PowerMock and used it to prepare the
Context.class. But no luck.
On Oct 6, 2:12 pm, Brice Dutheil <
brice.duth...@gmail.com> wrote:
> Hi,
>
> Before answering your question I must remind you this guideline : Don't mock
> type you don't own!
> And your test setup seems to be a bit complex, you might want to simplify
> it. Using many mocks in one test method seems like a test smell in my
> opinion.
>
> So, for the answer : Mockito can't mock final methods/classes, it's
> explained in the faq :)
>
> Context.evaluateReader(...) seems to be final according to the source herehttp://
www.java2s.com/Open-Source/Java-Document/Scripting/rhino-1.7/o...
>
> As you are already using powermock, I suggest to use it to prepare
> Context.class.
> --
> Brice
>