@Test public void shouldTriggerNotifyOnEventService() throws Exception { Rnr requisition = make(a(defaultRequisition)); Order order = new Order(requisition); order.setStatus(READY_TO_PACK); OrderStatusChangeEvent event = mock(OrderStatusChangeEvent.class); whenNew(OrderStatusChangeEvent.class).withArguments(order).thenReturn(event); service.notifyForStatusChange(order); verify(eventService).notify(event); }
public void notifyForStatusChange(Order order) { try { eventService.notify(new OrderStatusChangeEvent(order)); } catch (URISyntaxException e) { throw new DataException("error.malformed.uri"); } }
OrderEventService { public void notifyForStatusChange(Order order) { try { eventService.notify(new OrderStatusChangeEvent(order)); } catch (URISyntaxException e) { throw new DataException("error.malformed.uri"); } } }
OrderEventService { public void notifyForStatusChange(Order order) { try { eventService.notify(new OrderStatusChangeEvent(order)); } catch (URISyntaxException e) { throw new DataException("error.malformed.uri"); } }  }
OrderEventService { public void notifyForStatusChange(Order order) { try { eventService.notify(new OrderStatusChangeEvent(order)); } catch (URISyntaxException e) { throw new DataException("error.malformed.uri"); } }  void notifyForStatusChange(Order order); }
OrderEventService { public void notifyForStatusChange(Order order) { try { eventService.notify(new OrderStatusChangeEvent(order)); } catch (URISyntaxException e) { throw new DataException("error.malformed.uri"); } }  void notifyForStatusChange(Order order);  }