diff --git a/core/modules/file/tests/src/Functional/Hal/FileHalJsonAnonTest.php b/core/modules/file/tests/src/Functional/Hal/FileHalJsonAnonTest.php
index f90b57ecbe5b1ab951bdcd6774de513ba66fb63a..bf24dadd9d2f6bd4c06e3cdc94c3cde2036bed63 100644
--- a/core/modules/file/tests/src/Functional/Hal/FileHalJsonAnonTest.php
+++ b/core/modules/file/tests/src/Functional/Hal/FileHalJsonAnonTest.php
@@ -2,7 +2,6 @@
 
 namespace Drupal\Tests\file\Functional\Hal;
 
-use Drupal\Core\Cache\Cache;
 use Drupal\Tests\file\Functional\Rest\FileResourceTestBase;
 use Drupal\Tests\hal\Functional\EntityResource\HalEntityNormalizationTrait;
 use Drupal\Tests\rest\Functional\AnonResourceTestTrait;
@@ -44,7 +43,6 @@ protected function getExpectedNormalizedEntity() {
     $normalization = $this->applyHalFieldNormalization($default_normalization);
 
     $url = file_create_url($this->entity->getFileUri());
-    // @see \Drupal\Tests\hal\Functional\EntityResource\File\FileHalJsonAnonTest::testGetBcUriField()
     if ($this->config('hal.settings')->get('bc_file_uri_as_url_normalizer')) {
       $normalization['uri'][0]['value'] = $url;
     }
@@ -100,13 +98,6 @@ protected function getNormalizedPostEntity() {
     ];
   }
 
-  /**
-   * {@inheritdoc}
-   */
-  protected function getExpectedCacheTags() {
-    return Cache::mergeTags(parent::getExpectedCacheTags(), ['config:hal.settings']);
-  }
-
   /**
    * {@inheritdoc}
    */
@@ -117,31 +108,4 @@ protected function getExpectedCacheContexts() {
     ];
   }
 
-  /**
-   * @see hal_update_8501()
-   *
-   * @group legacy
-   * @expectedDeprecation Replacing the file uri with the URL is deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. Use the provided url property instead and disable hal.settings:bc_file_uri_as_url_normalizer. See https://www.drupal.org/node/2925783
-   */
-  public function testGetBcUriField() {
-    $this->config('hal.settings')->set('bc_file_uri_as_url_normalizer', TRUE)->save(TRUE);
-
-    $this->initAuthentication();
-    $url = $this->getEntityResourceUrl();
-    $url->setOption('query', ['_format' => static::$format]);
-    $request_options = $this->getAuthenticationRequestOptions('GET');
-    $this->provisionEntityResource();
-    $this->setUpAuthorization('GET');
-    $response = $this->request('GET', $url, $request_options);
-    $expected = $this->getExpectedNormalizedEntity();
-    static::recursiveKSort($expected);
-    $actual = $this->serializer->decode((string) $response->getBody(), static::$format);
-    static::recursiveKSort($actual);
-    $this->assertSame($expected, $actual);
-
-    // Explicitly assert that $file->uri->value is an absolute file URL, unlike
-    // the default normalization.
-    $this->assertSame($this->baseUrl . '/' . $this->siteDirectory . '/files/drupal.txt', $actual['uri'][0]['value']);
-  }
-
 }
diff --git a/core/modules/hal/config/install/hal.settings.yml b/core/modules/hal/config/install/hal.settings.yml
index c62cb6a04819ec264d5cf55542276f89d5541c6b..67107af00d34bdddac5e35ad25b0ad6c4cea682a 100644
--- a/core/modules/hal/config/install/hal.settings.yml
+++ b/core/modules/hal/config/install/hal.settings.yml
@@ -1,11 +1,3 @@
 # Set the domain for HAL type and relation links.
 # If left blank, the site's domain will be used.
 link_domain: ~
