21617: Split test cases.
authorTom Clegg <tom@curii.com>
Fri, 29 Mar 2024 20:37:43 +0000 (16:37 -0400)
committerTom Clegg <tom@curii.com>
Fri, 29 Mar 2024 20:37:43 +0000 (16:37 -0400)
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom@curii.com>

services/api/test/integration/remote_user_test.rb

index 95d240e79ba19e256d322ece576915f3222ffdd6..1a67522f4dde02d165b582d045763ea6cbff1b00 100644 (file)
@@ -594,22 +594,34 @@ class RemoteUsersTest < ActionDispatch::IntegrationTest
   end
 
   [400, 401, 403, 422, 500, 502, 503].each do |status|
-    test "handle #{status} response from getting remote token" do
+    test "handle #{status} response when checking remote-provided v2 token" do
       @stub_token_status = status
       get "/arvados/v1/users/#{@stub_content[:uuid]}",
           params: {format: "json"},
           headers: auth(remote: "zbbbb")
       assert_response(status < 500 ? 401 : status)
+    end
+
+    test "handle #{status} response when checking remote-provided v2 token at anonymously accessible endpoint" do
+      @stub_token_status = status
       get "/arvados/v1/keep_services/accessible",
           params: {format: "json"},
           headers: auth(remote: "zbbbb")
       assert_response(status < 500 ? :success : status)
+    end
 
+    test "handle #{status} response when checking token issued by login cluster" do
+      @stub_token_status = status
       Rails.configuration.Login.LoginCluster = "zbbbb"
       get "/arvados/v1/users/current",
           params: {format: "json"},
           headers: {'HTTP_AUTHORIZATION' => "Bearer badtoken"}
       assert_response(status < 500 ? 401 : status)
+    end
+
+    test "handle #{status} response when checking token issued by login cluster at anonymously accessible endpoint" do
+      @stub_token_status = status
+      Rails.configuration.Login.LoginCluster = "zbbbb"
       get "/arvados/v1/keep_services/accessible",
           params: {format: "json"},
           headers: {'HTTP_AUTHORIZATION' => "Bearer badtoken"}