Skip to content

Instantly share code, notes, and snippets.

@SDiamante13
Last active March 13, 2020 01:19
Show Gist options
  • Select an option

  • Save SDiamante13/97af9533ec9af9620ceff5774e0124b6 to your computer and use it in GitHub Desktop.

Select an option

Save SDiamante13/97af9533ec9af9620ceff5774e0124b6 to your computer and use it in GitHub Desktop.
An example of a failed async test.
@Test
public void getData_returnsData_whenAsyncThreadIsComplete() {
String expectedData = "Here's your data!";
doNothing().when().processData(any(Runnable.class));
String result = myService.getData().toString();
Assertions.assertThat(result).isEqualTo(expectedData);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment