Skip to content

Instantly share code, notes, and snippets.

@chbatey
Last active December 21, 2015 06:19
Show Gist options
  • Save chbatey/6263652 to your computer and use it in GitHub Desktop.
Save chbatey/6263652 to your computer and use it in GitHub Desktop.
//Java Mocktio
when(someMock.someMethod("something")).thenReturn("oneThing")
when(someMock.someMethod("somethingElse")).thenReturn("anotherThing")
//Groovy MockFor
someMock.demand.someMethodThatReturns {
param1 ->
if (param1 == "something") return "oneThing"
if (param1 == "somethingElse") return "anotherThing"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment