### Question:
UserDatabaseModelJpa implements UserDatabaseModel, Serializable { public User getUserBySocialAccount(SocialAccountDetails details) { UserEntity userEntity = socialAccountDao.getUserByAccount(details.getAccountType(), details.getUserId()); if (userEntity == null) { return null; } return userEntity.toUser(); }  @Transactional boolean addPasswordResetToken(PasswordResetToken token); @Transactional int addUser(User newUser); @Transactional boolean cancelAllPasswordResetTokens(int userId); @Transactional boolean confirmUserRegistration(String email); @Transactional boolean deleteUser(int userId); @Transactional int getRegisteredUserCount(Date since); PasswordResetToken getNewestPasswordResetToken(String email); User getUserByEmail(String email); User getUserByName(String name); User getUserBySocialAccount(SocialAccountDetails details); int getUserIdByEmail(String email); UserPassword getUserPassword(int userId); boolean isEmailRegistered(String email); boolean isUserNameRegistered(String name); @Transactional boolean makeLogInRecord(int userId, boolean logInSuccessfull, String usersIp); @Transactional int saveUserWithSocialAccount(User user, SocialAccountDetails details); @Transactional boolean setUserPassword(int userId, UserPassword password);  }### Answer:
@Test public void getUserBySocialAccount_byAccountId() throws Exception { fillDatabase("userDatabaseModelHbnTest/beforeGetUserBySocialAccount_byAccountId.xml"); SocialAccountDetails details = new SocialAccountDetails("FCB", "2", "", ""); User result = databaseModel.getUserBySocialAccount(details); assertEquals(2, result.getId()); }
@Test public void getUserBySocialAccount_byAccountType() throws Exception { fillDatabase("userDatabaseModelHbnTest/beforeGetUserBySocialAccount_byAccountType.xml"); SocialAccountDetails details = new SocialAccountDetails("GHB", "1", "", ""); User result = databaseModel.getUserBySocialAccount(details); assertEquals(2, result.getId()); }
@Test public void getUserBySocialAccount_notFound() throws Exception { fillDatabase("userDatabaseModelHbnTest/beforeGetUserBySocialAccount_notFound.xml"); SocialAccountDetails details = new SocialAccountDetails("GHB", "1", "", ""); User result = databaseModel.getUserBySocialAccount(details); assertEquals(null, result); }