-# Before Drupal 8.5, the File entity 'uri' field value was overridden to return
-# the absolute file URL instead of the actual (stream wrapper) URI. The default
-# for new sites is now to return the actual URI as well as a root-relative file
-# URL. Enable this setting to use the previous behavior. For existing sites,
-# the previous behavior is kept by default.
-# @see hal_update_8501()
-# @see https://www.drupal.org/node/2925783
-bc_file_uri_as_url_normalizer: false
diff --git a/core/modules/hal/config/schema/hal.schema.yml b/core/modules/hal/config/schema/hal.schema.yml
index cad1bdb722b813dc45b80c540c1ed19f83edcb92..3192d6758052417bb4bfe895a464b88c260dfeeb 100644
--- a/core/modules/hal/config/schema/hal.schema.yml
+++ b/core/modules/hal/config/schema/hal.schema.yml
@@ -6,6 +6,3 @@ hal.settings:
     link_domain:
       type: string
       label: 'Domain of the relation'
-    bc_file_uri_as_url_normalizer:
-      type: boolean
-      label: 'Whether to retain pre Drupal 8.5 behavior of normalizing the File entity "uri" field value to an absolute URL.'
diff --git a/core/modules/hal/hal.post_update.php b/core/modules/hal/hal.post_update.php
new file mode 100644
index 0000000000000000000000000000000000000000..0832512d5349371065b86baa850845192a5a1710
--- /dev/null
+++ b/core/modules/hal/hal.post_update.php
@@ -0,0 +1,16 @@
+<?php
+
+/**
+ * @file
+ * Post update functions for Hal.
+ */
+
+/**
+ * Remove obsolete hal.settings configuration key.
+ */
+function hal_post_update_delete_settings() {
+  \Drupal::configFactory()
+    ->getEditable('hal.settings')
+    ->clear('bc_file_uri_as_url_normalizer')
+    ->save();
+}
diff --git a/core/modules/hal/hal.services.yml b/core/modules/hal/hal.services.yml
index 34aaf6581c0ade1ce80abfad2b4d0fc09feac980..38ffb226127f39ab64a74f5ee3f9c977af71b619 100644
--- a/core/modules/hal/hal.services.yml
+++ b/core/modules/hal/hal.services.yml
@@ -21,7 +21,7 @@ services:
    class: Drupal\hal\Normalizer\TimestampItemNormalizer
    tags:
      # Priority must be higher than serializer.normalizer.field_item.hal.
-     - { name: normalizer, priority: 20, bc: bc_timestamp_normalizer_unix, bc_config_name: 'serialization.settings' }
+     - { name: normalizer, priority: 20 }
   serializer.normalizer.entity.hal:
     class: Drupal\hal\Normalizer\ContentEntityNormalizer
     arguments: ['@hal.link_manager', '@entity_type.manager', '@module_handler', '@entity_type.repository', '@entity_field.manager']
diff --git a/core/modules/hal/src/LinkManager/RelationLinkManager.php b/core/modules/hal/src/LinkManager/RelationLinkManager.php
index 97b78de504f75e7140948511d1977725dcf441bd..e56b20de6fad15033f82848e856a4be5e3b9c0cb 100644
--- a/core/modules/hal/src/LinkManager/RelationLinkManager.php
+++ b/core/modules/hal/src/LinkManager/RelationLinkManager.php
@@ -92,7 +92,6 @@ public function getRelationUri($entity_type, $bundle, $field_name, $context = []
     // override the RelationLinkManager class/service to return the desired URL.
     $uri = $this->getLinkDomain($context) . "/rest/relation/$entity_type/$bundle/$field_name";
     $this->moduleHandler->alter('hal_relation_uri', $uri, $context);
-    $this->moduleHandler->alterDeprecated('This hook is deprecated in Drupal 8.3.x and will be removed before Drupal 9.0.0. Implement hook_hal_relation_uri_alter() instead.', 'rest_relation_uri', $uri, $context);
     return $uri;
   }
 
