@@ -0,0 +1,2007 @@
+package cz.fi.muni.pa165.seminar.pkmnleague.dao;%0A%0Aimport cz.fi.muni.pa165.seminar.pkmnleague.domain.Trainer;%0Aimport cz.fi.muni.pa165.seminar.pkmnleague.utils.EmbeddedDerbyDatabase;%0Aimport java.sql.Date;%0Aimport junit.framework.Assert;%0Aimport org.springframework.beans.factory.annotation.Autowired;%0Aimport org.springframework.test.context.ContextConfiguration;%0Aimport org.springframework.test.context.TestExecutionListeners;%0Aimport org.springframework.test.context.testng.AbstractTestNGSpringContextTests;%0Aimport org.springframework.test.context.transaction.TransactionalTestExecutionListener;%0Aimport org.springframework.transaction.annotation.Transactional;%0Aimport org.testng.annotations.Test;%0A%0A/**%0A *%0A * @author Zuzana Goldmannova%0A */%0A@ContextConfiguration(classes = EmbeddedDerbyDatabase.class)%0A@TestExecutionListeners(TransactionalTestExecutionListener.class)%0A@Transactional%0Apublic class TrainerDaoTest extends AbstractTestNGSpringContextTests %7B%0A    %0A    @Autowired%0A    private TrainerDao trainerDao;%0A    %0A    @Test%0A    public void testSave() %7B%0A        %0A        Trainer trainer = new Trainer();%0A        trainer.setName(%22Brok%22);%0A        trainer.setSurname(%22Stone%22);%0A        trainer.setDateOfBirth(new Date(0));%0A%0A        trainerDao.save(trainer);%0A%0A        Trainer result = trainerDao.findById(trainer.getId());%0A        Assert.assertEquals(trainer, result);%0A    %7D%0A    %0A    @Test%0A    public void testDelete() %7B%0A       Trainer trainer = new Trainer();%0A       trainer.setName(%22Brok%22);%0A       trainer.setSurname(%22Stone%22);%0A       trainer.setDateOfBirth(new Date(0));       %0A%0A       trainerDao.save(trainer);%0A       trainerDao.delete(trainer);%0A%0A       Assert.assertEquals(0, trainerDao.findAll().size());%0A    %7D%0A    %0A    @Test%0A    public void testFindAll() %7B%0A       Trainer trainer = new Trainer();%0A       trainer.setName(%22Brok%22);%0A       trainer.setSurname(%22Stone%22);%0A       trainer.setDateOfBirth(new Date(0)); %0A%0A       trainerDao.save(trainer);%0A%0A       Assert.assertEquals(1, trainerDao.findAll().size());%0A    %7D%0A%7D%0A

Create TrainerDaoTest.java