@Test public void testFindAllWizards() throws Exception { final WizardDao wizardDao = mock(WizardDao.class); final SpellbookDao spellbookDao = mock(SpellbookDao.class); final SpellDao spellDao = mock(SpellDao.class); final MagicServiceImpl service = new MagicServiceImpl(wizardDao, spellbookDao, spellDao); verifyZeroInteractions(wizardDao, spellbookDao, spellDao); service.findAllWizards(); verify(wizardDao).findAll(); verifyNoMoreInteractions(wizardDao, spellbookDao, spellDao); }
@Override public List<Wizard> findAllWizards() { return wizardDao.findAll(); }
MagicServiceImpl implements MagicService { @Override public List<Wizard> findAllWizards() { return wizardDao.findAll(); } }
MagicServiceImpl implements MagicService { @Override public List<Wizard> findAllWizards() { return wizardDao.findAll(); } MagicServiceImpl(WizardDao wizardDao, SpellbookDao spellbookDao, SpellDao spellDao); }
MagicServiceImpl implements MagicService { @Override public List<Wizard> findAllWizards() { return wizardDao.findAll(); } MagicServiceImpl(WizardDao wizardDao, SpellbookDao spellbookDao, SpellDao spellDao); @Override List<Wizard> findAllWizards(); @Override List<Spellbook> findAllSpellbooks(); @Override List<Spell> findAllSpells(); @Override List<Wizard> findWizardsWithSpellbook(String name); @Override List<Wizard> findWizardsWithSpell(String name); }
MagicServiceImpl implements MagicService { @Override public List<Wizard> findAllWizards() { return wizardDao.findAll(); } MagicServiceImpl(WizardDao wizardDao, SpellbookDao spellbookDao, SpellDao spellDao); @Override List<Wizard> findAllWizards(); @Override List<Spellbook> findAllSpellbooks(); @Override List<Spell> findAllSpells(); @Override List<Wizard> findWizardsWithSpellbook(String name); @Override List<Wizard> findWizardsWithSpell(String name);  }