Instantly share code, notes, and snippets.

@htrajan /mock.java
Last active Jun 28, 2018

Embed
What would you like to do?
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