 .../ContactForm/ContactFormJsonAnonTest.php        | 24 ++++++
 .../ContactForm/ContactFormJsonBasicAuthTest.php   | 34 ++++++++
 .../ContactForm/ContactFormJsonCookieTest.php      | 29 +++++++
 .../ContactForm/ContactFormResourceTestBase.php    | 97 ++++++++++++++++++++++
 4 files changed, 184 insertions(+)

diff --git a/core/modules/rest/tests/src/Functional/EntityResource/ContactForm/ContactFormJsonAnonTest.php b/core/modules/rest/tests/src/Functional/EntityResource/ContactForm/ContactFormJsonAnonTest.php
new file mode 100644
index 0000000..a5f3602
--- /dev/null
+++ b/core/modules/rest/tests/src/Functional/EntityResource/ContactForm/ContactFormJsonAnonTest.php
@@ -0,0 +1,24 @@
+<?php
+
+namespace Drupal\Tests\rest\Functional\EntityResource\ContactForm;
+
+use Drupal\Tests\rest\Functional\AnonResourceTestTrait;
+
+/**
+ * @group rest
+ */
+class ContactFormJsonAnonTest extends ContactFormResourceTestBase {
+
+  use AnonResourceTestTrait;
+
+  /**
+   * {@inheritdoc}
+   */
+  protected static $format = 'json';
+
+  /**
+   * {@inheritdoc}
+   */
+  protected static $mimeType = 'application/json';
+
+}
diff --git a/core/modules/rest/tests/src/Functional/EntityResource/ContactForm/ContactFormJsonBasicAuthTest.php b/core/modules/rest/tests/src/Functional/EntityResource/ContactForm/ContactFormJsonBasicAuthTest.php
new file mode 100644
index 0000000..c41b9a4
--- /dev/null
+++ b/core/modules/rest/tests/src/Functional/EntityResource/ContactForm/ContactFormJsonBasicAuthTest.php
@@ -0,0 +1,34 @@
+<?php
+
+namespace Drupal\Tests\rest\Functional\EntityResource\ContactForm;
+
+use Drupal\Tests\rest\Functional\BasicAuthResourceTestTrait;
+
+/**
+ * @group rest
+ */
+class ContactFormJsonBasicAuthTest extends ContactFormResourceTestBase {
+
+  use BasicAuthResourceTestTrait;
+
+  /**
+   * {@inheritdoc}
+   */
+  public static $modules = ['basic_auth'];
+
+  /**
+   * {@inheritdoc}
+   */
+  protected static $format = 'json';
+
+  /**
+   * {@inheritdoc}
+   */
+  protected static $mimeType = 'application/json';
+
+  /**
+   * {@inheritdoc}
+   */
+  protected static $auth = 'basic_auth';
+
+}
diff --git a/core/modules/rest/tests/src/Functional/EntityResource/ContactForm/ContactFormJsonCookieTest.php b/core/modules/rest/tests/src/Functional/EntityResource/ContactForm/ContactFormJsonCookieTest.php
new file mode 100644
index 0000000..2b8d913
--- /dev/null
+++ b/core/modules/rest/tests/src/Functional/EntityResource/ContactForm/ContactFormJsonCookieTest.php
@@ -0,0 +1,29 @@
+<?php
+
+namespace Drupal\Tests\rest\Functional\EntityResource\ContactForm;
+
+use Drupal\Tests\rest\Functional\CookieResourceTestTrait;
+
+/**
+ * @group rest
+ */
+class ContactFormJsonCookieTest extends ContactFormResourceTestBase {
+
+  use CookieResourceTestTrait;
+
+  /**
+   * {@inheritdoc}
+   */
+  protected static $format = 'json';
+
+  /**
+   * {@inheritdoc}
+   */
+  protected static $mimeType = 'application/json';
+
+  /**
+   * {@inheritdoc}
+   */
+  protected static $auth = 'cookie';
+
+}
diff --git a/core/modules/rest/tests/src/Functional/EntityResource/ContactForm/ContactFormResourceTestBase.php b/core/modules/rest/tests/src/Functional/EntityResource/ContactForm/ContactFormResourceTestBase.php
new file mode 100644
index 0000000..23464bf
--- /dev/null
+++ b/core/modules/rest/tests/src/Functional/EntityResource/ContactForm/ContactFormResourceTestBase.php
@@ -0,0 +1,97 @@
+<?php
+
+namespace Drupal\Tests\rest\Functional\EntityResource\ContactForm;
+
+use Drupal\contact\Entity\ContactForm;
+use Drupal\Tests\rest\Functional\BcTimestampNormalizerUnixTestTrait;
+use Drupal\Tests\rest\Functional\EntityResource\EntityResourceTestBase;
+
+abstract class ContactFormResourceTestBase extends EntityResourceTestBase {
+
+  use BcTimestampNormalizerUnixTestTrait;
+
+  /**
+   * {@inheritdoc}
+   */
+  public static $modules = ['contact'];
+
+  /**
+   * {@inheritdoc}
+   */
+  protected static $entityTypeId = 'contact_form';
+
+  /**
+   * {@inheritdoc}
+   */
+  protected static $patchProtectedFieldNames = [];
+
+  /**
+   * @var \Drupal\contact\Entity\ContactForm
+   */
+  protected $entity;
+
+  /**
+   * {@inheritdoc}
+   */
+  protected function setUpAuthorization($method) {
+    switch ($method) {
+      case 'GET':
+        $this->grantPermissionsToTestedRole(['access site-wide contact form']);
+      default:
+        $this->grantPermissionsToTestedRole(['administer contact forms']);
+    }
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  protected function createEntity() {
+    $contact_form = ContactForm::create([
+      'id' => 'llama',
+      'label' => 'Llama',
+      'message' => 'Let us know what you think about llamas',
+      'reply' => 'Llamas are indeed awesome!',
+    ]);
+    $contact_form->save();
+
+    return $contact_form;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  protected function getExpectedNormalizedEntity() {
+    return [
+      'dependencies' => [],
+      'id' => 'llama',
+      'label' => 'Llama',
+      'langcode' => 'en',
+      'message' => 'Let us know what you think about llamas',
+      'recipients' => [],
+      'redirect' => NULL,
+      'reply' => 'Llamas are indeed awesome!',
+      'status' => TRUE,
+      'uuid' => $this->entity->uuid(),
+      'weight' => 0,
+    ];
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  protected function getNormalizedPostEntity() {
+    // @todo Update in https://www.drupal.org/node/2300677.
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  protected function getExpectedUnauthorizedAccessMessage($method) {
+    if ($this->config('rest.settings')->get('bc_entity_resource_permissions')) {
+      return parent::getExpectedUnauthorizedAccessMessage($method);
+    }
+
+    return "The 'access site-wide contact form' permission is required.";
+  }
+
+}
