Search in sources :

Example 16 with Budget

use of org.estatio.module.budget.dom.budget.Budget in project estatio by estatio.

the class BudgetItemValueRepository_IntegTest method findByBudgetItemAndType.

@Test
public void findByBudgetItemAndType() {
    // given
    Property property = Property_enum.OxfGb.findUsing(serviceRegistry);
    Budget budget = budgetRepository.findByPropertyAndStartDate(property, new LocalDate(2015, 01, 01));
    BudgetItem budgetItem = budget.getItems().first();
    assertThat(budgetItem.getValues().size()).isEqualTo(1);
    assertThat(budgetItem.getValues().first().getType()).isEqualTo(BudgetCalculationType.BUDGETED);
    // when
    List<BudgetItemValue> results = budgetItemValueRepository.findByBudgetItemAndType(budgetItem, BudgetCalculationType.BUDGETED);
    // then
    assertThat(results.size()).isEqualTo(1);
}
Also used : BudgetItem(org.estatio.module.budget.dom.budgetitem.BudgetItem) Budget(org.estatio.module.budget.dom.budget.Budget) BudgetItemValue(org.estatio.module.budget.dom.budgetitem.BudgetItemValue) Property(org.estatio.module.asset.dom.Property) LocalDate(org.joda.time.LocalDate) Test(org.junit.Test)

Aggregations

Budget (org.estatio.module.budget.dom.budget.Budget)16 Property (org.estatio.module.asset.dom.Property)8 BudgetItem (org.estatio.module.budget.dom.budgetitem.BudgetItem)8 LocalDate (org.joda.time.LocalDate)7 Action (org.apache.isis.applib.annotation.Action)4 BudgetItemValue (org.estatio.module.budget.dom.budgetitem.BudgetItemValue)4 Test (org.junit.Test)4 BigDecimal (java.math.BigDecimal)3 Programmatic (org.apache.isis.applib.annotation.Programmatic)3 ArrayList (java.util.ArrayList)2 ApplicationException (org.apache.isis.applib.ApplicationException)2 PartitionItem (org.estatio.module.budget.dom.partioning.PartitionItem)2 Lease (org.estatio.module.lease.dom.Lease)2 LeaseRepository (org.estatio.module.lease.dom.LeaseRepository)2 Occupancy (org.estatio.module.lease.dom.occupancy.Occupancy)2 List (java.util.List)1 SortedSet (java.util.SortedSet)1 Collectors (java.util.stream.Collectors)1 Inject (javax.inject.Inject)1 ActionLayout (org.apache.isis.applib.annotation.ActionLayout)1