【发布时间】:2018-08-21 23:26:18
【问题描述】:
我正在尝试模拟一个静态方法
StaticClass.staticMethod(id).setContentType("text/plain").build();
我能够使用 PowerMockito 模拟静态方法及其返回类型,如下所示:
PowerMockito.when(StaticClass.staticMethod(id)).thenReturn(returnValue);
但是如何将该值发送到链式方法 setContentType()?
【问题讨论】:
标签: java junit static powermock powermockito