use of org.estatio.module.capex.seed.DocumentTypesAndTemplatesForCapexFixture in project estatio by estatio.
the class DocumentTypesAndTemplatesSeedService method init.
@PostConstruct
public void init() {
if (System.getProperty("isis.headless") != null) {
return;
}
// If we get new versions of the templates in the future, then update this date
// the upsert logic here should result in the new templates being inserted alongside existing
// (with a different template date).
//
// using this date to ensure that prototyping still works (epoch date set back then)
//
final LocalDate templateDate = new LocalDate(2012, 1, 1);
fixtureScripts.runFixtureScript(new DocumentTypesAndTemplatesForLeaseFixture(templateDate), null);
fixtureScripts.runFixtureScript(new DocumentTypesAndTemplatesForCapexFixture(templateDate), null);
}
use of org.estatio.module.capex.seed.DocumentTypesAndTemplatesForCapexFixture in project estatio by estatio.
the class IncomingInvoiceApprovalState_IntegTest method setupData.
@Before
public void setupData() {
runFixtureScript(new FixtureScript() {
@Override
protected void execute(final FixtureScript.ExecutionContext ec) {
ec.executeChild(this, new DocumentTypesAndTemplatesForCapexFixture());
ec.executeChild(this, new CapexChargeHierarchyXlsxFixture());
ec.executeChildren(this, IncomingInvoice_enum.fakeInvoice2Pdf, BankAccount_enum.TopModelGb, Person_enum.EmmaTreasurerGb, Person_enum.JonathanPropertyManagerGb, Person_enum.PeterPanProjectManagerGb, Person_enum.OscarCountryDirectorGb);
}
});
Person Peter = Person_enum.PeterPanProjectManagerGb.findUsing(serviceRegistry);
Peter.addRole(ProjectRoleTypeEnum.PROJECT_MANAGER);
}
use of org.estatio.module.capex.seed.DocumentTypesAndTemplatesForCapexFixture in project estatio by estatio.
the class Order_2_IntegTest method setupData.
@Before
public void setupData() {
runFixtureScript(new FixtureScript() {
@Override
protected void execute(final FixtureScript.ExecutionContext executionContext) {
// taken from the DocumentTypesAndTemplatesSeedService (not run in integ tests by default)
final LocalDate templateDate = ld(2012, 1, 1);
executionContext.executeChildren(this, new DocumentTypesAndTemplatesForCapexFixture(templateDate), new CapexChargeHierarchyXlsxFixture());
executionContext.executeChildren(this, Order_enum.fakeOrder2Pdf, Person_enum.JonathanPropertyManagerGb);
}
});
order = Order_enum.fakeOrder2Pdf.findUsing(serviceRegistry);
}
use of org.estatio.module.capex.seed.DocumentTypesAndTemplatesForCapexFixture in project estatio by estatio.
the class Order_withLinks_IntegTest method setupData.
@Before
public void setupData() {
runFixtureScript(new FixtureScript() {
@Override
protected void execute(final ExecutionContext ec) {
ec.executeChild(this, new DocumentTypesAndTemplatesForCapexFixture());
ec.executeChild(this, new CapexChargeHierarchyXlsxFixture());
ec.executeChildren(this, Order_enum.fakeOrder2Pdf, Budget_enum.OxfBudget2015, Budget_enum.OxfBudget2016, IncomingInvoice_enum.fakeInvoice2Pdf, Person_enum.JonathanPropertyManagerGb);
}
});
order = Order_enum.fakeOrder2Pdf.findUsing(serviceRegistry);
orderItem = order.getItems().first();
// given
assertNotNull(order);
assertNotNull(orderItem);
assertThat(linkRepository.findByOrderItem(orderItem)).isNotEmpty();
assertThat(order.getApprovalState()).isEqualTo(OrderApprovalState.NEW);
// workaround: clear MeService#me cache
queryResultsCache.resetForNextTransaction();
}
use of org.estatio.module.capex.seed.DocumentTypesAndTemplatesForCapexFixture in project estatio by estatio.
the class IncomingDocumentPresentationSubscriber_IntegTest method setupData.
@Before
public void setupData() throws IOException {
runFixtureScript(new FixtureScript() {
@Override
protected void execute(final ExecutionContext executionContext) {
executionContext.executeChild(this, new DocumentTypesAndTemplatesForCapexFixture());
}
});
List<Document> incomingDocumentsBefore = repository.findIncomingDocuments();
assertThat(incomingDocumentsBefore).isEmpty();
// given
final String fileName = "1020100123.pdf";
final byte[] pdfBytes = Resources.toByteArray(Resources.getResource(IncomingDocumentPresentationSubscriber_IntegTest.class, fileName));
final Blob blob = new Blob(fileName, "application/pdf", pdfBytes);
wrap(documentMenu).upload(blob);
transactionService.nextTransaction();
}
Aggregations