| 1 |
#! /usr/bin/env perl |
| 2 |
use 5.006; |
| 3 |
use strict; |
| 4 |
use warnings FATAL => 'all'; |
| 5 |
use Test::More; |
| 6 |
|
| 7 |
use FindBin qw($Bin); |
| 8 |
use lib "$Bin/../../../../../lib"; |
| 9 |
|
| 10 |
BEGIN { |
| 11 |
use_ok( 'LWP::Authen::OAuth2::ServiceProvider::Line' ) || print "Bail out!\n"; |
| 12 |
use LWP::Authen::OAuth2; |
| 13 |
|
| 14 |
my $oauth2 = LWP::Authen::OAuth2->new( |
| 15 |
client_id => 'Test', |
| 16 |
client_secret => 'Test', |
| 17 |
service_provider => 'Line', |
| 18 |
redirect_uri => 'http://127.0.0.1', |
| 19 |
); |
| 20 |
isa_ok($oauth2, 'LWP::Authen::OAuth2'); |
| 21 |
|
| 22 |
my $sp = $oauth2->{service_provider}; |
| 23 |
is($sp->api_url_base => 'https://api.line.me/v2/' ); |
| 24 |
is($sp->token_endpoint => 'https://api.line.me/v2/oauth/accessToken' ); |
| 25 |
is($sp->authorization_endpoint => 'https://access.line.me/dialog/oauth/weblogin' ); |
| 26 |
is($sp->access_token_class('bearer') => 'LWP::Authen::OAuth2::ServiceProvider::Line::AccessToken'); |
| 27 |
} |
| 28 |
|
| 29 |
done_testing(); |