use of org.apache.isis.applib.fixturescripts.FixtureScript 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.apache.isis.applib.fixturescripts.FixtureScript 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.apache.isis.applib.fixturescripts.FixtureScript 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.apache.isis.applib.fixturescripts.FixtureScript 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();
}
use of org.apache.isis.applib.fixturescripts.FixtureScript in project estatio by estatio.
the class CommunicationChannelContributions_NewEmail_IntegTest method setup.
@Before
public void setup() {
fs = new PersonAndRolesBuilder();
runFixtureScript(new FixtureScript() {
@Override
protected void execute(ExecutionContext executionContext) {
executionContext.executeChild(this, fs);
}
});
}
Aggregations