Creating physical MongoDB transport connections

In HCL OneTest API, accessing MongoDB involves creating a MongoDB transport, which provides information about connectivity to a physical MongoDB.

About this task

A MongoDB transport is a server that exchanges messages between MongoDB and an application.

Procedure

  1. Open the Physical View of the Architecture School perspective.
  2. On the toolbar of the Physical View, click General > MongoDB.

    The MongoDB window is displayed.

    Alternatively, open the Logical View, right-click a MongoDB connection, and then click Set Binding in > Environment name > Create new MongoDB connection in the menu that is displayed.

  3. Optional: In the Name field, enter the name.
    Note: Assigning a name helps to identify if there are multiple MongoDB connections in your project.
  4. Click Settings to configure the basic transport settings.
    The connection settings are described in the following table:
    Table 1. MongoDB window: Settings tab
    Option Description

    Host

    The hostname or IP address of the computer that hosts the MongoDB to which you want to connect.

    Port

    The port on which MongoDB is listening for requests. The default is 27017.

    Database

    The specific MongoDB that this transport represents.

    Authentication

    Authentication Type

    Option Description
    None No credentials are requested.
    SCRAM-SHA-1 Salted Challenge Response Authentication Mechanism by using the SHA-1 hashing function.
    SCRAM-SHA-256 Salted Challenge Response Authentication Mechanism by using the SHA-256 hashing function.
    Plain (LDAP) Proxy authentication through a Lightweight Directory Access Protocol (LDAP) service.
    X.509 X.509 certificates. When authenticating with an X.509 certificate, it allows clients to authenticate to the server with this certificate rather than with a standard username and password. However in this case, the username is the subject of the certificate. For example, CN=user, OU=OrgUnit, O=my Org.
    MONGODB-CR Deprecated but still available as a proprietary challenge-response authentication.

    Username

    If the physical MongoDB requires a user name and password for authentication, enter the user name in the field provided.

    Password

    If the physical MongoDB requires a user name and password for authentication, enter the password in the field provided.

    Source

    The source used for authentication. If the source is blank, the Database option is used that is typical. To use a database other than the admin database to check your credentials, set Source to the name of the database.

    Client Options

    Application Name

    The logical name of the application that uses this connection.

    Connections per Host

    The maximum number of connection that HCL OneTest API can maintain with the host.

    Connect Timeout

    A timeout value, if needed, to set the number of milliseconds after which the subscriber stops waiting for the message (the default value 0, indicates that the subscriber waits indefinitely).

    Server Select Timeout

    The server selection timeout in milliseconds, which defines how long the Apache Camel or MongoDB JDBC driver waits for server selection to succeed before throwing an exception.

    Retry writes on network failure

    Select to retry writes if they fail due to a network error.

  5. To provide a URI for MongoDB, click the Advanced check box:
    Option Description

    URI

    A MongoDB URI to connect to the database. When deselected, the basic settings on the Settings tab are displayed.

  6. Click SSL to configure the secure socket layer (SSL) settings for the transport.
    The SSL settings are described in the following table:
    Table 2. MongoDB window: SSL tab
    Setting Description

    Use SSL

    Enables security for transport. When you select this check box, it makes the other controls on the SSL tab available. You can enable security for Testing (Client) or for Virtualization (Server), or both.

    Server certificates to trust

    All available identity stores are displayed in the drop-down menu. Select one of the following menu items:
    Option Description
    Trust All To accept any certificate presented by the server, regardless of its validity. This option is the default option, and assumes that you are focused on testing an application rather than the security of the server.
    New To define a new identity source.

    Client identities to provide to the server

    All available identity stores are displayed in the menu. If you use mutual authentication, a suitable identity is selected from the chosen identity store. Select one of the following menu items:
    Option Description
    None If the server does not request an identity.
    New To define a new identity source.

    Certificate source

    All available identity stores are displayed in the list. You can select one of the following items from the list:
    Option Description
    Generated To use a certificate that HCL OneTest API generates for you. The source for that certificate is displayed in the Signed by field.
    New To define a new identity source.

    Signed by

    If you chose Generated in the Certificate source field, this field holds the location of a certificate within the HCL OneTest API installation directory that is used to generate the new certificate. This is a read-only field.

    Certificate Authorities a stub will trust

    All available identity stores are displayed in the drop-down menu. You can select one of the following menu items:
    Option Description
    Trust All To accept any certificate presented by the client.
    New To define a new identity source.

    Override default protocols

    If you are have to use a specific version of the SSL protocol, such as SSLv2 or TLSv1.2, enter that algorithm name here. For a complete list of algorithms, see Standard Algorithm Name Documentation.

  7. Click Test Transport to verify the connection works.
  8. Click OK.

Results

The new physical MongoDB transport is added to your project.