1
我得到一个空指针异常。当我嘲笑一个链式方法调用时,Powermock链式方法调用在最后一类
我的代码看起来像这样:
@RunWith(PowerMockRunner.class)
@PrepareForTest({Comment.class, CommentThread.class})
public class YoutubeTest {
@Test
public void testSortCommentsByDate() {
Comment youtubeCommentOne = PowerMockito.mock(Comment.class); // This is a final class
Mockito.when(youtubeCommentOne.getSnippet().getUpdatedAt().getValue()).thenReturn(youtubeCommentOneDate);
}
什么我错在这里做什么?
感谢您的帮助。那正是我的问题。 – LupoZ