Class BaseDataSourceTestDal

    • Constructor Detail

      • BaseDataSourceTestDal

        public BaseDataSourceTestDal()
    • Method Detail

      • doRequest

        protected String doRequest​(String wsPart,
                                   String content,
                                   int expectedResponse,
                                   String method,
                                   String contentType)
                            throws Exception
        Performs a request to Openbravo returning its response and asserting the response code matches expectedResponse. Before performing the requests, this method tries to authenticate with current settings if already not authenticated.
        Returns:
        a String containing the response for the request
        Throws:
        Exception
      • authenticate

        protected String authenticate()
                               throws Exception
        Performs a request to authenticate with current settings if already not authenticated.
        Returns:
        a String representing the cookie with authenticated session id
        Throws:
        Exception
      • getSessionCsrfToken

        protected String getSessionCsrfToken()
      • getOpenbravoURL

        protected String getOpenbravoURL()
        Obtains URL of Openbravo instance, by default taken from Openbravo.poperties context.url property
        Returns:
        a String with the URL of Openbravo instance
      • getLogin

        protected String getLogin()
        Returns the login used to login for the requests. The default value is LOGIN
        Returns:
        the login name used to login for the requests
      • getPassword

        protected String getPassword()
        Returns the password used to login for the requests. The default value is PWD
        Returns:
        the password used to login for the requests
      • logout

        protected void logout()
                       throws Exception
        Logs out current session
        Throws:
        Exception