@Test public void testSaveEmployee() { Employee employee = getEmployeeForTest(); repository.save(employee); assertNotNull(employee.getId()); logger.debug("employeeId : " + employee.getId()); }
private Employee getEmployeeForTest() { Employee employee = new Employee(); employee.setFirstName("testFirstName"); employee.setLastName("testLastName"); employee.setTitle("testTile"); employee.setTitleOfCourtesy("testMr"); String birthDateString = "12/08/1968"; Date bithDate = parseStringTilSqlDate(birthDateString, NorthWindConstants.DATE_FORMAT_WITH_DASH); employee.setBirthDate(bithDate); String hireDateString = "5/1/1992"; Date hireDate = parseStringTilSqlDate(hireDateString, NorthWindConstants.DATE_FORMAT_WITH_DASH); employee.setHireDate(hireDate); employee.setAddress("testAddress"); employee.setCity("testCity"); employee.setRegion("testRegion"); employee.setPostalCode("testPostalCode"); employee.setCountry("testCountry"); employee.setHomePhone("12313121"); employee.setExtension("testExtension"); employee.setNotes("testNotes"); return employee; }