weblog

技術的なメモ置き場。

2018-01-28から1日間の記事一覧

PowerMock + Mockitoでstaticメソッドをモック化

以下のバージョンを使用 PowerMock:1.7.3 Mockito:2.8.9 // モック化するクラス public class StaticFoo { public static String staticMethod() { return "bar"; } } // テストケース @RunWith(PowerMockRunner.class) // 1 @PrepareForTest(StaticFoo.clas…