Search in sources :

Example 1 with LeaseRepository

use of org.estatio.module.lease.dom.LeaseRepository in project estatio by estatio.

the class BudgetAssignmentService_Test method before.

@Before
public void before() throws Exception {
    budgetAssignmentService = new BudgetAssignmentService();
    o1 = new Occupancy();
    leaseWith1ActiveOccupancy = new Lease() {

        @Override
        public SortedSet<Occupancy> getOccupancies() {
            return new TreeSet<>(Arrays.asList(o1));
        }
    };
    o2 = new Occupancy();
    o3 = new Occupancy();
    leaseWith2ActiveOccupancies = new Lease() {

        @Override
        public SortedSet<Occupancy> getOccupancies() {
            return new TreeSet<>(Arrays.asList(o2, o3));
        }
    };
    o4 = new Occupancy();
    leaseWithNoActiveOccupancies = new Lease() {

        @Override
        public SortedSet<Occupancy> getOccupancies() {
            return new TreeSet<>(Arrays.asList(o4));
        }
    };
    o5 = new Occupancy();
    leaseTerminated = new Lease() {

        @Override
        public SortedSet<Occupancy> getOccupancies() {
            return new TreeSet<>(Arrays.asList(o5));
        }
    };
    budget = new Budget();
    LocalDate startDate = new LocalDate(2015, 01, 01);
    LocalDate endDate = new LocalDate(2015, 12, 31);
    budget.setStartDate(startDate);
    budget.setEndDate(endDate);
    LeaseRepository leaseRepository = new LeaseRepository() {

        @Override
        public List<Lease> findLeasesByProperty(final Property property) {
            return Arrays.asList(leaseWith1ActiveOccupancy, leaseWith2ActiveOccupancies, leaseWithNoActiveOccupancies, leaseTerminated);
        }
    };
    budgetAssignmentService.leaseRepository = leaseRepository;
}
Also used : Lease(org.estatio.module.lease.dom.Lease) Occupancy(org.estatio.module.lease.dom.occupancy.Occupancy) Budget(org.estatio.module.budget.dom.budget.Budget) SortedSet(java.util.SortedSet) LocalDate(org.joda.time.LocalDate) Property(org.estatio.module.asset.dom.Property) LeaseRepository(org.estatio.module.lease.dom.LeaseRepository) Before(org.junit.Before)

Aggregations

SortedSet (java.util.SortedSet)1 Property (org.estatio.module.asset.dom.Property)1 Budget (org.estatio.module.budget.dom.budget.Budget)1 Lease (org.estatio.module.lease.dom.Lease)1 LeaseRepository (org.estatio.module.lease.dom.LeaseRepository)1 Occupancy (org.estatio.module.lease.dom.occupancy.Occupancy)1 LocalDate (org.joda.time.LocalDate)1 Before (org.junit.Before)1