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);
}
Aggregations