diff --git a/core/tests/Drupal/KernelTests/Core/Extension/ModuleConfigureRouteTest.php b/core/tests/Drupal/KernelTests/Core/Extension/ModuleConfigureRouteTest.php
index e81a11de31b1fe73b068b15d78818b85fdce91d3..8702ca87b6dafdd014ec4b7591f14246cd26d912 100644
--- a/core/tests/Drupal/KernelTests/Core/Extension/ModuleConfigureRouteTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Extension/ModuleConfigureRouteTest.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\KernelTests\Core\Extension;
 
+use Drupal\Core\Extension\ExtensionLifecycle;
 use Drupal\KernelTests\FileSystemModuleDiscoveryDataProviderTrait;
 use Drupal\KernelTests\KernelTestBase;
 
@@ -42,7 +43,7 @@ protected function setUp(): void {
   }
 
   /**
-   * Tests the module configure routes exist.
+   * Tests if the module configure routes exists.
    *
    * @dataProvider coreModuleListDataProvider
    */
@@ -51,9 +52,44 @@ public function testModuleConfigureRoutes($module) {
     if (!isset($module_info['configure'])) {
       $this->markTestSkipped("$module has no configure route");
     }
-    $this->container->get('module_installer')->install([$module]);
+    $module_lifecycle = $module_info[ExtensionLifecycle::LIFECYCLE_IDENTIFIER];
+    if (isset($module_lifecycle) && $module_lifecycle === ExtensionLifecycle::DEPRECATED) {
+      $this->assertDeprecatedModuleConfigureRoutesExist($module, $module_info);
+    }
+    else {
+      $this->container->get('module_installer')->install([$module]);
+      $this->assertModuleConfigureRoutesExist($module, $module_info);
+    }
+  }
+
+  /**
+   * Asserts the configure routes of a module with lifecycle deprecated exist.
+   *
+   * Note: This test is part of group legacy, to make sure installing the
+   * deprecated module doesn't trigger a deprecation notice.
+   *
+   * @group legacy
+   *
+   * @internal
+   */
+  protected function assertDeprecatedModuleConfigureRoutesExist(string $module_name, array $module_info): void {
+    $this->container->get('module_installer')->install([$module_name]);
+    $this->assertModuleConfigureRoutesExist($module_name, $module_info);
+  }
+
+  /**
+   * Asserts the configure routes of a module exist.
+   *
+   * @param string $module_name
+   *   The name of the module.
+   * @param array $module_info
+   *   An array module info.
+   *
+   * @internal
+   */
+  protected function assertModuleConfigureRoutesExist(string $module_name, array $module_info): void {
     $route = $this->routeProvider->getRouteByName($module_info['configure']);
-    $this->assertNotEmpty($route, sprintf('The configure route for the "%s" module was found.', $module));
+    $this->assertNotEmpty($route, sprintf('The configure route for the "%s" module was found.', $module_name));
   }
 
 }
