On Jul 24, 3:09 pm, Johan Haleby <
johan.hal...@gmail.com> wrote:
> Sorry I didn't read your message close enough. I guess it was just what I
> suspected, when you place the @PrepareForTest method at the method-level
> which causes a new junit runner to be created the @BeforeClass method is
> executed again. I'm not sure whether we should consider this a bug or not
> since this is currently how PowerMock behaves (i.e. create a new junit
> runner per @PrepareForTest annotated method). If we were not to execute the
> @BeforeClass then you may have some uninitialized state in your test.. Hmm
> I'll add it as an issue and we'll think about what to do about it (we're
> about the refactor this mechanism entirely for version 1.3).
>
> Nevertheless, in your example you should definitely place the PrepareForTest
> annotation at the class-level of your test.
>