title: How to mock the line Integer.Parseint(authenticationmap.get("userid");
body: <p>How can i mock this code in jmockit
  class A{
  private Map authenticationMap;
  .
  .
  .
  public boolean createFirstTimerProfile(String password, String userName, String securityAnswer, String securityQuestion){</p>
  
  <pre><code>    String encryptedNewPassword = null;
      int userId;
      try {
          if(Util.isEmpty(password)||Util.isEmpty(userName)||Util.isEmpty(securityAnswer)||Util.isEmpty(securityQuestion))
              throw new CustomerEntryExceptions("values are null or empty");
  
          encryptedNewPassword =  encryptPassword(password);
  
          userId =(Integer.parseInt(authenticationMap.get("userid")));
          Connection con = Util.getConnection();
          if(clientUserManagement.addorupdatesecurityquestion(userName,securityQuestion, securityAnswer,userId,con)){
              String updatestatus = updateUserPassword(userId, encryptedNewPassword,
                       Boolean.parseBoolean(ServiceLocator.getConfigValue("authentication.fail_pwdchange_ind")),Integer.parseInt(ServiceLocator.getConfigValue("authentication.pwd_reason_firstlogin")));
              if(updatestatus.equals("updated")){
                  velocityContextMembers = new HashMap&lt;String,String&gt;();
                  velocityContextMembers.clear();
                  velocityContextMembers.put("name", userName);
                  velocityContextMembers.put("securityquestion", securityQuestion);
                  velocityContextMembers.put("securityanswer", securityAnswer);
                  velocityContextMembers.put("password", password);
                  mailToUser(userId,"Authetication Profile Information","authenticationProfile_email_html.vm");
                  return true;
              } else{
                  throw new CustomerEntryExceptions("Password not updated");
              }
          } else{
              throw new CustomerEntryExceptions("Authentication profile not updated");
          }
      } catch (CustomerEntryExceptions e) {
          logger.error("createFirstTimerProfile() --&gt; "+e.getMessage());
          return false;
      }
  
  }
  </code></pre>
  
  <p>}</p>
  
  <p>How to mock the line Integer.Parseint(authenticationmap.get("userid");</p>