NAME

Nuvol::Test::Connector - Test functions for Nuvol connectors

SYNOPSIS

use Nuvol::Test::Connector ':all';
use Nuvol::Test::Connector ':build';    # build_test_connector

my $connector = build_test_connector $service;

test_basics;
test_constants;
test_defaults;
test_config;
test_authenticate;
test_disconnect;

DESCRIPTION

Nuvol::Test::Connector provides test functions for Nuvol connectors.

FUNCTIONS

build_test_connector

$connector = build_test_connector $service;

Returns a Nuvol::Connector for the specified service, using a config file in a temporary folder.

$connector = build_test_connector $service, $params;

Creates a connector with additional parameters.

test_authenticate

%tokens = (
  access_token  => $access_token,
  expires_in    => $seconds,
  refresh_token => $refresh_token,
  scope         => $scope
);
test_authenticate $connector, \%tokens;

Simulates a successful authentication.

test_basics

test_basics $connector, $service;

Tests the basic structure of the connector.

test_config

test_config $connector;

Tests the content of the config and config file.

test_constants

%constants = (...);
test_constants $connector, \%constants;

Tests the content of the constants.

test_defaults

%defaults = (...);
test_defaults $connector, \%defaults;

Tests the default values.

test_disconnect

test_disconnect $connector;

Disconnects and checks if the authentication tokens are deleted.

SEE ALSO

Nuvol::Connector, Nuvol::Test, Nuvol::Test::ConnectorLive.