Skip to content

Instantly share code, notes, and snippets.

@htrajan
Last active June 28, 2018 23:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save htrajan/11c6fa34d983adb88570c8a5db14d51b to your computer and use it in GitHub Desktop.
Save htrajan/11c6fa34d983adb88570c8a5db14d51b to your computer and use it in GitHub Desktop.
public class AccountSavingsRecommenderTest {
private final Mockery mockery = new Mockery();
private final RetirementGoalSavingsAllocator retirementAllocator = mockery.mock(RetirementGoalSavingsAllocator.class);
@Test
public void computePvByGoal_retirement() {
Account retirementAccount = TestAccountFactory.exampleRetirementAccount();
mockery.checking(new Expectations() {{
oneOf(retirementAllocator).getAccountForPvCalculation();
will(returnValue(retirementAccount));
}});
// rest of our test logic
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment