@Test public void testSave() throws Exception { model.save(client1); assertEquals(1, events.size()); assertTrue(events.get(0) instanceof ClientSavedEvent); assertEquals(client1, ((ClientSavedEvent) events.get(0)).getClient()); events.clear(); Client client3 = model.create(); assertEquals(0, events.size()); model.save(client3); assertTrue(events.get(0) instanceof ClientSavedEvent); assertEquals(client3, ((ClientSavedEvent) events.get(0)).getClient()); events.clear(); }
public void save(Client client) { clientManager.save(client); bus.publish(new ClientSavedEvent(client)); }
ClientModel { public void save(Client client) { clientManager.save(client); bus.publish(new ClientSavedEvent(client)); } }
ClientModel { public void save(Client client) { clientManager.save(client); bus.publish(new ClientSavedEvent(client)); } ClientModel(ClientManager clientManager, TaskManager taskManager); }
ClientModel { public void save(Client client) { clientManager.save(client); bus.publish(new ClientSavedEvent(client)); } ClientModel(ClientManager clientManager, TaskManager taskManager); void subscribe(Object listener); void unsubscribe(Object listener); Client getSelectedClient(); void selectClient(Client newClient); Client create(); int count(); Client get(int index); int indexOf(Client client); void save(Client client); void delete(Client client); int getTotalSecondsElapsed(Client client); String getTotalTimeElapsed(Client client); BigDecimal getTotalAmountEarned(Client client); String getTotalAmountEarned(Client client, Locale locale); }
ClientModel { public void save(Client client) { clientManager.save(client); bus.publish(new ClientSavedEvent(client)); } ClientModel(ClientManager clientManager, TaskManager taskManager); void subscribe(Object listener); void unsubscribe(Object listener); Client getSelectedClient(); void selectClient(Client newClient); Client create(); int count(); Client get(int index); int indexOf(Client client); void save(Client client); void delete(Client client); int getTotalSecondsElapsed(Client client); String getTotalTimeElapsed(Client client); BigDecimal getTotalAmountEarned(Client client); String getTotalAmountEarned(Client client, Locale locale);  }