@@ -125,11 +124,7 @@ public function getRelationInternalIds($relation_uri, $context = []) {
    *   - 'entity_type_id'
    *   - 'bundle'
    *   - 'field_name'
-   *   - 'entity_type' (deprecated)
    *   The values for 'entity_type_id', 'bundle' and 'field_name' are strings.
-   *   The 'entity_type' key exists for backwards compatibility and its value is
-   *   the full entity type object. The 'entity_type' key will be removed before
-   *   Drupal 9.0.
    *
    * @see https://www.drupal.org/node/2877608
    */
@@ -143,10 +138,6 @@ protected function getRelations($context = []) {
       $data = $cache->data;
     }
 
-    // @todo https://www.drupal.org/node/2716163 Remove this in Drupal 9.0.
-    foreach ($data as $relation_uri => $ids) {
-      $data[$relation_uri]['entity_type'] = $this->entityTypeManager->getDefinition($ids['entity_type_id']);
-    }
     return $data;
   }
 
diff --git a/core/modules/hal/src/LinkManager/RelationLinkManagerInterface.php b/core/modules/hal/src/LinkManager/RelationLinkManagerInterface.php
index 8ba8c949e8164376c259facd20d2014fd2771d67..7d84894326a3108dac96aaad23391dcf9b50e934 100644
--- a/core/modules/hal/src/LinkManager/RelationLinkManagerInterface.php
+++ b/core/modules/hal/src/LinkManager/RelationLinkManagerInterface.php
@@ -32,9 +32,7 @@ public function getRelationUri($entity_type, $bundle, $field_name, $context = []
    *   Relation URI (or IANA link relation type) to transform into internal IDs.
    *
    * @return array
-   *   Array with keys 'entity_type_id', 'bundle' and 'field_name'. For
-   *   backwards compatibility, the entity_type key returns the full entity type
-   *   object, this will be removed before Drupal 9.0.
+   *   Array with keys 'entity_type_id', 'bundle' and 'field_name'.
    */
   public function getRelationInternalIds($relation_uri);
 
diff --git a/core/modules/hal/src/LinkManager/TypeLinkManager.php b/core/modules/hal/src/LinkManager/TypeLinkManager.php
index 4cb4908acb279442595565fda9750c10b39ca292..4996f8099ac858a79e9c05deb86b04b8a4b65aba 100644
--- a/core/modules/hal/src/LinkManager/TypeLinkManager.php
+++ b/core/modules/hal/src/LinkManager/TypeLinkManager.php
@@ -83,7 +83,6 @@ public function getTypeUri($entity_type, $bundle, $context = []) {
     // TypeLinkManager class/service to return the desired URL.
     $uri = $this->getLinkDomain($context) . "/rest/type/$entity_type/$bundle";
     $this->moduleHandler->alter('hal_type_uri', $uri, $context);
-    $this->moduleHandler->alterDeprecated('This hook is deprecated in Drupal 8.3.x and will be removed before Drupal 9.0.0. Implement hook_hal_type_uri_alter() instead.', 'rest_type_uri', $uri, $context);
     return $uri;
   }
 
diff --git a/core/modules/hal/src/Normalizer/FileEntityNormalizer.php b/core/modules/hal/src/Normalizer/FileEntityNormalizer.php
index 94e1e0bc8130a076c368e801a00690481f37e44a..249077085784318c33c75cc7b9d7f42ed60a8ca4 100644
--- a/core/modules/hal/src/Normalizer/FileEntityNormalizer.php
+++ b/core/modules/hal/src/Normalizer/FileEntityNormalizer.php
@@ -59,25 +59,6 @@ public function __construct(EntityTypeManagerInterface $entity_type_manager, Lin
     $this->halSettings = $config_factory->get('hal.settings');
   }
 
-  /**
-   * {@inheritdoc}
-   *
-   * @deprecated in drupal:8.5.0 and is removed from drupal:9.0.0.
-   */
-  public function normalize($entity, $format = NULL, array $context = []) {
-    $data = parent::normalize($entity, $format, $context);
-
-    $this->addCacheableDependency($context, $this->halSettings);
-
-    if ($this->halSettings->get('bc_file_uri_as_url_normalizer')) {
-      // Replace the file url with a full url for the file.
-      $data['uri'][0]['value'] = $this->getEntityUri($entity);
-      @trigger_error("Replacing the file uri with the URL is deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. Use the provided url property instead and disable hal.settings:bc_file_uri_as_url_normalizer. See https://www.drupal.org/node/2925783", E_USER_DEPRECATED);
-    }
-
-    return $data;
-  }
-
   /**
    * {@inheritdoc}
    */
diff --git a/core/modules/hal/src/Normalizer/NormalizerBase.php b/core/modules/hal/src/Normalizer/NormalizerBase.php
index 8b18985b8b46adc40593e6958159693fc85cac2a..7449edfde4a9f3670b6e0b47b211f479af8b2870 100644
--- a/core/modules/hal/src/Normalizer/NormalizerBase.php
+++ b/core/modules/hal/src/Normalizer/NormalizerBase.php
@@ -15,17 +15,4 @@ abstract class NormalizerBase extends SerializationNormalizerBase implements Den
    */
   protected $format = ['hal_json'];
 
-  /**
-   * {@inheritdoc}
-   */
-  protected function checkFormat($format = NULL) {
-    if (isset($this->formats)) {
-      @trigger_error('::formats is deprecated in Drupal 8.4.0 and will be removed before Drupal 9.0.0. Use ::$format instead. See https://www.drupal.org/node/2868275', E_USER_DEPRECATED);
-
-      $this->format = $this->formats;
-    }
-
-    return parent::checkFormat($format);
-  }
-
 }
