@Test
public void second_stubbing_throws_IndexOutOfBoundsException() throws Exception {
Map<String, String> map = mock(Map.class);
OngoingStubbing<String> mapOngoingStubbing = when(map.get(anyString()));
mapOngoingStubbing.thenReturn("first stubbing");
try {
mapOngoingStubbing.thenReturn("second stubbing");
fail();
} catch (MockitoException e) {
assertThat(e.getMessage())
.contains("Incorrect use of API detected here")
.contains(this.getClass().getSimpleName());
}
}
IOOBExceptionShouldNotBeThrownWhenNotCodingFluentlyTest.java 文件源码
java
阅读 19
收藏 0
点赞 0
评论 0
项目:astor
作者:
评论列表
文章目录