diff --git a/core/modules/migrate/tests/src/Unit/MigrateExecutableTest.php b/core/modules/migrate/tests/src/Unit/MigrateExecutableTest.php
index 97d7662..b9dcb06 100644
--- a/core/modules/migrate/tests/src/Unit/MigrateExecutableTest.php
+++ b/core/modules/migrate/tests/src/Unit/MigrateExecutableTest.php
@@ -59,7 +59,7 @@ protected function setUp() {
    * Tests an import with an incomplete rewinding.
    */
   public function testImportWithFailingRewind() {
-    $exception_message = $this->getRandomGenerator()->string();
+    $exception_message = $this->getRandomGenerator()->randomString(8);
     $source = $this->getMock('Drupal\migrate\Plugin\MigrateSourceInterface');
     $source->expects($this->once())
       ->method('rewind')
@@ -231,7 +231,7 @@ public function testImportWithValidRowNoDestinationValues() {
    * destination.
    */
   public function testImportWithValidRowWithDestinationMigrateException() {
-    $exception_message = $this->getRandomGenerator()->string();
+    $exception_message = $this->getRandomGenerator()->randomString(8);
     $source = $this->getMockSource();
 
     $row = $this->getMockBuilder('Drupal\migrate\Row')
@@ -282,7 +282,7 @@ public function testImportWithValidRowWithDestinationMigrateException() {
    * plugin.
    */
   public function testImportWithValidRowWithProcesMigrateException() {
-    $exception_message = $this->getRandomGenerator()->string();
+    $exception_message = $this->getRandomGenerator()->randomString(8);
     $source = $this->getMockSource();
 
     $row = $this->getMockBuilder('Drupal\migrate\Row')
@@ -328,7 +328,7 @@ public function testImportWithValidRowWithProcesMigrateException() {
    * Tests the import method with a regular Exception being thrown.
    */
   public function testImportWithValidRowWithException() {
-    $exception_message = $this->getRandomGenerator()->string();
+    $exception_message = $this->getRandomGenerator()->randomString(8);
     $source = $this->getMockSource();
 
     $row = $this->getMockBuilder('Drupal\migrate\Row')
