def _validate_websocket_connection(environment):
    """Checks if the websocket connection was established.

    If the client is not connected then tries to initialize the connection.

    :param environment: Environment used.
    :type environment: Environment (Enum).
    """
    if not globals.environment_config[environment]['ws_client'].is_connected():
        globals.environment_config[environment]['ws_client'].connect()
