### Question:
JpaUserDao extends JpaAbstractSearchTextDao<UserEntity, User> implements UserDao { @Override public User findByEmail(TenantId tenantId, String email) { return DaoUtil.getData(userRepository.findByEmail(email)); }  @Override User findByEmail(TenantId tenantId, String email); @Override List<User> findTenantAdmins(UUID tenantId, TextPageLink pageLink); @Override List<User> findCustomerUsers(UUID tenantId, UUID customerId, TextPageLink pageLink);  }### Answer:
@Test @DatabaseSetup("classpath:dbunit/user.xml") public void testFindByEmail() { User user = userDao.findByEmail(AbstractServiceTest.SYSTEM_TENANT_ID,"sysadm@thingsboard.org"); assertNotNull("User is expected to be not null", user); assertEquals("9cb58ba0-27c1-11e7-93ae-92361f002671", user.getId().toString()); assertEquals("c97ea14e-27c1-11e7-93ae-92361f002671", user.getTenantId().toString()); assertEquals("cdf9c79e-27c1-11e7-93ae-92361f002671", user.getCustomerId().toString()); assertEquals(Authority.SYS_ADMIN, user.getAuthority()); assertEquals("John", user.getFirstName()); assertEquals("Doe", user.getLastName()); }
@Test @DatabaseSetup("classpath:dbunit/user.xml") public void testSave() throws IOException { User user = new User(); user.setId(new UserId(UUID.fromString("cd481534-27cc-11e7-93ae-92361f002671"))); user.setTenantId(new TenantId(UUID.fromString("1edcb2c6-27cb-11e7-93ae-92361f002671"))); user.setCustomerId(new CustomerId(UUID.fromString("51477cb4-27cb-11e7-93ae-92361f002671"))); user.setEmail("user@thingsboard.org"); user.setFirstName("Jackson"); user.setLastName("Roberts"); ObjectMapper mapper = new ObjectMapper(); String additionalInfo = "{\"key\":\"value-100\"}"; JsonNode jsonNode = mapper.readTree(additionalInfo); user.setAdditionalInfo(jsonNode); userDao.save(AbstractServiceTest.SYSTEM_TENANT_ID,user); assertEquals(6, userDao.find(AbstractServiceTest.SYSTEM_TENANT_ID).size()); User savedUser = userDao.findByEmail(AbstractServiceTest.SYSTEM_TENANT_ID,"user@thingsboard.org"); assertNotNull(savedUser); assertEquals(additionalInfo, savedUser.getAdditionalInfo().toString()); }