### Question:
UserDatabaseModelJpa implements UserDatabaseModel, Serializable { @Transactional public int saveUserWithSocialAccount(User user, SocialAccountDetails details) { UserEntity userEntity = new UserEntity(); userEntity.copyUser(user); userEntity.setRegistrationDate(new Date()); userEntityDao.add(userEntity); SocialAccountEntity socialAccountEntity = new SocialAccountEntity(); socialAccountEntity.setUser(userEntity); socialAccountEntity.setAccountType(details.getAccountType()); socialAccountEntity.setOriginalAccountId(details.getUserId()); socialAccountDao.add(socialAccountEntity); return userEntity.getId(); }  @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 testSaveUserWithSocialAccount() throws Exception { fillDatabase("userDatabaseModelHbnTest/beforeSaveUserWithSocialAccount.xml"); User user = new User(0, "mike", "mike@test.com", null, true, null, 2); SocialAccountDetails details = new SocialAccountDetails("GHB", "2", "", ""); int result = databaseModel.saveUserWithSocialAccount(user, details); assertEquals(1, result); IDataSet expectedDataSet = loadFlatXmlDataSet("userDatabaseModelHbnTest/afterSaveUserWithSocialAccount.xml"); assertTableContent(expectedDataSet, "um_user", new String[] { "reg_date", "reg_control_code", "password", "salt" }); assertTableContent(expectedDataSet, "um_social_account", null); }