本文整理汇总了Java中org.powermock.api.mockito.PowerMockito.verifyNoMoreInteractions方法的典型用法代码示例。如果您正苦于以下问题:Java PowerMockito.verifyNoMoreInteractions方法的具体用法?Java PowerMockito.verifyNoMoreInteractions怎么用?Java PowerMockito.verifyNoMoreInteractions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.powermock.api.mockito.PowerMockito
的用法示例。
在下文中一共展示了PowerMockito.verifyNoMoreInteractions方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getTypeFaceFromAssetsTest
import org.powermock.api.mockito.PowerMockito; //导入方法依赖的package包/类
@Test
public void getTypeFaceFromAssetsTest() throws Exception {
PowerMockito.mockStatic(Typeface.class);
when(mMockContext.getAssets()).thenReturn(mMockedAssetManager);
when(Typeface.createFromAsset(mMockedAssetManager, ASSET_PATH)).thenReturn(mMockedTypeFace);
Typeface typeface = mTypeFaceProvider.getTypeFaceFromAssets(ASSET_PATH);
PowerMockito.verifyStatic(times(1));
assert (typeface == mMockedTypeFace);
PowerMockito.verifyNoMoreInteractions();
}
示例2: getTypeFaceFromAssetsFailTest
import org.powermock.api.mockito.PowerMockito; //导入方法依赖的package包/类
@Test
public void getTypeFaceFromAssetsFailTest() throws Exception {
PowerMockito.mockStatic(Typeface.class);
PowerMockito.mockStatic(Log.class);
when(mMockContext.getAssets()).thenReturn(mMockedAssetManager);
when(Typeface.createFromAsset(mMockedAssetManager, ASSET_PATH)).thenThrow(new RuntimeException());
when(Log.e(anyString(), anyString())).thenReturn(1);
Typeface typeface = mTypeFaceProvider.getTypeFaceFromAssets(ASSET_PATH);
PowerMockito.verifyStatic(times(2));
assert (typeface == null);
PowerMockito.verifyNoMoreInteractions();
}
示例3: noMoreInteractions
import org.powermock.api.mockito.PowerMockito; //导入方法依赖的package包/类
@Before public void noMoreInteractions() {
PowerMockito.verifyNoMoreInteractions(Thread.class);
}