Bug 28722: Regression tests
authorTomas Cohen Arazi <tomascohen@theke.io>
Thu, 9 Sep 2021 11:23:48 +0000 (08:23 -0300)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Thu, 30 Sep 2021 07:19:05 +0000 (09:19 +0200)
To test:
1. Apply this patch
2. Run:
   $ kshell
  k$ prove tt/db_dependent/api/v1/oauth.t
=> FAIL: Tests fail!

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
https://bugs.koha-community.org/show_bug.cgi?id=28772

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
t/db_dependent/api/v1/oauth.t

index 4e464d5..c938179 100755 (executable)
@@ -97,7 +97,7 @@ subtest 'Net::OAuth2::AuthorizationServer missing tests' => sub {
     my $form_data = {
         grant_type    => 'client_credentials',
         client_id     => $api_key->client_id,
-        client_secret => $api_key->secret
+        client_secret => $api_key->plain_text_secret
     };
 
     $t->post_ok( '/api/v1/oauth/token', form => $form_data )->status_is(200)
@@ -138,7 +138,7 @@ sub run_oauth_tests {
 
     my $formData;
     my $client_id     = $api_key->client_id;
-    my $client_secret = $api_key->secret;
+    my $client_secret = $api_key->plain_text_secret;
 
     if ( $test_case eq 'header' ) {
 
@@ -154,7 +154,7 @@ sub run_oauth_tests {
         $formData = {
             grant_type    => 'client_credentials',
             client_id     => $api_key->client_id,
-            client_secret => $api_key->secret
+            client_secret => $api_key->plain_text_secret
         };
 
         $t->post_ok('/api/v1/oauth/token', form => $formData)