Skip to content

Instantly share code, notes, and snippets.

@oliverspryn
Created October 21, 2021 21:45
Show Gist options
  • Select an option

  • Save oliverspryn/1afeb860a649229ab4a5b0012389ea9d to your computer and use it in GitHub Desktop.

Select an option

Save oliverspryn/1afeb860a649229ab4a5b0012389ea9d to your computer and use it in GitHub Desktop.
The mocking set up of a unit test where the output of one function streams into the parameter of another
whenever(userService.getUserName()).thenReturn("jsmith")
whenever(userService.getUserId()).thenReturn("123-456") // Output from here...
whenever(userService.getUrlToAvatarImage("123-456")).thenReturn("https://ddg.co/") // ... feeds into here
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment