You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At the moment the behavior of using argument captors differs between the Kotlin and Java versions.
For example, the below Kotlin test fails, while the corresponding Java test passes:
@Test
funtestKotlin() {
/* Given */val date:Date= mock()
/* When */
date.time =5L
date.time =7L/* Then */
verify(date, times(2)).time = capture {
expect(it).toBe(7L)
}
}
@TestpublicvoidtestJava() {
/* Given */Datedate = mock(Date.class);
/* When */date.setTime(5L);
date.setTime(7L);
/* Then */ArgumentCaptor<Long> captor = ArgumentCaptor.forClass(Long.class);
verify(date, times(2)).setTime(captor.capture());
assertcaptor.getValue() == 7L;
}
The reason is that the Java version matches the latest captured value, while the current Kotlin version matches the first.
The text was updated successfully, but these errors were encountered:
At the moment the behavior of using argument captors differs between the Kotlin and Java versions.
For example, the below Kotlin test fails, while the corresponding Java test passes:
The reason is that the Java version matches the latest captured value, while the current Kotlin version matches the first.
The text was updated successfully, but these errors were encountered: