diff --git a/core/modules/toolbar/lib/Drupal/toolbar/Tests/ToolbarAdminMenuTest.php b/core/modules/toolbar/lib/Drupal/toolbar/Tests/ToolbarAdminMenuTest.php
index b18ad958c5b10ce88a485cd154dc1cef152c068b..7fec4acaec7cc336128ffb76ec383bfe68e23252 100644
--- a/core/modules/toolbar/lib/Drupal/toolbar/Tests/ToolbarAdminMenuTest.php
+++ b/core/modules/toolbar/lib/Drupal/toolbar/Tests/ToolbarAdminMenuTest.php
@@ -440,6 +440,19 @@ function testLocaleTranslationSubtreesHashCacheClear() {
     $this->assertNotEqual($original_subtree_hash, $new_subtree_hash, 'The user-specific subtree menu hash has been updated.');
   }
 
+  /**
+   * Tests that the 'toolbar/subtrees/{hash}' is reachable.
+   */
+  function testSubtreesJsonRequest() {
+    $admin_user = $this->admin_user;
+    $this->drupalLogin($admin_user);
+    // Request a new page to refresh the drupalSettings object.
+    $subtrees_hash = $this->getSubtreesHash();
+
+    $this->drupalGetJSON('toolbar/subtrees/' . $subtrees_hash);
+    $this->assertResponse('200');
+  }
+
   /**
    * Get the hash value from the admin menu subtrees route path.
    *
diff --git a/core/modules/toolbar/toolbar.routing.yml b/core/modules/toolbar/toolbar.routing.yml
index 2e1e4cd5bd76e27ad33eb988e45cf260107b4b22..6e2f2559bb31c2cb1222c8bfc0b197b61388d253 100644
--- a/core/modules/toolbar/toolbar.routing.yml
+++ b/core/modules/toolbar/toolbar.routing.yml
@@ -3,4 +3,4 @@ toolbar.subtrees:
   defaults:
     _controller: '\Drupal\toolbar\Controller\ToolbarController::subtreesJsonp'
   requirements:
-    _custom_access: '\Drupal\toolbar\Routing\ToolbarController::checkSubTreeAccess'
+    _custom_access: '\Drupal\toolbar\Controller\ToolbarController::checkSubTreeAccess'