@@ -0,0 +1,1261 @@
+package tw.edu.ncu.cc.manage.dao.impl;%0A%0Aimport static org.junit.Assert.*;%0A%0Aimport java.util.Optional;%0A%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0A%0Aimport tw.edu.ncu.cc.manage.domain.Manager;%0A%0Apublic class ManagerDaoTest %7B%0A%0A%09private ManagerDao managerDao;%0A%09%0A%09@Before%0A%09public void setUp() throws Exception %7B%0A%09%09managerDao = new ManagerDao();%0A%09%09managerDao.setRootUrl(DaoTestUtils.ROOT_URL);%0A%09%7D%0A%0A%09@Test%0A%09public void shouldMatchApiSpecification() %7B%0A%09%09testCreate();%0A%09%09testFind();%0A%09%09testFindAll();%0A%09%09testDelete();%0A%09%7D%0A%09%0A%09private Manager manager() %7B%0A%09%09Manager manager = new Manager();%0A%09%09manager.setId(DaoTestUtils.FAKE_USER_NAME);%0A%09%09manager.setName(DaoTestUtils.FAKE_NAME);%0A%09%09return manager;%0A%09%7D%0A%09%0A%09private void testCreate() %7B%0A%09%09Manager manager = manager();%0A%09%09Manager createManager = this.managerDao.create(manager);%0A%09%09assertEquals(manager.getId(), createManager.getId());%09%09%0A%09%7D%0A%09%0A%09private void testFind() %7B%0A%09%09Optional%3CManager%3E findManager = this.managerDao.find(DaoTestUtils.FAKE_USER_NAME);%0A%09%09assertTrue(findManager.isPresent());%0A%09%7D%0A%09%0A%09private void testFindAll() %7B%0A%09%09Optional%3CManager%3E findAllManager = this.managerDao.findAll().stream().findAny();%0A%09%09assertTrue(findAllManager.isPresent());%0A%09%7D%0A%09%0A%09private void testDelete() %7B%0A%09%09this.managerDao.delete(manager());%0A%09%7D%0A%7D%0A

add ManagerDaoTest