Skip to content
Snippets Groups Projects
Commit 7822e6fc authored by Guillaume ROUSSE's avatar Guillaume ROUSSE
Browse files

simplification: rename SAMLMetadata as Metadata

parent dd438d44
Branches
Tags
No related merge requests found
......@@ -21,7 +21,7 @@ use AccountManager::Service;
use AccountManager::Service::Manager;
use AccountManager::Account;
use AccountManager::Account::Manager;
use AccountManager::SAMLMetadata;
use AccountManager::Metadata;
use AccountManager::Tools;
my %options;
......@@ -166,7 +166,7 @@ sub parse_metadata {
my $federation_metadata;
eval {
$federation_metadata = AccountManager::SAMLMetadata->new(
$federation_metadata = AccountManager::Metadata->new(
file => $configuration->{_}->{federation_metadata_file}
);
};
......
package AccountManager::SAMLMetadata;
package AccountManager::Metadata;
use strict;
use warnings;
......
......@@ -14,7 +14,7 @@ use AccountManager::Account;
use AccountManager::Account::Manager;
use AccountManager::Token;
use AccountManager::Service;
use AccountManager::SAMLMetadata;
use AccountManager::Metadata;
use AccountManager::Tools;
## Defining parameters format
......@@ -186,7 +186,7 @@ sub req_account_wizard {
my $metadata;
eval {
$metadata = AccountManager::SAMLMetadata->new(
$metadata = AccountManager::Metadata->new(
file => $self->{configuration}->{_}->{federation_metadata_file}
);
};
......@@ -227,7 +227,7 @@ sub req_select_sp {
my $metadata;
eval {
$metadata = AccountManager::SAMLMetadata->new(
$metadata = AccountManager::Metadata->new(
file => $self->{configuration}->{_}->{federation_metadata_file}
);
};
......
......@@ -5,7 +5,7 @@ nobase_modules_DATA = \
AccountManager/Token/Manager.pm \
AccountManager/DB.pm \
AccountManager/DB/Object.pm \
AccountManager/SAMLMetadata.pm \
AccountManager/Metadata.pm \
AccountManager/Service.pm \
AccountManager/Service/Manager.pm \
AccountManager/Account.pm \
......
......@@ -8,19 +8,19 @@ use File::Temp;
use Test::More;
use Test::Exception;
use AccountManager::SAMLMetadata;
use AccountManager::Metadata;
plan tests => 21;
my $metadata;
throws_ok {
$metadata = AccountManager::SAMLMetadata->new();
$metadata = AccountManager::Metadata->new();
} qr/^missing argument 'file'/,
'instanciation: no file argument';
throws_ok {
$metadata = AccountManager::SAMLMetadata->new(
$metadata = AccountManager::Metadata->new(
file => '/no/such/file',
);
} qr/^non-existing file/,
......@@ -31,7 +31,7 @@ my $file1 = File::Temp->new(UNLINK => $ENV{TEST_DEBUG} ? 0 : 1);
chmod 0000, $file1;
throws_ok {
$metadata = AccountManager::SAMLMetadata->new(
$metadata = AccountManager::Metadata->new(
file => $file1->filename()
);
} qr/^non-readable file/,
......@@ -40,7 +40,7 @@ throws_ok {
chmod 0644, $file1;
throws_ok {
$metadata = AccountManager::SAMLMetadata->new(
$metadata = AccountManager::Metadata->new(
file => $file1->filename()
);
} qr/^Failed to parse file: \S+ parser error : Document is empty/,
......@@ -54,7 +54,7 @@ EOF
close($file2);
throws_ok {
$metadata = AccountManager::SAMLMetadata->new(
$metadata = AccountManager::Metadata->new(
file => $file2->filename()
);
} qr/^Failed to parse file: \S+ parser error : Start tag expected/,
......@@ -69,14 +69,14 @@ EOF
close($file3);
throws_ok {
$metadata = AccountManager::SAMLMetadata->new(
$metadata = AccountManager::Metadata->new(
file => $file3->filename()
);
} qr/^incorrect root element type 'root'/,
'instanciation: incorrect xml file';
lives_ok {
$metadata = AccountManager::SAMLMetadata->new(
$metadata = AccountManager::Metadata->new(
file => 't/edugain.xml'
);
} 'instanciation: edugain metadata';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment