BookOrdering { @Asynchronous public void order(Book book) { if(validator.validate(book, new Class[]{}).size() > 0){ throw new IllegalArgumentException("Invalid book: " + book); } this.em.persist(book); delivery.deliver(book.getIsbn()); }  @Asynchronous void order(Book book); void cancelOrder(String id);  }
@Test public void order() { Book book = new Book("4", "Night Hacks"); this.cut.order(book); verify(this.cut.em,times(1)).persist(book); verify(this.cut.delivery,times(1)).deliver(book.getIsbn()); }