diff --git a/src/Event/AkamaiHeaderEvents.php b/src/Event/AkamaiHeaderEvents.php
index 47ac999..4316cb7 100644
--- a/src/Event/AkamaiHeaderEvents.php
+++ b/src/Event/AkamaiHeaderEvents.php
@@ -2,7 +2,7 @@
 
 namespace Drupal\akamai\Event;
 
-use Symfony\Component\EventDispatcher\Event;
+use Drupal\Component\EventDispatcher\Event;
 
 /**
  * Event that is fired when Akamai header is formed.
diff --git a/src/Event/AkamaiPurgeEvents.php b/src/Event/AkamaiPurgeEvents.php
index 1ab5aac..633bd04 100644
--- a/src/Event/AkamaiPurgeEvents.php
+++ b/src/Event/AkamaiPurgeEvents.php
@@ -2,7 +2,7 @@
 
 namespace Drupal\akamai\Event;
 
-use Symfony\Component\EventDispatcher\Event;
+use Drupal\Component\EventDispatcher\Event;
 
 /**
  * Event that is fired when Akamai purge is formed.
diff --git a/src/EventSubscriber/CacheableResponseSubscriber.php b/src/EventSubscriber/CacheableResponseSubscriber.php
index 4e81790..47c4fea 100644
--- a/src/EventSubscriber/CacheableResponseSubscriber.php
+++ b/src/EventSubscriber/CacheableResponseSubscriber.php
@@ -68,7 +68,7 @@ class CacheableResponseSubscriber implements EventSubscriberInterface {
    *   The event to process.
    */
   public function onRespond(FilterResponseEvent $event) {
-    if (!$event->isMasterRequest()) {
+    if (!$event->isMainRequest()) {
       return;
     }
 
@@ -92,7 +92,7 @@ class CacheableResponseSubscriber implements EventSubscriberInterface {
 
       // Instantiate our event.
       $event = new AkamaiHeaderEvents($tags);
-      $this->eventDispatcher->dispatch(AkamaiHeaderEvents::HEADER_CREATION, $event);
+      $this->eventDispatcher->dispatch($event, AkamaiHeaderEvents::HEADER_CREATION);
       $tags = $event->data;
       foreach ($tags as &$tag) {
         $tag = $this->tagFormatter->format($tag);
diff --git a/src/Plugin/Purge/Purger/AkamaiTagPurger.php b/src/Plugin/Purge/Purger/AkamaiTagPurger.php
index 91395ca..a184140 100644
--- a/src/Plugin/Purge/Purger/AkamaiTagPurger.php
+++ b/src/Plugin/Purge/Purger/AkamaiTagPurger.php
@@ -133,7 +133,7 @@ class AkamaiTagPurger extends PurgerBase {
 
     // Instantiate event and alter tags with subscribers.
     $event = new AkamaiPurgeEvents($tags_to_clear);
-    $this->eventDispatcher->dispatch(AkamaiPurgeEvents::PURGE_CREATION, $event);
+    $this->eventDispatcher->dispatch($event, AkamaiPurgeEvents::PURGE_CREATION);
     $tags_to_clear = $event->data;
 
     // Purge tags.
diff --git a/src/Tests/AkamaiCacheControlFormTest.php b/src/Tests/AkamaiCacheControlFormTest.php
index ab28530..c2a6bd2 100644
--- a/src/Tests/AkamaiCacheControlFormTest.php
+++ b/src/Tests/AkamaiCacheControlFormTest.php
@@ -27,17 +27,24 @@ class AkamaiCacheControlFormTest extends BrowserTestBase {
    */
   protected $privilegedUser;
 
+  /**
+   * Default theme.
+   *
+   * @var string
+   */
+  protected $defaultTheme = 'stark';
+
   /**
    * Modules to enable.
    *
    * @var array
    */
-  public static $modules = ['system_test', 'node', 'user', 'akamai'];
+  protected static $modules = ['system_test', 'node', 'user', 'akamai'];
 
   /**
    * {@inheritdoc}
    */
-  protected function setUp() {
+  protected function setUp() : void {
     parent::setUp();
     // Create and log in our privileged user.
     $this->privilegedUser = $this->drupalCreateUser([
@@ -49,7 +56,8 @@ class AkamaiCacheControlFormTest extends BrowserTestBase {
     $this->node = $this->drupalCreateNode(['type' => 'article']);
 
     $edit['basepath'] = 'http://www.example.com';
-    $this->drupalPostForm('admin/config/akamai/config', $edit, t('Save configuration'));
+    $this->drupalGet('admin/config/akamai/config');
+    $this->submitForm($edit, t('Save configuration'));
   }
 
   /**
@@ -60,15 +68,19 @@ class AkamaiCacheControlFormTest extends BrowserTestBase {
     $edit['domain_override'] = 'staging';
     $edit['action'] = 'invalidate';
     $edit['method'] = 'url';
-    $this->drupalPostForm('admin/config/akamai/cache-clear', $edit, t('Start Refreshing Content'));
-    $this->assertText(t('Paths/URLs/CPCodes field is required.'), 'Invalid URL rejected.');
+    $this->drupalGet('admin/config/akamai/cache-clear');
+    $this->submitForm($edit, t('Start Refreshing Content'));
+    $this->assertSession()
+      ->responseContains(t('Paths/URLs/CPCodes field is required.'));
 
     $edit['paths'] = 'https://www.google.com';
     $edit['domain_override'] = 'staging';
     $edit['action'] = 'invalidate';
     $edit['method'] = 'url';
-    $this->drupalPostForm('admin/config/akamai/cache-clear', $edit, t('Start Refreshing Content'));
-    $this->assertText(t('The URL(s) [https://www.google.com] are not configured to be work with Akamai.'), 'External URL rejected.');
+    $this->drupalGet('admin/config/akamai/cache-clear');
+    $this->submitForm($edit, t('Start Refreshing Content'));
+    $this->assertSession()
+      ->responseContains(t('The URL(s) [https://www.google.com] are not configured to be work with Akamai.'));
   }
 
 }
diff --git a/src/Tests/AkamaiConfigFormTest.php b/src/Tests/AkamaiConfigFormTest.php
index b51700a..8f2ae95 100644
--- a/src/Tests/AkamaiConfigFormTest.php
+++ b/src/Tests/AkamaiConfigFormTest.php
@@ -19,17 +19,24 @@ class AkamaiConfigFormTest extends BrowserTestBase {
    */
   protected $privilegedUser;
 
+  /**
+   * Default theme.
+   *
+   * @var string
+   */
+  protected $defaultTheme = 'stark';
+
   /**
    * Modules to enable.
    *
    * @var array
    */
-  public static $modules = ['system_test', 'node', 'user', 'akamai'];
+  protected static $modules = ['system_test', 'node', 'user', 'akamai'];
 
   /**
    * {@inheritdoc}
    */
-  protected function setUp() {
+  protected function setUp() : void {
     parent::setUp();
     // Create and log in our privileged user.
     $this->privilegedUser = $this->drupalCreateUser([
@@ -50,12 +57,15 @@ class AkamaiConfigFormTest extends BrowserTestBase {
     $edit['ccu_version'] = 'v3';
     $edit['v3[action]'] = 'invalidate';
 
-    $this->drupalPostForm('admin/config/akamai/config', $edit, t('Save configuration'));
+    $this->drupalGet('admin/config/akamai/config');
+    $this->submitForm($edit, t('Save configuration'));
 
     // Tests that we can't save non-integer timeouts.
     $edit['timeout'] = 'lol';
-    $this->drupalPostForm(Url::fromRoute('akamai.settings')->getInternalPath(), $edit, t('Save configuration'));
-    $this->assertText(t('Please enter only integer values in this field.'), 'Allowed only integer timeout values');
+    $this->drupalGet(Url::fromRoute('akamai.settings')->getInternalPath());
+    $this->submitForm($edit, t('Save configuration'));
+    $this->assertSession()
+      ->responseContains(t('Please enter only integer values in this field.'));
   }
 
 }
diff --git a/src/Tests/AkamaiHomepageTest.php b/src/Tests/AkamaiHomepageTest.php
index d4c361d..586bd64 100644
--- a/src/Tests/AkamaiHomepageTest.php
+++ b/src/Tests/AkamaiHomepageTest.php
@@ -27,6 +27,13 @@ class AkamaiHomepageTest extends BrowserTestBase {
    */
   protected $homepage;
 
+  /**
+   * Default theme.
+   *
+   * @var string
+   */
+  protected $defaultTheme = 'bartik';
+
   /**
    * User with admin rights.
    *
@@ -39,12 +46,12 @@ class AkamaiHomepageTest extends BrowserTestBase {
    *
    * @var array
    */
-  public static $modules = ['system_test', 'block', 'node', 'akamai'];
+  protected static $modules = ['system_test', 'block', 'node', 'akamai'];
 
   /**
    * {@inheritdoc}
    */
-  protected function setUp() {
+  protected function setUp() : void {
     parent::setUp();
     // Create and log in our privileged user.
     $this->privilegedUser = $this->drupalCreateUser([
@@ -65,7 +72,6 @@ class AkamaiHomepageTest extends BrowserTestBase {
    */
   public function testHomepageClear() {
     // Set up theme.
-    \Drupal::service('theme_handler')->install(['bartik']);
     $theme_settings = $this->config('system.theme');
     foreach (['bartik'] as $theme) {
       // Configure and save the block.
@@ -78,7 +84,8 @@ class AkamaiHomepageTest extends BrowserTestBase {
       // The cache clearing block should pick up the current URL as the clearing
       // target.
       $this->drupalGet($this->homepage);
-      $this->assertText($this->homepage, 'The Akamai path field is set correctly');
+      $this->assertSession()
+        ->responseContains($this->homepage);
     }
   }
 
diff --git a/tests/src/Functional/EdgescapeTest.php b/tests/src/Functional/EdgescapeTest.php
index 225c1aa..a8afebd 100644
--- a/tests/src/Functional/EdgescapeTest.php
+++ b/tests/src/Functional/EdgescapeTest.php
@@ -25,7 +25,7 @@ class EdgescapeTest extends BrowserTestBase {
    *
    * @var array
    */
-  public static $modules = ['akamai', 'token', 'block', 'block_content'];
+  protected static $modules = ['akamai', 'token', 'block', 'block_content'];
 
   /**
    * Test the header value.
@@ -41,7 +41,8 @@ class EdgescapeTest extends BrowserTestBase {
     // Enable Edgescape support.
     $akamai_config_path = Url::fromRoute('akamai.settings')->getInternalPath();
     $edit[Edgescape::EDGESCAPE_SUPPORT] = TRUE;
-    $this->drupalPostForm($akamai_config_path, $edit, t('Save configuration'));
+    $this->drupalGet($akamai_config_path);
+    $this->submitForm($edit, t('Save configuration'));
 
     // Create block, block content, and place.
     $label = 'tokenblock';
diff --git a/tests/src/Kernel/EdgeCacheTagHeaderTest.php b/tests/src/Kernel/EdgeCacheTagHeaderTest.php
index a01572b..d6c58c7 100644
--- a/tests/src/Kernel/EdgeCacheTagHeaderTest.php
+++ b/tests/src/Kernel/EdgeCacheTagHeaderTest.php
@@ -18,12 +18,12 @@ class EdgeCacheTagHeaderTest extends KernelTestBase {
    *
    * @var array
    */
-  public static $modules = ['system', 'akamai'];
+  protected static $modules = ['system', 'akamai'];
 
   /**
    * {@inheritdoc}
    */
-  protected function setUp() {
+  protected function setUp() : void {
     parent::setUp();
     $this->installConfig(['akamai']);
   }
@@ -41,22 +41,22 @@ class EdgeCacheTagHeaderTest extends KernelTestBase {
     $response = $kernel->handle($request);
 
     // Verify header is not available by default.
-    $this->assertEqual(200, $response->getStatusCode());
-    $this->assertEqual($response->headers->has('Edge-Cache-Tag'), FALSE);
+    $this->assertEquals(200, $response->getStatusCode());
+    $this->assertEquals($response->headers->has('Edge-Cache-Tag'), FALSE);
 
     // Verify header is available when enabled.
     $config->set('edge_cache_tag_header', TRUE)->save();
     $response = $kernel->handle($request);
-    $this->assertEqual(200, $response->getStatusCode());
-    $this->assertEqual($response->headers->has('Edge-Cache-Tag'), TRUE);
-    $this->assertEqual($response->headers->get('Edge-Cache-Tag'), 'config_user.role.anonymous,http_response,rendered');
+    $this->assertEquals(200, $response->getStatusCode());
+    $this->assertEquals($response->headers->has('Edge-Cache-Tag'), TRUE);
+    $this->assertEquals($response->headers->get('Edge-Cache-Tag'), 'config_user.role.anonymous,http_response,rendered');
 
     // Verify tag blacklisting.
     $config->set('edge_cache_tag_header_blacklist', ['config:'])->save();
     $response = $kernel->handle($request);
-    $this->assertEqual(200, $response->getStatusCode());
-    $this->assertEqual($response->headers->has('Edge-Cache-Tag'), TRUE);
-    $this->assertEqual($response->headers->get('Edge-Cache-Tag'), 'http_response,rendered');
+    $this->assertEquals(200, $response->getStatusCode());
+    $this->assertEquals($response->headers->has('Edge-Cache-Tag'), TRUE);
+    $this->assertEquals($response->headers->get('Edge-Cache-Tag'), 'http_response,rendered');
 
     // Setup the mock event subscriber.
     $subscriber = new MockHeaderSubscriber();
@@ -64,9 +64,9 @@ class EdgeCacheTagHeaderTest extends KernelTestBase {
     $event_dispatcher->addListener(AkamaiHeaderEvents::HEADER_CREATION, [$subscriber, 'onHeaderCreation']);
 
     $response = $kernel->handle($request);
-    $this->assertEqual(200, $response->getStatusCode());
-    $this->assertEqual($response->headers->has('Edge-Cache-Tag'), TRUE);
-    $this->assertEqual($response->headers->get('Edge-Cache-Tag'), 'http_response,rendered,helloworld');
+    $this->assertEquals(200, $response->getStatusCode());
+    $this->assertEquals($response->headers->has('Edge-Cache-Tag'), TRUE);
+    $this->assertEquals($response->headers->get('Edge-Cache-Tag'), 'http_response,rendered,helloworld');
   }
 
 }
diff --git a/tests/src/Kernel/EventSubscriber/CacheableResponseSubscriberTest.php b/tests/src/Kernel/EventSubscriber/CacheableResponseSubscriberTest.php
index 00bb279..3a198dd 100644
--- a/tests/src/Kernel/EventSubscriber/CacheableResponseSubscriberTest.php
+++ b/tests/src/Kernel/EventSubscriber/CacheableResponseSubscriberTest.php
@@ -18,12 +18,12 @@ class CacheableResponseSubscriberTest extends KernelTestBase {
    *
    * @var array
    */
-  public static $modules = ['system', 'akamai'];
+  protected static $modules = ['system', 'akamai'];
 
   /**
    * {@inheritdoc}
    */
-  protected function setUp() {
+  protected function setUp() : void {
     parent::setUp();
     $this->installConfig(['akamai']);
   }
@@ -41,22 +41,22 @@ class CacheableResponseSubscriberTest extends KernelTestBase {
     $response = $kernel->handle($request);
 
     // Verify header is not available by default.
-    $this->assertEqual(200, $response->getStatusCode());
-    $this->assertEqual($response->headers->has('Edge-Cache-Tag'), FALSE);
+    $this->assertEquals(200, $response->getStatusCode());
+    $this->assertEquals($response->headers->has('Edge-Cache-Tag'), FALSE);
 
     // Verify header is available when enabled.
     $config->set('edge_cache_tag_header', TRUE)->save();
     $response = $kernel->handle($request);
-    $this->assertEqual(200, $response->getStatusCode());
-    $this->assertEqual($response->headers->has('Edge-Cache-Tag'), TRUE);
-    $this->assertEqual($response->headers->get('Edge-Cache-Tag'), 'config_user.role.anonymous,http_response,rendered');
+    $this->assertEquals(200, $response->getStatusCode());
+    $this->assertEquals($response->headers->has('Edge-Cache-Tag'), TRUE);
+    $this->assertEquals($response->headers->get('Edge-Cache-Tag'), 'config_user.role.anonymous,http_response,rendered');
 
     // Verify tag blacklisting.
     $config->set('edge_cache_tag_header_blacklist', ['config:'])->save();
     $response = $kernel->handle($request);
-    $this->assertEqual(200, $response->getStatusCode());
-    $this->assertEqual($response->headers->has('Edge-Cache-Tag'), TRUE);
-    $this->assertEqual($response->headers->get('Edge-Cache-Tag'), 'http_response,rendered');
+    $this->assertEquals(200, $response->getStatusCode());
+    $this->assertEquals($response->headers->has('Edge-Cache-Tag'), TRUE);
+    $this->assertEquals($response->headers->get('Edge-Cache-Tag'), 'http_response,rendered');
 
     // Setup the mock event subscriber.
     $subscriber = new MockSubscriber();
@@ -64,9 +64,9 @@ class CacheableResponseSubscriberTest extends KernelTestBase {
     $event_dispatcher->addListener(AkamaiHeaderEvents::HEADER_CREATION, [$subscriber, 'onHeaderCreation']);
 
     $response = $kernel->handle($request);
-    $this->assertEqual(200, $response->getStatusCode());
-    $this->assertEqual($response->headers->has('Edge-Cache-Tag'), TRUE);
-    $this->assertEqual($response->headers->get('Edge-Cache-Tag'), 'http_response,rendered,on_header_creation');
+    $this->assertEquals(200, $response->getStatusCode());
+    $this->assertEquals($response->headers->has('Edge-Cache-Tag'), TRUE);
+    $this->assertEquals($response->headers->get('Edge-Cache-Tag'), 'http_response,rendered,on_header_creation');
   }
 
 }
diff --git a/tests/src/Kernel/KeyRepositoryAvailableTest.php b/tests/src/Kernel/KeyRepositoryAvailableTest.php
index 7b498ff..97f97ae 100644
--- a/tests/src/Kernel/KeyRepositoryAvailableTest.php
+++ b/tests/src/Kernel/KeyRepositoryAvailableTest.php
@@ -16,12 +16,12 @@ class KeyRepositoryAvailableTest extends KernelTestBase {
    *
    * @var array
    */
-  public static $modules = ['akamai', 'key'];
+  protected static $modules = ['akamai', 'key'];
 
   /**
    * {@inheritdoc}
    */
-  protected function setUp() {
+  protected function setUp() : void {
     parent::setUp();
     $this->installConfig(['akamai', 'key']);
     $this->generateKeys();
diff --git a/tests/src/Kernel/KeyRepositoryUnavailableTest.php b/tests/src/Kernel/KeyRepositoryUnavailableTest.php
index a9e98ff..7070693 100644
--- a/tests/src/Kernel/KeyRepositoryUnavailableTest.php
+++ b/tests/src/Kernel/KeyRepositoryUnavailableTest.php
@@ -16,12 +16,12 @@ class KeyRepositoryUnavailableTest extends KernelTestBase {
    *
    * @var array
    */
-  public static $modules = ['akamai'];
+  protected static $modules = ['akamai'];
 
   /**
    * {@inheritdoc}
    */
-  protected function setUp() {
+  protected function setUp() : void {
     parent::setUp();
     $this->installConfig(['akamai']);
   }
