Esempio n. 1
0
 private static void completeBatch(ApplicationContext context) throws InterruptedException {
   OrderGateway orderGateway = context.getBean(OrderGateway.class);
   orderGateway.completeBatch(10);
   Thread.sleep(5_000);
 }
Esempio n. 2
0
 private static void placeOrders(int orders, ApplicationContext context) {
   OrderGateway orderGateway = context.getBean(OrderGateway.class);
   IntStream.range(0, orders).parallel().forEach(i -> orderGateway.placeOrder());
 }