diff --git a/core/modules/hal/tests/modules/hal_test/hal_test.module b/core/modules/hal/tests/modules/hal_test/hal_test.module
index 82363458715853750379b2c7ded95863ef80e843..da71ffbd947b5db07fc2c5e3378e160905dcfcc7 100644
--- a/core/modules/hal/tests/modules/hal_test/hal_test.module
+++ b/core/modules/hal/tests/modules/hal_test/hal_test.module
@@ -22,29 +22,3 @@ function hal_test_hal_relation_uri_alter(&$uri, $context = []) {
     $uri = 'hal_test_relation';
   }
 }
-
-/**
- * Implements hook_rest_type_uri_alter().
- *
- * @deprecated Kept only for BC test coverage, see \Drupal\Tests\hal\Kernel\HalLinkManagerTest::testGetTypeUri().
- *
- * @see https://www.drupal.org/node/2830467
- */
-function hal_test_rest_type_uri_alter(&$uri, $context = []) {
-  if (!empty($context['rest_test'])) {
-    $uri = 'rest_test_type';
-  }
-}
-
-/**
- * Implements hook_rest_relation_uri_alter().
- *
- * @deprecated Kept only for BC test coverage, see \Drupal\Tests\hal\Kernel\HalLinkManagerTest::testGetRelationUri().
- *
- * @see https://www.drupal.org/node/2830467
- */
-function hal_test_rest_relation_uri_alter(&$uri, $context = []) {
-  if (!empty($context['rest_test'])) {
-    $uri = 'rest_test_relation';
-  }
-}
diff --git a/core/modules/hal/tests/src/Functional/EntityResource/Comment/CommentHalJsonTestBase.php b/core/modules/hal/tests/src/Functional/EntityResource/Comment/CommentHalJsonTestBase.php
deleted file mode 100644
index d647a829610356c51008b453219a33c37630183b..0000000000000000000000000000000000000000
--- a/core/modules/hal/tests/src/Functional/EntityResource/Comment/CommentHalJsonTestBase.php
+++ /dev/null
@@ -1,16 +0,0 @@
-<?php
-
-namespace Drupal\Tests\hal\Functional\EntityResource\Comment;
-
-@trigger_error('The ' . __NAMESPACE__ . '\CommentHalJsonTestBase is deprecated in Drupal 8.6.x and will be removed before Drupal 9.0.0. Instead, use Drupal\Tests\comment\Functional\Hal\CommentHalJsonTestBase. See https://www.drupal.org/node/2971931.', E_USER_DEPRECATED);
-
-use Drupal\Tests\comment\Functional\Hal\CommentHalJsonTestBase as CommentHalJsonTestBaseReal;
-
-/**
- * @deprecated in drupal:8.6.0 and is removed from drupal:9.0.0. Use
- *   Drupal\Tests\comment\Functional\Hal\CommentHalJsonTestBase instead.
- *
- * @see https://www.drupal.org/node/2971931
- */
-abstract class CommentHalJsonTestBase extends CommentHalJsonTestBaseReal {
-}
diff --git a/core/modules/hal/tests/src/Functional/EntityResource/Feed/FeedHalJsonTestBase.php b/core/modules/hal/tests/src/Functional/EntityResource/Feed/FeedHalJsonTestBase.php
deleted file mode 100644
index 0bf1173c9099208862700378649e58642950d6ce..0000000000000000000000000000000000000000
--- a/core/modules/hal/tests/src/Functional/EntityResource/Feed/FeedHalJsonTestBase.php
+++ /dev/null
@@ -1,16 +0,0 @@
-<?php
-
-namespace Drupal\Tests\hal\Functional\EntityResource\Feed;
-
-@trigger_error('The ' . __NAMESPACE__ . '\FeedHalJsonTestBase is deprecated in Drupal 8.6.x and will be removed before Drupal 9.0.0. Instead, use Drupal\Tests\aggregator\Functional\Hal\FeedHalJsonTestBase. See https://www.drupal.org/node/2971931.', E_USER_DEPRECATED);
-
-use Drupal\Tests\aggregator\Functional\Hal\FeedHalJsonTestBase as FeedHalJsonTestBaseReal;
-
-/**
- * @deprecated in drupal:8.6.0 and is removed from drupal:9.0.0. Use
- *   Drupal\Tests\aggregator\Functional\Hal\FeedHalJsonTestBase instead.
- *
- * @see https://www.drupal.org/node/2971931
- */
-abstract class FeedHalJsonTestBase extends FeedHalJsonTestBaseReal {
-}
diff --git a/core/modules/hal/tests/src/Functional/EntityResource/File/FileUploadHalJsonTestBase.php b/core/modules/hal/tests/src/Functional/EntityResource/File/FileUploadHalJsonTestBase.php
deleted file mode 100644
index 8d61811d7becb6f60edea4732e622850406b43da..0000000000000000000000000000000000000000
--- a/core/modules/hal/tests/src/Functional/EntityResource/File/FileUploadHalJsonTestBase.php
+++ /dev/null
@@ -1,16 +0,0 @@
-<?php
-
-namespace Drupal\Tests\hal\Functional\EntityResource\File;
-
-@trigger_error('The ' . __NAMESPACE__ . '\FileUploadHalJsonTestBase is deprecated in Drupal 8.6.x and will be removed before Drupal 9.0.0. Instead, use Drupal\Tests\file\Functional\Hal\FileUploadHalJsonTestBase. See https://www.drupal.org/node/2971931.', E_USER_DEPRECATED);
-
-use Drupal\Tests\file\Functional\Hal\FileUploadHalJsonTestBase as FileUploadHalJsonTestBaseReal;
-
-/**
- * @deprecated in drupal:8.6.0 and is removed from drupal:9.0.0. Use
- *   Drupal\Tests\file\Functional\Hal\FileUploadHalJsonTestBase instead.
- *
- * @see https://www.drupal.org/node/2971931
- */
-abstract class FileUploadHalJsonTestBase extends FileUploadHalJsonTestBaseReal {
-}
diff --git a/core/modules/hal/tests/src/Functional/EntityResource/Item/ItemHalJsonTestBase.php b/core/modules/hal/tests/src/Functional/EntityResource/Item/ItemHalJsonTestBase.php
deleted file mode 100644
index f7f3548788a7241d6eae1d710d979e03cddb66ec..0000000000000000000000000000000000000000
--- a/core/modules/hal/tests/src/Functional/EntityResource/Item/ItemHalJsonTestBase.php
+++ /dev/null
@@ -1,16 +0,0 @@
-<?php
-
-namespace Drupal\Tests\hal\Functional\EntityResource\Item;
-
-@trigger_error('The ' . __NAMESPACE__ . '\ItemHalJsonTestBase is deprecated in Drupal 8.6.x and will be removed before Drupal 9.0.0. Instead, use Drupal\Tests\aggregator\Functional\Hal\ItemHalJsonTestBase. See https://www.drupal.org/node/2971931.', E_USER_DEPRECATED);
-
-use Drupal\Tests\aggregator\Functional\Hal\ItemHalJsonTestBase as ItemHalJsonTestBaseReal;
-
-/**
- * @deprecated in drupal:8.6.0 and is removed from drupal:9.0.0. Use
- *   Drupal\Tests\aggregator\Functional\Hal\ItemHalJsonTestBase instead.
- *
- * @see https://www.drupal.org/node/2971931
- */
-abstract class ItemHalJsonTestBase extends ItemHalJsonTestBaseReal {
-}
diff --git a/core/modules/hal/tests/src/Functional/Update/HalSettingsDeletionUpdateTest.php b/core/modules/hal/tests/src/Functional/Update/HalSettingsDeletionUpdateTest.php
new file mode 100644
index 0000000000000000000000000000000000000000..61cef95d00c5fae0da7a95edabd5eaa26fed796e
--- /dev/null
+++ b/core/modules/hal/tests/src/Functional/Update/HalSettingsDeletionUpdateTest.php
@@ -0,0 +1,40 @@
+<?php
+
+namespace Drupal\Tests\hal\Functional\Update;
+
+use Drupal\FunctionalTests\Update\UpdatePathTestBase;
+
+/**
+ * Ensures that update hook is run properly for deleting obsolete Hal settings.
+ *
+ * @group hal
+ * @group legacy
+ */
+class HalSettingsDeletionUpdateTest extends UpdatePathTestBase {
+
+  /**
+   * {@inheritdoc}
+   */
+  protected function setDatabaseDumpFiles() {
+    $this->databaseDumpFiles = [
+      __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.8.0.filled.standard.php.gz',
+    ];
+  }
+
+  /**
+   * Ensures that update hook is run for "hal" module.
+   */
+  public function testUpdate() {
+
+    $hal_settings = $this->config('hal.settings');
+    $this->assertFalse($hal_settings->isNew());
+    $this->assertTrue($hal_settings->get('bc_file_uri_as_url_normalizer'));
+
+    $this->runUpdates();
+
+    $hal_settings = \Drupal::configFactory()->get('hal.settings');
+    $this->assertFalse($hal_settings->isNew());
+    $this->assertNull($hal_settings->get('bc_file_uri_as_url_normalizer'));
+  }
+
+}
diff --git a/core/modules/hal/tests/src/Kernel/HalLinkManagerTest.php b/core/modules/hal/tests/src/Kernel/HalLinkManagerTest.php
index 05a6b39f1ee78deffbb0372b17b8cae61c8be11a..33366eca27c57306883aa4b6d749ee2a8a103717 100644
--- a/core/modules/hal/tests/src/Kernel/HalLinkManagerTest.php
+++ b/core/modules/hal/tests/src/Kernel/HalLinkManagerTest.php
@@ -13,7 +13,6 @@
 /**
  * @coversDefaultClass \Drupal\hal\LinkManager\LinkManager
  * @group hal
- * @group legacy
  */
 class HalLinkManagerTest extends KernelTestBase {
 
@@ -50,7 +49,6 @@ protected function setUp() {
   /**
    * @covers ::getTypeUri
    * @dataProvider providerTestGetTypeUri
-   * @expectedDeprecation The deprecated alter hook hook_rest_type_uri_alter() is implemented in these functions: hal_test_rest_type_uri_alter. This hook is deprecated in Drupal 8.3.x and will be removed before Drupal 9.0.0. Implement hook_hal_type_uri_alter() instead.
    */
   public function testGetTypeUri($link_domain, $entity_type, $bundle, array $context, $expected_return, array $expected_context) {
     $hal_settings = \Drupal::configFactory()->getEditable('hal.settings');
@@ -62,7 +60,7 @@ public function testGetTypeUri($link_domain, $entity_type, $bundle, array $conte
       $hal_settings->set('link_domain', $link_domain)->save(TRUE);
     }
 
-    /* @var \Drupal\rest\LinkManager\TypeLinkManagerInterface $type_manager */
+    /* @var \Drupal\hal\LinkManager\TypeLinkManagerInterface $type_manager */
     $type_manager = \Drupal::service('hal.link_manager.type');
 
     $link = $type_manager->getTypeUri($entity_type, $bundle, $context);
@@ -108,18 +106,6 @@ public function providerTestGetTypeUri() {
         // No cacheability metadata bubbled.
         'expected context' => ['hal_test' => TRUE] + $serialization_context_collecting_cacheability,
       ],
-      // Test hook_rest_type_uri_alter() — for backwards compatibility.
-      'site URL, with optional context, to test hook_rest_type_uri_alter()' => $base_test_case + [
-        'context' => ['rest_test' => TRUE],
-        'expected return' => 'rest_test_type',
-        'expected context' => ['rest_test' => TRUE],
-      ],
-      'site URL, with optional context, to test hook_rest_type_uri_alter(), and collecting cacheability metadata' => $base_test_case + [
-        'context' => ['rest_test' => TRUE] + $serialization_context_collecting_cacheability,
-        'expected return' => 'rest_test_type',
-          // No cacheability metadata bubbled.
-        'expected context' => ['rest_test' => TRUE] + $serialization_context_collecting_cacheability,
-      ],
       'configured URL' => [
         'link_domain' => 'http://llamas-rock.com/for-real/',
         'entity_type' => 'node',
@@ -144,7 +130,6 @@ public function providerTestGetTypeUri() {
   /**
    * @covers ::getRelationUri
    * @dataProvider providerTestGetRelationUri
-   * @expectedDeprecation The deprecated alter hook hook_rest_relation_uri_alter() is implemented in these functions: hal_test_rest_relation_uri_alter. This hook is deprecated in Drupal 8.3.x and will be removed before Drupal 9.0.0. Implement hook_hal_relation_uri_alter() instead.
    */
   public function testGetRelationUri($link_domain, $entity_type, $bundle, $field_name, array $context, $expected_return, array $expected_context) {
     $hal_settings = \Drupal::configFactory()->getEditable('hal.settings');
@@ -156,7 +141,7 @@ public function testGetRelationUri($link_domain, $entity_type, $bundle, $field_n
       $hal_settings->set('link_domain', $link_domain)->save(TRUE);
     }
 
-    /* @var \Drupal\rest\LinkManager\RelationLinkManagerInterface $relation_manager */
+    /* @var \Drupal\hal\LinkManager\RelationLinkManagerInterface $relation_manager */
     $relation_manager = \Drupal::service('hal.link_manager.relation');
 
     $link = $relation_manager->getRelationUri($entity_type, $bundle, $field_name, $context);
@@ -204,18 +189,6 @@ public function providerTestGetRelationUri() {
         // No cacheability metadata bubbled.
         'expected context' => ['hal_test' => TRUE] + $serialization_context_collecting_cacheability,
       ],
-      // Test hook_rest_relation_uri_alter() — for backwards compatibility.
-      'site URL, with optional context, to test hook_rest_relation_uri_alter()' => $base_test_case + [
-        'context' => ['rest_test' => TRUE],
-        'expected return' => 'rest_test_relation',
-        'expected context' => ['rest_test' => TRUE],
-      ],
-      'site URL, with optional context, to test hook_rest_relation_uri_alter(), and collecting cacheability metadata' => $base_test_case + [
-        'context' => ['rest_test' => TRUE] + $serialization_context_collecting_cacheability,
-        'expected return' => 'rest_test_relation',
-        // No cacheability metadata bubbled.
-        'expected context' => ['rest_test' => TRUE] + $serialization_context_collecting_cacheability,
-      ],
       'configured URL' => [
         'link_domain' => 'http://llamas-rock.com/for-real/',
         'entity_type' => 'node',
@@ -243,14 +216,13 @@ public function providerTestGetRelationUri() {
    * @covers ::getRelationInternalIds
    */
   public function testGetRelationInternalIds() {
-    /* @var \Drupal\rest\LinkManager\RelationLinkManagerInterface $relation_manager */
+    /* @var \Drupal\hal\LinkManager\RelationLinkManagerInterface $relation_manager */
     $relation_manager = \Drupal::service('hal.link_manager.relation');
     $link = $relation_manager->getRelationUri('node', 'page', 'field_ref');
     $internal_ids = $relation_manager->getRelationInternalIds($link);
 
     $this->assertEquals([
       'entity_type_id' => 'node',
-      'entity_type' => \Drupal::entityTypeManager()->getDefinition('node'),
       'bundle' => 'page',
       'field_name' => 'field_ref',
     ], $internal_ids);
@@ -264,7 +236,7 @@ public function testHalLinkManagersSetLinkDomain() {
       CacheableNormalizerInterface::SERIALIZATION_CONTEXT_CACHEABILITY => new CacheableMetadata(),
     ];
 
-    /* @var \Drupal\rest\LinkManager\LinkManager $link_manager */
+    /* @var \Drupal\hal\LinkManager\LinkManager $link_manager */
     $link_manager = \Drupal::service('hal.link_manager');
     $link_manager->setLinkDomain('http://example.com/');
     $link = $link_manager->getTypeUri('node', 'page', $serialization_context);
diff --git a/core/modules/media/tests/src/Functional/Hal/MediaHalJsonAnonTest.php b/core/modules/media/tests/src/Functional/Hal/MediaHalJsonAnonTest.php
index 6f990b6641d1e4a61127fcc514477b9c784f3621..f8e4b3b4164c870167b18c15bb854af9ba83450c 100644
--- a/core/modules/media/tests/src/Functional/Hal/MediaHalJsonAnonTest.php
+++ b/core/modules/media/tests/src/Functional/Hal/MediaHalJsonAnonTest.php
@@ -2,7 +2,6 @@
 
 namespace Drupal\Tests\media\Functional\Hal;
 
-use Drupal\Core\Cache\Cache;
 use Drupal\file\Entity\File;
 use Drupal\Tests\hal\Functional\EntityResource\HalEntityNormalizationTrait;
 use Drupal\Tests\media\Functional\Rest\MediaResourceTestBase;
@@ -223,11 +222,4 @@ protected function getNormalizedPostEntity() {
     ];
   }
 
-  /**
-   * {@inheritdoc}
-   */
-  protected function getExpectedCacheTags() {
-    return Cache::mergeTags(parent::getExpectedCacheTags(), ['config:hal.settings']);
-  }
-
 }