Artifactory-Client
view release on metacpan or search on metacpan
t/01_unit.t view on Meta::CPAN
'_content' => 'content of artifact',
'_rc' => 200,
'_headers' => bless( {}, 'HTTP::Headers' ),
},
'HTTP::Response'
);
}
};
my $resp2 = $client->item_properties( path => $path );
my $scalar = decode_json( $resp2->decoded_content );
is_deeply( $scalar->{properties}, $properties, 'properties are correct' );
my $artifact_url = "$artifactory:$port/$repository$path";
my $resp3 = $client->get($artifact_url);
is( $resp3->decoded_content, $content, 'content matches' );
};
subtest 'set_item_properties on non-existing artifact', sub {
my $client = setup();
my $properties = {
one => [1],
two => [2],
};
local *{'LWP::UserAgent::put'} = sub {
t/01_unit.t view on Meta::CPAN
"that" : [ "one" ]
}
}',
'_headers' => bless( {}, 'HTTP::Headers' ),
},
'HTTP::Response'
);
};
my $resp = $client->item_properties( path => '/unique_path', properties => ['that'] );
my $scalar = decode_json( $resp->decoded_content );
is_deeply( $scalar->{properties}, { that => ['one'] }, 'property content is correct' );
};
subtest 'retrieve artifact', sub {
my $client = setup();
my $content = "content of artifact";
local *{'LWP::UserAgent::get'} = sub {
return bless(
{
'_content' => 'content of artifact',
'_headers' => bless( {}, 'HTTP::Headers' ),
},
'HTTP::Response'
);
};
my $resp = $client->retrieve_artifact('/unique_path');
is( $resp->decoded_content, $content, 'artifact retrieved successfully' );
};
subtest 'all_builds', sub {
my $client = setup();
local *{'LWP::UserAgent::get'} = sub {
return $mock_responses{http_200};
};
my $resp = $client->all_builds();
is( $resp->is_success, 1, 'fetched all builds' );
( run in 0.254 second using v1.01-cache-2.11-cpan-26ccb49234f )