use of org.estatio.module.lease.dom.InvoicingFrequency in project estatio by estatio.
the class BudgetAssignmentService_Test method findOrCreateLeaseItemForServiceChargeBudgeted_works_when_no_item_to_copy_from_found.
@Test
public void findOrCreateLeaseItemForServiceChargeBudgeted_works_when_no_item_to_copy_from_found() throws Exception {
// given
BudgetAssignmentService budgetAssignmentService = new BudgetAssignmentService() {
@Override
LeaseItem findItemToCopyFrom(final Lease lease) {
return null;
}
};
Charge charge = new Charge();
BudgetCalculationResult budgetCalculationResult = new BudgetCalculationResult();
budgetCalculationResult.setInvoiceCharge(charge);
LocalDate termStartDate = new LocalDate(2018, 1, 1);
InvoicingFrequency invoicingFrequencyGuess = InvoicingFrequency.QUARTERLY_IN_ADVANCE;
PaymentMethod paymentMethodGuess = PaymentMethod.DIRECT_DEBIT;
// expect
context.checking(new Expectations() {
{
oneOf(mockLease).findFirstActiveItemOfTypeAndChargeOnDate(LeaseItemType.SERVICE_CHARGE, charge, termStartDate);
will(returnValue(null));
oneOf(mockLease).newItem(LeaseItemType.SERVICE_CHARGE, LeaseAgreementRoleTypeEnum.LANDLORD, budgetCalculationResult.getInvoiceCharge(), invoicingFrequencyGuess, paymentMethodGuess, termStartDate);
}
});
// when
budgetAssignmentService.findOrCreateLeaseItemForServiceChargeBudgeted(mockLease, budgetCalculationResult, termStartDate);
}
Aggregations