Business-SiteCatalyst

 view release on metacpan or  search on metacpan

t/Company/50-get_endpoint.t  view on Meta::CPAN

#!perl -T

use strict;
use warnings;

use Data::Validate::Type;
use Test::Exception;
use Test::More;

use Business::SiteCatalyst;


eval 'use SiteCatalystConfig';
$@
	? plan( skip_all => 'Local connection information for Adobe SiteCatalyst required to run tests.' )
	: plan( tests => 4 );

my $config = SiteCatalystConfig->new();

# Create an object to communicate with Adobe SiteCatalyst
my $site_catalyst = Business::SiteCatalyst->new( %$config );
ok(
	defined( $site_catalyst ),
	'Create a new Business::SiteCatalyst object.',
);

ok(
	defined( 
		my $company = $site_catalyst->instantiate_company()
	),
	'Instantiate a new Business::SiteCatalyst::Company.',
);

my $response;
ok(
	defined(
		$response = $company->get_endpoint( company => 'adobe' )
	),
	'Request SiteCatalyst API/server endpoint.',
);

ok(
	Data::Validate::Type::is_string( $response, allow_empty => 0 ),
	'Retrieve SiteCatalyst API/server endpoint.',
) || diag( explain( $response ) );



( run in 0.680 second using v1.01-cache-2.11-cpan-524268b4103 )