Я бы предположил, что следующий тест должен пройти, но исключение никогда не выдается. Любые подсказки?
@RunWith(PowerMockRunner.class)
@PrepareForTest(StaticService.class)
public class TestStuff {
@Test(expected = IllegalArgumentException.class)
public void testMockStatic() throws Exception {
mockStatic(StaticService.class);
doThrow(new IllegalArgumentException("Mockerror")).when(StaticService.say("hello"));
verifyStatic();
StaticService.say("hello");
}
}