diff --git a/core/modules/jsonapi/tests/src/Kernel/EventSubscriber/ResourceObjectNormalizerCacherTest.php b/core/modules/jsonapi/tests/src/Kernel/EventSubscriber/ResourceObjectNormalizerCacherTest.php
index e715edc47e193b85536f3128ec199c05ee920962..2d213e970f547037057b0fd51b712f5c7dc7cb6f 100644
--- a/core/modules/jsonapi/tests/src/Kernel/EventSubscriber/ResourceObjectNormalizerCacherTest.php
+++ b/core/modules/jsonapi/tests/src/Kernel/EventSubscriber/ResourceObjectNormalizerCacherTest.php
@@ -9,7 +9,10 @@
 use Drupal\jsonapi\Normalizer\Value\CacheableNormalization;
 use Drupal\KernelTests\KernelTestBase;
 use Drupal\user\Entity\User;
+use Symfony\Component\HttpFoundation\Request;
+use Symfony\Component\HttpFoundation\Response;
 use Symfony\Component\HttpKernel\Event\TerminateEvent;
+use Symfony\Component\HttpKernel\HttpKernelInterface;
 
 /**
  * @coversDefaultClass \Drupal\jsonapi\EventSubscriber\ResourceObjectNormalizationCacher
@@ -92,8 +95,12 @@ public function testLinkNormalizationCacheability() {
       ResourceObjectNormalizationCacher::RESOURCE_CACHE_SUBSET_FIELDS => [],
     ];
     $this->cacher->saveOnTerminate($resource_object, $normalization_parts);
-    $event = $this->prophesize(TerminateEvent::class);
-    $this->cacher->onTerminate($event->reveal());
+
+    $http_kernel = $this->prophesize(HttpKernelInterface::class);
+    $request = $this->prophesize(Request::class);
+    $response = $this->prophesize(Response::class);
+    $event = new TerminateEvent($http_kernel->reveal(), $request->reveal(), $response->reveal());
+    $this->cacher->onTerminate($event);
     $this->assertNotFalse((bool) $this->cacher->get($resource_object));
     Cache::invalidateTags([$cache_tag_to_invalidate]);
     $this->assertFalse((bool) $this->cacher->get($resource_object));