@Captor
private ArgumentCaptor<Map<String, String>> captor;
@Before
public void init() {
MockitoAnnotations.initMocks(this);
}
public void test() {
//some codes
verify(mockAlarmUpdater, times(1)).display(captor.capture());
assertThat(captor.getAllValues().get(0), hasKey(equalTo("inverter1.error.level1")));
}
标签:传参,验证,void,mockito,some,private,captor,public From: https://blog.51cto.com/u_6174294/6207190