@Test public void update_success() { WhitelistedSite oldSite = Mockito.mock(WhitelistedSite.class); WhitelistedSite newSite = Mockito.mock(WhitelistedSite.class); service.update(oldSite, newSite); Mockito.verify(repository).update(oldSite, newSite); }
@Override public WhitelistedSite update(WhitelistedSite oldWhitelistedSite, WhitelistedSite whitelistedSite) { if (oldWhitelistedSite == null || whitelistedSite == null) { throw new IllegalArgumentException("Neither the old or new sites may be null"); } return repository.update(oldWhitelistedSite, whitelistedSite); }
DefaultWhitelistedSiteService implements WhitelistedSiteService { @Override public WhitelistedSite update(WhitelistedSite oldWhitelistedSite, WhitelistedSite whitelistedSite) { if (oldWhitelistedSite == null || whitelistedSite == null) { throw new IllegalArgumentException("Neither the old or new sites may be null"); } return repository.update(oldWhitelistedSite, whitelistedSite); } }
DefaultWhitelistedSiteService implements WhitelistedSiteService { @Override public WhitelistedSite update(WhitelistedSite oldWhitelistedSite, WhitelistedSite whitelistedSite) { if (oldWhitelistedSite == null || whitelistedSite == null) { throw new IllegalArgumentException("Neither the old or new sites may be null"); } return repository.update(oldWhitelistedSite, whitelistedSite); }  }
DefaultWhitelistedSiteService implements WhitelistedSiteService { @Override public WhitelistedSite update(WhitelistedSite oldWhitelistedSite, WhitelistedSite whitelistedSite) { if (oldWhitelistedSite == null || whitelistedSite == null) { throw new IllegalArgumentException("Neither the old or new sites may be null"); } return repository.update(oldWhitelistedSite, whitelistedSite); }  @Override WhitelistedSite getById(Long id); @Override void remove(WhitelistedSite whitelistedSite); @Override WhitelistedSite saveNew(WhitelistedSite whitelistedSite); @Override Collection<WhitelistedSite> getAll(); @Override WhitelistedSite getByClientId(String clientId); @Override WhitelistedSite update(WhitelistedSite oldWhitelistedSite, WhitelistedSite whitelistedSite); }
DefaultWhitelistedSiteService implements WhitelistedSiteService { @Override public WhitelistedSite update(WhitelistedSite oldWhitelistedSite, WhitelistedSite whitelistedSite) { if (oldWhitelistedSite == null || whitelistedSite == null) { throw new IllegalArgumentException("Neither the old or new sites may be null"); } return repository.update(oldWhitelistedSite, whitelistedSite); }  @Override WhitelistedSite getById(Long id); @Override void remove(WhitelistedSite whitelistedSite); @Override WhitelistedSite saveNew(WhitelistedSite whitelistedSite); @Override Collection<WhitelistedSite> getAll(); @Override WhitelistedSite getByClientId(String clientId); @Override WhitelistedSite update(WhitelistedSite oldWhitelistedSite, WhitelistedSite whitelistedSite);  }