Search in sources :

Example 6 with SpellDao

use of com.iluwatar.servicelayer.spell.SpellDao in project java-design-patterns by iluwatar.

the class MagicServiceImplTest method testFindAllWizards.

@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);
}
Also used : SpellDao(com.iluwatar.servicelayer.spell.SpellDao) WizardDao(com.iluwatar.servicelayer.wizard.WizardDao) SpellbookDao(com.iluwatar.servicelayer.spellbook.SpellbookDao) Test(org.junit.Test)

Aggregations

SpellDao (com.iluwatar.servicelayer.spell.SpellDao)6 SpellbookDao (com.iluwatar.servicelayer.spellbook.SpellbookDao)6 WizardDao (com.iluwatar.servicelayer.wizard.WizardDao)6 Test (org.junit.Test)5 Spellbook (com.iluwatar.servicelayer.spellbook.Spellbook)3 Wizard (com.iluwatar.servicelayer.wizard.Wizard)3 Spell (com.iluwatar.servicelayer.spell.Spell)2 HashSet (java.util.HashSet)2 SpellDaoImpl (com.iluwatar.servicelayer.spell.SpellDaoImpl)1 SpellbookDaoImpl (com.iluwatar.servicelayer.spellbook.SpellbookDaoImpl)1 WizardDaoImpl (com.iluwatar.servicelayer.wizard.WizardDaoImpl)1