use of org.estatio.module.asset.dom.Unit in project estatio by estatio.
the class InvoiceItemForLeaseDtoFactory_Test method occupancy_is_ignored_when_invoice_item_has_unit.
@Test
public void occupancy_is_ignored_when_invoice_item_has_unit() throws Exception {
// Given
invoiceItem.setEffectiveStartDate(new LocalDate(2013, 10, 1));
Unit unitOnItem = new Unit();
unitOnItem.setReference("XXX");
invoiceItem.setFixedAsset(unitOnItem);
// When
InvoiceItemDto invoiceItemDto = new InvoiceItemForLeaseDtoFactory().newDto(invoiceItem);
// Then
assertThat(invoiceItemDto.getFixedAssetReference()).isEqualTo("XXX");
assertThat(invoiceItemDto.getOccupancyBrand()).isEqualTo("BRAND");
}
use of org.estatio.module.asset.dom.Unit in project estatio by estatio.
the class InvoiceItemForLeaseDtoFactory_Test method setUp.
@Before
public void setUp() throws Exception {
// given
ChargeGroup chargeGroup = new ChargeGroup();
chargeGroup.setReference("CG");
Charge charge = new Charge();
charge.setReference("CH");
charge.setExternalReference("CHE");
charge.setGroup(chargeGroup);
Tax tax = new Tax();
Unit unit = new Unit();
unit.setReference("UN");
Brand brand = new Brand();
brand.setName("BRAND");
Occupancy occupancy = new Occupancy();
occupancy.setEndDate(new LocalDate(2013, 12, 31));
occupancy.setUnit(unit);
occupancy.setBrand(brand);
Lease lease = new Lease();
lease.getOccupancies().add(occupancy);
InvoiceForLease invoice = new InvoiceForLease();
invoice.setLease(lease);
invoiceItem = new InvoiceItemForLease();
invoiceItem.setInvoice(invoice);
invoiceItem.setCharge(charge);
invoiceItem.setTax(tax);
}
Aggregations