public AccountingXml (final @Nonnull Accounting accounting) { customersXml = accounting.getCustomerRegistry().findCustomers().stream().map(customer -> new CustomerXml(customer)) .collect(toList()); projectsXml = accounting.getProjectRegistry().findProjects().stream().map(project -> new ProjectXml(project)) .collect(toList()); invoicesxml = accounting.getInvoiceRegistry().findInvoices().stream().map(invoice -> new InvoiceXml(invoice)) .collect(toList()); }
@DataProvider(name = "projects") public static Object[][] projectProvider() { return ScenarioFactory.createScenarios().entrySet().stream() .flatMap(entry -> entry.getValue().getProjectRegistry().findProjects().stream() .map(project -> new Object[] { entry.getKey(), project })) .collect(Collectors.toList()) .toArray(new Object[0][0]); }
@Nonnull public Invoice.Builder toBuilder (final @Nonnull Accounting accounting) { try { final Project customer = accounting.getProjectRegistry().findProjects().withId(projectXml.getId()).result(); return new Invoice.Builder().withId(id) .withNumber(number) .withProject(customer) .withDate(date) .withDueDate(dueDate) .withEarnings(earnings) .withTax(tax) .withJobEvents(JobEventXml.toJobEvents(jobEventsXml)); } catch (NotFoundException e) { throw new RuntimeException(e); } } }
final Project project = projectRegistry.findProjects().withId(projectId).result(); final Stream<Id> eventIds = configuration.getIds("jobEventIDs").stream();
public void dumpAll() throws IOException { dumpCustomers(accounting.getCustomerRegistry().findCustomers()); dumpProjects(accounting.getProjectRegistry().findProjects()); dumpInvoices(accounting.getInvoiceRegistry().findInvoices()); }