Search in sources :

Example 1 with FreemarkerModelOfPrelimLetterOrInvoiceDocForEmailCover

use of org.estatio.module.lease.spiimpl.document.binders.FreemarkerModelOfPrelimLetterOrInvoiceDocForEmailCover in project estatio by estatio.

the class DocumentTypeAndTemplatesFSForInvoicesUsingSsrs_Test method setUp.

@Before
public void setUp() throws Exception {
    stubDocumentType = DocumentTypeData.PRELIM_LETTER.create();
    stubInvoice = new InvoiceForLease();
    stubInvoice.setDueDate(new LocalDate(2016, 11, 1));
    stubBuyer = new Organisation();
    stubBuyer.setName("Buyer-1");
    stubInvoice.setBuyer(stubBuyer);
    stubInvoice.setLease(mockLease);
    stubProperty = new Property();
    stubProperty.setReference("XXX");
    stubUnit = new Unit();
    stubUnit.setName("XXX-123");
    stubBrand = new Brand();
    stubBrand.setName("Brandino");
    // expect
    context.checking(new Expectations() {

        {
            allowing(mockPaperclipRepository).paperclipAttaches(mockDocument, InvoiceForLease.class);
            will(returnValue(stubInvoice));
            allowing(mockLease).getProperty();
            will(returnValue(stubProperty));
            allowing(mockLease).getReference();
            will(returnValue("XXX-ABC-789"));
            allowing(mockDocument).getType();
            will(returnValue(stubDocumentType));
        }
    });
    // expecting
    context.checking(new Expectations() {

        {
            allowing(mockConfigurationService).getProperty("isis.deploymentType");
            will(returnValue("prototyping"));
        }
    });
    rendererModelFactory = new FreemarkerModelOfPrelimLetterOrInvoiceDocForEmailCover();
    inject(rendererModelFactory, "paperclipRepository", mockPaperclipRepository);
}
Also used : Brand(org.estatio.module.lease.dom.occupancy.tags.Brand) Expectations(org.jmock.Expectations) InvoiceForLease(org.estatio.module.lease.dom.invoicing.InvoiceForLease) Organisation(org.estatio.module.party.dom.Organisation) Unit(org.estatio.module.asset.dom.Unit) LocalDate(org.joda.time.LocalDate) Property(org.estatio.module.asset.dom.Property) FreemarkerModelOfPrelimLetterOrInvoiceDocForEmailCover(org.estatio.module.lease.spiimpl.document.binders.FreemarkerModelOfPrelimLetterOrInvoiceDocForEmailCover) Before(org.junit.Before)

Aggregations

Property (org.estatio.module.asset.dom.Property)1 Unit (org.estatio.module.asset.dom.Unit)1 InvoiceForLease (org.estatio.module.lease.dom.invoicing.InvoiceForLease)1 Brand (org.estatio.module.lease.dom.occupancy.tags.Brand)1 FreemarkerModelOfPrelimLetterOrInvoiceDocForEmailCover (org.estatio.module.lease.spiimpl.document.binders.FreemarkerModelOfPrelimLetterOrInvoiceDocForEmailCover)1 Organisation (org.estatio.module.party.dom.Organisation)1 Expectations (org.jmock.Expectations)1 LocalDate (org.joda.time.LocalDate)1 Before (org.junit.Before)1