Temporarily qualify calls to custom assertThat(Optional) methods

The Truth team is working on migrating callers of the Truth8.assertThat
methods to call equivalent methods on the main Truth class.

Due to this calls to custom assertThat(Optional) methods will
temporarily become ambiguous and hence need to be qualified to avoid
breakage.

Change-Id: I53afa474f4025cdaf6090868f13d46fead315dc0
Signed-off-by: Edwin Kempin <ekempin@google.com>
Reviewed-on: https://gerrit-review.googlesource.com/c/plugins/code-owners/+/402728
Reviewed-by: Patrick Hiesel <hiesel@google.com>
diff --git a/javatests/com/google/gerrit/plugins/codeowners/acceptance/api/CodeOwnersPluginConfigValidatorIT.java b/javatests/com/google/gerrit/plugins/codeowners/acceptance/api/CodeOwnersPluginConfigValidatorIT.java
index b0caf0a..af8ba2e 100644
--- a/javatests/com/google/gerrit/plugins/codeowners/acceptance/api/CodeOwnersPluginConfigValidatorIT.java
+++ b/javatests/com/google/gerrit/plugins/codeowners/acceptance/api/CodeOwnersPluginConfigValidatorIT.java
@@ -20,7 +20,6 @@
 import static com.google.gerrit.extensions.client.ListChangesOption.CURRENT_REVISION;
 import static com.google.gerrit.plugins.codeowners.testing.RequiredApprovalSubject.assertThat;
 import static com.google.gerrit.testing.GerritJUnit.assertThrows;
-import static com.google.gerrit.truth.OptionalSubject.assertThat;
 
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.ImmutableMap;
@@ -46,6 +45,7 @@
 import com.google.gerrit.plugins.codeowners.backend.config.StatusConfig;
 import com.google.gerrit.plugins.codeowners.backend.proto.ProtoBackend;
 import com.google.gerrit.plugins.codeowners.common.MergeCommitStrategy;
+import com.google.gerrit.truth.OptionalSubject;
 import org.eclipse.jgit.lib.Config;
 import org.eclipse.jgit.revwalk.RevCommit;
 import org.eclipse.jgit.revwalk.RevObject;
@@ -257,7 +257,8 @@
 
     PushResult r = pushRefsMetaConfig();
     assertThat(r.getRemoteUpdate(RefNames.REFS_CONFIG).getStatus()).isEqualTo(Status.OK);
-    assertThat(codeOwnersPluginConfiguration.getProjectConfig(project).getPathExpressions("master"))
+    OptionalSubject.assertThat(
+            codeOwnersPluginConfiguration.getProjectConfig(project).getPathExpressions("master"))
         .value()
         .isEqualTo(PathExpressions.GLOB);
   }
@@ -276,7 +277,8 @@
 
     PushResult r = pushRefsMetaConfig();
     assertThat(r.getRemoteUpdate(RefNames.REFS_CONFIG).getStatus()).isEqualTo(Status.OK);
-    assertThat(codeOwnersPluginConfiguration.getProjectConfig(project).getPathExpressions("master"))
+    OptionalSubject.assertThat(
+            codeOwnersPluginConfiguration.getProjectConfig(project).getPathExpressions("master"))
         .value()
         .isEqualTo(PathExpressions.GLOB);
   }
diff --git a/javatests/com/google/gerrit/plugins/codeowners/acceptance/api/PutCodeOwnerProjectConfigIT.java b/javatests/com/google/gerrit/plugins/codeowners/acceptance/api/PutCodeOwnerProjectConfigIT.java
index e632f2a..ddddf39 100644
--- a/javatests/com/google/gerrit/plugins/codeowners/acceptance/api/PutCodeOwnerProjectConfigIT.java
+++ b/javatests/com/google/gerrit/plugins/codeowners/acceptance/api/PutCodeOwnerProjectConfigIT.java
@@ -19,7 +19,6 @@
 import static com.google.gerrit.plugins.codeowners.testing.RequiredApprovalSubject.assertThat;
 import static com.google.gerrit.server.project.ProjectCache.illegalState;
 import static com.google.gerrit.testing.GerritJUnit.assertThrows;
-import static com.google.gerrit.truth.OptionalSubject.assertThat;
 
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.ImmutableMap;
@@ -44,6 +43,7 @@
 import com.google.gerrit.plugins.codeowners.common.MergeCommitStrategy;
 import com.google.gerrit.server.project.ProjectState;
 import com.google.gerrit.server.restapi.project.DeleteRef;
+import com.google.gerrit.truth.OptionalSubject;
 import com.google.inject.Inject;
 import org.eclipse.jgit.revwalk.RevCommit;
 import org.junit.Before;
@@ -181,7 +181,8 @@
 
   @Test
   public void setFileExtension() throws Exception {
-    assertThat(codeOwnersPluginConfiguration.getProjectConfig(project).getFileExtension())
+    OptionalSubject.assertThat(
+            codeOwnersPluginConfiguration.getProjectConfig(project).getFileExtension())
         .isEmpty();
 
     CodeOwnerProjectConfigInput input = new CodeOwnerProjectConfigInput();
@@ -189,14 +190,16 @@
     CodeOwnerProjectConfigInfo updatedConfig =
         projectCodeOwnersApiFactory.project(project).updateConfig(input);
     assertThat(updatedConfig.general.fileExtension).isEqualTo("foo");
-    assertThat(codeOwnersPluginConfiguration.getProjectConfig(project).getFileExtension())
+    OptionalSubject.assertThat(
+            codeOwnersPluginConfiguration.getProjectConfig(project).getFileExtension())
         .value()
         .isEqualTo("foo");
 
     input.fileExtension = "";
     updatedConfig = projectCodeOwnersApiFactory.project(project).updateConfig(input);
     assertThat(updatedConfig.general.fileExtension).isNull();
-    assertThat(codeOwnersPluginConfiguration.getProjectConfig(project).getFileExtension())
+    OptionalSubject.assertThat(
+            codeOwnersPluginConfiguration.getProjectConfig(project).getFileExtension())
         .isEmpty();
   }
 
@@ -406,7 +409,8 @@
 
   @Test
   public void setOverrideInfoUrl() throws Exception {
-    assertThat(codeOwnersPluginConfiguration.getProjectConfig(project).getOverrideInfoUrl())
+    OptionalSubject.assertThat(
+            codeOwnersPluginConfiguration.getProjectConfig(project).getOverrideInfoUrl())
         .isEmpty();
 
     CodeOwnerProjectConfigInput input = new CodeOwnerProjectConfigInput();
@@ -414,20 +418,22 @@
     CodeOwnerProjectConfigInfo updatedConfig =
         projectCodeOwnersApiFactory.project(project).updateConfig(input);
     assertThat(updatedConfig.general.overrideInfoUrl).isEqualTo("http://foo.bar");
-    assertThat(codeOwnersPluginConfiguration.getProjectConfig(project).getOverrideInfoUrl())
+    OptionalSubject.assertThat(
+            codeOwnersPluginConfiguration.getProjectConfig(project).getOverrideInfoUrl())
         .value()
         .isEqualTo("http://foo.bar");
 
     input.overrideInfoUrl = "";
     updatedConfig = projectCodeOwnersApiFactory.project(project).updateConfig(input);
     assertThat(updatedConfig.general.overrideInfoUrl).isNull();
-    assertThat(codeOwnersPluginConfiguration.getProjectConfig(project).getOverrideInfoUrl())
+    OptionalSubject.assertThat(
+            codeOwnersPluginConfiguration.getProjectConfig(project).getOverrideInfoUrl())
         .isEmpty();
   }
 
   @Test
   public void setInvalidCodeOwnerConfigInfoUrl() throws Exception {
-    assertThat(
+    OptionalSubject.assertThat(
             codeOwnersPluginConfiguration
                 .getProjectConfig(project)
                 .getInvalidCodeOwnerConfigInfoUrl())
@@ -438,7 +444,7 @@
     CodeOwnerProjectConfigInfo updatedConfig =
         projectCodeOwnersApiFactory.project(project).updateConfig(input);
     assertThat(updatedConfig.general.invalidCodeOwnerConfigInfoUrl).isEqualTo("http://foo.bar");
-    assertThat(
+    OptionalSubject.assertThat(
             codeOwnersPluginConfiguration
                 .getProjectConfig(project)
                 .getInvalidCodeOwnerConfigInfoUrl())
@@ -448,7 +454,7 @@
     input.invalidCodeOwnerConfigInfoUrl = "";
     updatedConfig = projectCodeOwnersApiFactory.project(project).updateConfig(input);
     assertThat(updatedConfig.general.invalidCodeOwnerConfigInfoUrl).isNull();
-    assertThat(
+    OptionalSubject.assertThat(
             codeOwnersPluginConfiguration
                 .getProjectConfig(project)
                 .getInvalidCodeOwnerConfigInfoUrl())
diff --git a/javatests/com/google/gerrit/plugins/codeowners/acceptance/testsuite/CodeOwnerConfigOperationsImplTest.java b/javatests/com/google/gerrit/plugins/codeowners/acceptance/testsuite/CodeOwnerConfigOperationsImplTest.java
index 17e3ccd..d5e4dd5 100644
--- a/javatests/com/google/gerrit/plugins/codeowners/acceptance/testsuite/CodeOwnerConfigOperationsImplTest.java
+++ b/javatests/com/google/gerrit/plugins/codeowners/acceptance/testsuite/CodeOwnerConfigOperationsImplTest.java
@@ -17,7 +17,6 @@
 import static com.google.common.truth.Truth.assertThat;
 import static com.google.gerrit.plugins.codeowners.testing.CodeOwnerConfigSubject.assertThat;
 import static com.google.gerrit.testing.GerritJUnit.assertThrows;
-import static com.google.gerrit.truth.OptionalSubject.assertThat;
 
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.ImmutableSet;
@@ -37,6 +36,7 @@
 import com.google.gerrit.plugins.codeowners.backend.CodeOwners;
 import com.google.gerrit.plugins.codeowners.backend.CodeOwnersUpdate;
 import com.google.gerrit.server.ServerInitiated;
+import com.google.gerrit.truth.OptionalSubject;
 import com.google.inject.Key;
 import com.google.inject.Provider;
 import java.nio.file.Paths;
@@ -195,7 +195,7 @@
             .fileName("OWNERS_foo")
             .addCodeOwnerEmail(admin.email())
             .create();
-    assertThat(codeOwnerConfigKey.fileName()).value().isEqualTo("OWNERS_foo");
+    OptionalSubject.assertThat(codeOwnerConfigKey.fileName()).value().isEqualTo("OWNERS_foo");
     assertThat(getCodeOwnerConfigFromServer(codeOwnerConfigKey))
         .hasCodeOwnerSetsThat()
         .onlyElement()
@@ -441,7 +441,7 @@
     // was dropped.
     // Since this made the code owner config empty it caused a deletion of the code owner config
     // file.
-    assertThat(codeOwners.getFromCurrentRevision(codeOwnerConfig.key())).isEmpty();
+    OptionalSubject.assertThat(codeOwners.getFromCurrentRevision(codeOwnerConfig.key())).isEmpty();
   }
 
   @Test
@@ -507,7 +507,7 @@
         .update();
 
     // Removing all code owner sets leads to a deletion of the code owner config file.
-    assertThat(codeOwners.getFromCurrentRevision(codeOwnerConfig.key())).isEmpty();
+    OptionalSubject.assertThat(codeOwners.getFromCurrentRevision(codeOwnerConfig.key())).isEmpty();
   }
 
   @Test
@@ -570,7 +570,7 @@
         .update();
 
     // Removing all code owner sets leads to a deletion of the code owner config file.
-    assertThat(codeOwners.getFromCurrentRevision(codeOwnerConfig.key())).isEmpty();
+    OptionalSubject.assertThat(codeOwners.getFromCurrentRevision(codeOwnerConfig.key())).isEmpty();
   }
 
   @Test
diff --git a/javatests/com/google/gerrit/plugins/codeowners/backend/ChangedFileTest.java b/javatests/com/google/gerrit/plugins/codeowners/backend/ChangedFileTest.java
index 2c84634..cc3a6e7 100644
--- a/javatests/com/google/gerrit/plugins/codeowners/backend/ChangedFileTest.java
+++ b/javatests/com/google/gerrit/plugins/codeowners/backend/ChangedFileTest.java
@@ -16,7 +16,6 @@
 
 import static com.google.common.truth.Truth.assertThat;
 import static com.google.gerrit.testing.GerritJUnit.assertThrows;
-import static com.google.gerrit.truth.OptionalSubject.assertThat;
 import static org.mockito.Mockito.when;
 
 import com.google.gerrit.common.Nullable;
@@ -25,6 +24,7 @@
 import com.google.gerrit.plugins.codeowners.common.ChangedFile;
 import com.google.gerrit.server.patch.PatchListEntry;
 import com.google.gerrit.server.patch.filediff.FileDiffOutput;
+import com.google.gerrit.truth.OptionalSubject;
 import java.nio.file.Paths;
 import java.util.Optional;
 import org.eclipse.jgit.diff.DiffEntry;
@@ -48,14 +48,16 @@
   public void getNewPath_diffEntry() throws Exception {
     String newPath = "foo/bar/baz.txt";
     setupDiffEntry(newPath, /* oldPath= */ null, ChangeType.ADD);
-    assertThat(ChangedFile.create(diffEntry).newPath()).value().isEqualTo(Paths.get("/" + newPath));
+    OptionalSubject.assertThat(ChangedFile.create(diffEntry).newPath())
+        .value()
+        .isEqualTo(Paths.get("/" + newPath));
   }
 
   @Test
   public void getNewPath_patchListEntry() throws Exception {
     String newPath = "foo/bar/baz.txt";
     setupPatchListEntry(newPath, /* oldPath= */ null, Patch.ChangeType.ADDED);
-    assertThat(ChangedFile.create(patchListEntry).newPath())
+    OptionalSubject.assertThat(ChangedFile.create(patchListEntry).newPath())
         .value()
         .isEqualTo(Paths.get("/" + newPath));
   }
@@ -64,7 +66,7 @@
   public void getNewPath_fileDiffOutput() throws Exception {
     String newPath = "foo/bar/baz.txt";
     setupFileDiffOutput(newPath, /* oldPath= */ null, Patch.ChangeType.ADDED);
-    assertThat(ChangedFile.create(fileDiffOutput).newPath())
+    OptionalSubject.assertThat(ChangedFile.create(fileDiffOutput).newPath())
         .value()
         .isEqualTo(Paths.get("/" + newPath));
   }
@@ -72,19 +74,19 @@
   @Test
   public void getNewPathWhenNewPathIsNotSet_diffEntry() throws Exception {
     setupDiffEntry(/* newPath= */ null, /* oldPath= */ null, ChangeType.ADD);
-    assertThat(ChangedFile.create(diffEntry).newPath()).isEmpty();
+    OptionalSubject.assertThat(ChangedFile.create(diffEntry).newPath()).isEmpty();
   }
 
   @Test
   public void getNewPathWhenNewPathIsNotSet_patchListEntry() throws Exception {
     setupPatchListEntry(/* newPath= */ null, /* oldPath= */ null, Patch.ChangeType.ADDED);
-    assertThat(ChangedFile.create(patchListEntry).newPath()).isEmpty();
+    OptionalSubject.assertThat(ChangedFile.create(patchListEntry).newPath()).isEmpty();
   }
 
   @Test
   public void getNewPathWhenNewPathIsNotSet_fileDiffOutput() throws Exception {
     setupFileDiffOutput(/* newPath= */ null, /* oldPath= */ null, Patch.ChangeType.ADDED);
-    assertThat(ChangedFile.create(fileDiffOutput).newPath()).isEmpty();
+    OptionalSubject.assertThat(ChangedFile.create(fileDiffOutput).newPath()).isEmpty();
   }
 
   @Test
@@ -193,14 +195,16 @@
   public void getOldPath_diffEntry() throws Exception {
     String oldPath = "foo/bar/baz.txt";
     setupDiffEntry(/* newPath= */ null, oldPath, ChangeType.DELETE);
-    assertThat(ChangedFile.create(diffEntry).oldPath()).value().isEqualTo(Paths.get("/" + oldPath));
+    OptionalSubject.assertThat(ChangedFile.create(diffEntry).oldPath())
+        .value()
+        .isEqualTo(Paths.get("/" + oldPath));
   }
 
   @Test
   public void getOldPath_patchListEntry() throws Exception {
     String oldPath = "foo/bar/baz.txt";
     setupPatchListEntry(/* newPath= */ null, oldPath, Patch.ChangeType.DELETED);
-    assertThat(ChangedFile.create(patchListEntry).oldPath())
+    OptionalSubject.assertThat(ChangedFile.create(patchListEntry).oldPath())
         .value()
         .isEqualTo(Paths.get("/" + oldPath));
   }
@@ -209,7 +213,7 @@
   public void getOldPath_fileDiffOutput() throws Exception {
     String oldPath = "foo/bar/baz.txt";
     setupFileDiffOutput(/* newPath= */ null, oldPath, Patch.ChangeType.DELETED);
-    assertThat(ChangedFile.create(fileDiffOutput).oldPath())
+    OptionalSubject.assertThat(ChangedFile.create(fileDiffOutput).oldPath())
         .value()
         .isEqualTo(Paths.get("/" + oldPath));
   }
@@ -218,19 +222,19 @@
   public void getOldPathWhenOldPathIsNotSet_diffEntry() throws Exception {
     setupDiffEntry(/* newPath= */ null, /* oldPath= */ null, ChangeType.DELETE);
     when(diffEntry.getOldPath()).thenReturn(DiffEntry.DEV_NULL);
-    assertThat(ChangedFile.create(diffEntry).oldPath()).isEmpty();
+    OptionalSubject.assertThat(ChangedFile.create(diffEntry).oldPath()).isEmpty();
   }
 
   @Test
   public void getOldPathWhenOldPathIsNotSet_patchListEntry() throws Exception {
     setupPatchListEntry(/* newPath= */ null, /* oldPath= */ null, Patch.ChangeType.DELETED);
-    assertThat(ChangedFile.create(patchListEntry).oldPath()).isEmpty();
+    OptionalSubject.assertThat(ChangedFile.create(patchListEntry).oldPath()).isEmpty();
   }
 
   @Test
   public void getOldPathWhenOldPathIsNotSet_fileDiffOutput() throws Exception {
     setupFileDiffOutput(/* newPath= */ null, /* oldPath= */ null, Patch.ChangeType.DELETED);
-    assertThat(ChangedFile.create(fileDiffOutput).oldPath()).isEmpty();
+    OptionalSubject.assertThat(ChangedFile.create(fileDiffOutput).oldPath()).isEmpty();
   }
 
   @Test
diff --git a/javatests/com/google/gerrit/plugins/codeowners/backend/CodeOwnersExceptionHookTest.java b/javatests/com/google/gerrit/plugins/codeowners/backend/CodeOwnersExceptionHookTest.java
index e1786d3..2f64510 100644
--- a/javatests/com/google/gerrit/plugins/codeowners/backend/CodeOwnersExceptionHookTest.java
+++ b/javatests/com/google/gerrit/plugins/codeowners/backend/CodeOwnersExceptionHookTest.java
@@ -15,13 +15,13 @@
 package com.google.gerrit.plugins.codeowners.backend;
 
 import static com.google.common.truth.Truth.assertThat;
-import static com.google.gerrit.truth.OptionalSubject.assertThat;
 
 import com.google.common.collect.ImmutableList;
 import com.google.gerrit.acceptance.config.GerritConfig;
 import com.google.gerrit.plugins.codeowners.acceptance.AbstractCodeOwnersTest;
 import com.google.gerrit.plugins.codeowners.backend.config.InvalidPluginConfigurationException;
 import com.google.gerrit.server.ExceptionHook.Status;
+import com.google.gerrit.truth.OptionalSubject;
 import java.nio.file.InvalidPathException;
 import java.util.Optional;
 import org.junit.Before;
@@ -114,29 +114,36 @@
   @Test
   public void getStatus() throws Exception {
     Status conflictStatus = Status.create(409, "Conflict");
-    assertThat(getStatus(newInvalidPluginConfigurationException()))
+    OptionalSubject.assertThat(getStatus(newInvalidPluginConfigurationException()))
         .value()
         .isEqualTo(conflictStatus);
-    assertThat(getStatus(newExceptionWithCause(newInvalidPluginConfigurationException())))
+    OptionalSubject.assertThat(
+            getStatus(newExceptionWithCause(newInvalidPluginConfigurationException())))
         .value()
         .isEqualTo(conflictStatus);
 
-    assertThat(getStatus(newInvalidCodeOwnerConfigException())).value().isEqualTo(conflictStatus);
-    assertThat(getStatus(newExceptionWithCause(newInvalidCodeOwnerConfigException())))
+    OptionalSubject.assertThat(getStatus(newInvalidCodeOwnerConfigException()))
+        .value()
+        .isEqualTo(conflictStatus);
+    OptionalSubject.assertThat(
+            getStatus(newExceptionWithCause(newInvalidCodeOwnerConfigException())))
         .value()
         .isEqualTo(conflictStatus);
 
-    assertThat(getStatus(newInvalidPathException())).value().isEqualTo(conflictStatus);
-    assertThat(getStatus(newExceptionWithCause(newInvalidPathException())))
+    OptionalSubject.assertThat(getStatus(newInvalidPathException()))
+        .value()
+        .isEqualTo(conflictStatus);
+    OptionalSubject.assertThat(getStatus(newExceptionWithCause(newInvalidPathException())))
         .value()
         .isEqualTo(conflictStatus);
 
-    assertThat(getStatus(new Exception())).isEmpty();
-    assertThat(getStatus(newExceptionWithCause(new Exception()))).isEmpty();
+    OptionalSubject.assertThat(getStatus(new Exception())).isEmpty();
+    OptionalSubject.assertThat(getStatus(newExceptionWithCause(new Exception()))).isEmpty();
 
-    assertThat(getStatus(CodeOwnersInternalServerErrorException.newInternalServerError("msg")))
+    OptionalSubject.assertThat(
+            getStatus(CodeOwnersInternalServerErrorException.newInternalServerError("msg")))
         .isEmpty();
-    assertThat(
+    OptionalSubject.assertThat(
             getStatus(
                 newExceptionWithCause(
                     CodeOwnersInternalServerErrorException.newInternalServerError("msg"))))
diff --git a/javatests/com/google/gerrit/plugins/codeowners/backend/CodeOwnersTest.java b/javatests/com/google/gerrit/plugins/codeowners/backend/CodeOwnersTest.java
index fafc620..294dfd0 100644
--- a/javatests/com/google/gerrit/plugins/codeowners/backend/CodeOwnersTest.java
+++ b/javatests/com/google/gerrit/plugins/codeowners/backend/CodeOwnersTest.java
@@ -16,7 +16,6 @@
 
 import static com.google.common.truth.Truth.assertThat;
 import static com.google.gerrit.testing.GerritJUnit.assertThrows;
-import static com.google.gerrit.truth.OptionalSubject.assertThat;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
@@ -26,6 +25,7 @@
 import com.google.gerrit.extensions.registration.PrivateInternals_DynamicMapImpl;
 import com.google.gerrit.extensions.registration.RegistrationHandle;
 import com.google.gerrit.plugins.codeowners.acceptance.AbstractCodeOwnersTest;
+import com.google.gerrit.truth.OptionalSubject;
 import com.google.inject.Key;
 import com.google.inject.util.Providers;
 import java.util.Optional;
@@ -92,7 +92,7 @@
     try (AutoCloseable registration = registerTestBackend("test-backend", codeOwnerBackendMock)) {
       Optional<CodeOwnerConfig> codeOwnerConfig =
           codeOwners.getFromCurrentRevision(codeOwnerConfigKey);
-      assertThat(codeOwnerConfig).value().isEqualTo(expectedCodeOwnersConfig);
+      OptionalSubject.assertThat(codeOwnerConfig).value().isEqualTo(expectedCodeOwnersConfig);
       verify(codeOwnerBackendMock).getCodeOwnerConfig(codeOwnerConfigKey, /* revision= */ null);
     }
   }
@@ -110,7 +110,7 @@
         .thenReturn(Optional.of(expectedCodeOwnersConfig));
     try (AutoCloseable registration = registerTestBackend("test-backend", codeOwnerBackendMock)) {
       Optional<CodeOwnerConfig> codeOwnerConfig = codeOwners.get(codeOwnerConfigKey, TEST_REVISION);
-      assertThat(codeOwnerConfig).value().isEqualTo(expectedCodeOwnersConfig);
+      OptionalSubject.assertThat(codeOwnerConfig).value().isEqualTo(expectedCodeOwnersConfig);
       verify(codeOwnerBackendMock).getCodeOwnerConfig(codeOwnerConfigKey, TEST_REVISION);
     }
   }
diff --git a/javatests/com/google/gerrit/plugins/codeowners/backend/config/BackendConfigTest.java b/javatests/com/google/gerrit/plugins/codeowners/backend/config/BackendConfigTest.java
index dcc9cb3..fffc267 100644
--- a/javatests/com/google/gerrit/plugins/codeowners/backend/config/BackendConfigTest.java
+++ b/javatests/com/google/gerrit/plugins/codeowners/backend/config/BackendConfigTest.java
@@ -19,7 +19,6 @@
 import static com.google.gerrit.plugins.codeowners.backend.config.BackendConfig.KEY_PATH_EXPRESSIONS;
 import static com.google.gerrit.plugins.codeowners.backend.config.CodeOwnersPluginConfiguration.SECTION_CODE_OWNERS;
 import static com.google.gerrit.testing.GerritJUnit.assertThrows;
-import static com.google.gerrit.truth.OptionalSubject.assertThat;
 
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.Iterables;
@@ -32,6 +31,7 @@
 import com.google.gerrit.plugins.codeowners.backend.proto.ProtoBackend;
 import com.google.gerrit.server.git.validators.CommitValidationMessage;
 import com.google.gerrit.server.git.validators.ValidationMessage;
+import com.google.gerrit.truth.OptionalSubject;
 import org.eclipse.jgit.lib.Config;
 import org.junit.Before;
 import org.junit.Test;
@@ -65,7 +65,7 @@
 
   @Test
   public void getBackendForBranchWhenBackendIsNotSet() throws Exception {
-    assertThat(
+    OptionalSubject.assertThat(
             backendConfig.getBackendForBranch(
                 new Config(), BranchNameKey.create(project, "master")))
         .isEmpty();
@@ -79,7 +79,8 @@
         "refs/heads/master",
         KEY_BACKEND,
         CodeOwnerBackendId.FIND_OWNERS.getBackendId());
-    assertThat(backendConfig.getBackendForBranch(cfg, BranchNameKey.create(project, "master")))
+    OptionalSubject.assertThat(
+            backendConfig.getBackendForBranch(cfg, BranchNameKey.create(project, "master")))
         .value()
         .isInstanceOf(FindOwnersBackend.class);
   }
@@ -89,7 +90,8 @@
     Config cfg = new Config();
     cfg.setString(
         SECTION_CODE_OWNERS, "master", KEY_BACKEND, CodeOwnerBackendId.FIND_OWNERS.getBackendId());
-    assertThat(backendConfig.getBackendForBranch(cfg, BranchNameKey.create(project, "master")))
+    OptionalSubject.assertThat(
+            backendConfig.getBackendForBranch(cfg, BranchNameKey.create(project, "master")))
         .value()
         .isInstanceOf(FindOwnersBackend.class);
   }
@@ -131,7 +133,7 @@
 
   @Test
   public void getBackendForProjectWhenBackendIsNotSet() throws Exception {
-    assertThat(backendConfig.getBackendForProject(new Config(), project)).isEmpty();
+    OptionalSubject.assertThat(backendConfig.getBackendForProject(new Config(), project)).isEmpty();
   }
 
   @Test
@@ -139,7 +141,7 @@
     Config cfg = new Config();
     cfg.setString(
         SECTION_CODE_OWNERS, null, KEY_BACKEND, CodeOwnerBackendId.FIND_OWNERS.getBackendId());
-    assertThat(backendConfig.getBackendForProject(cfg, project))
+    OptionalSubject.assertThat(backendConfig.getBackendForProject(cfg, project))
         .value()
         .isInstanceOf(FindOwnersBackend.class);
   }
@@ -209,7 +211,7 @@
 
   @Test
   public void getPathExpressionsForBranchWhenPathExpressionsAreNotSet() throws Exception {
-    assertThat(
+    OptionalSubject.assertThat(
             backendConfig.getPathExpressionsForBranch(
                 new Config(), BranchNameKey.create(project, "master")))
         .isEmpty();
@@ -223,7 +225,7 @@
         "refs/heads/master",
         KEY_PATH_EXPRESSIONS,
         PathExpressions.GLOB.name());
-    assertThat(
+    OptionalSubject.assertThat(
             backendConfig.getPathExpressionsForBranch(cfg, BranchNameKey.create(project, "master")))
         .value()
         .isEqualTo(PathExpressions.GLOB);
@@ -233,7 +235,7 @@
   public void getPathExpressionsForBranchShortName() throws Exception {
     Config cfg = new Config();
     cfg.setString(SECTION_CODE_OWNERS, "master", KEY_PATH_EXPRESSIONS, PathExpressions.GLOB.name());
-    assertThat(
+    OptionalSubject.assertThat(
             backendConfig.getPathExpressionsForBranch(cfg, BranchNameKey.create(project, "master")))
         .value()
         .isEqualTo(PathExpressions.GLOB);
@@ -243,7 +245,7 @@
   public void getPathExpressionsForBranchIfConfigIsInvalid() throws Exception {
     Config cfg = new Config();
     cfg.setString(SECTION_CODE_OWNERS, "master", KEY_PATH_EXPRESSIONS, "INVALID");
-    assertThat(
+    OptionalSubject.assertThat(
             backendConfig.getPathExpressionsForBranch(cfg, BranchNameKey.create(project, "master")))
         .isEmpty();
   }
@@ -268,14 +270,15 @@
 
   @Test
   public void getPathExpressionsForProjectWhenBackendIsNotSet() throws Exception {
-    assertThat(backendConfig.getPathExpressionsForProject(new Config(), project)).isEmpty();
+    OptionalSubject.assertThat(backendConfig.getPathExpressionsForProject(new Config(), project))
+        .isEmpty();
   }
 
   @Test
   public void getPathExpressionsForProject() throws Exception {
     Config cfg = new Config();
     cfg.setString(SECTION_CODE_OWNERS, null, KEY_PATH_EXPRESSIONS, PathExpressions.GLOB.name());
-    assertThat(backendConfig.getPathExpressionsForProject(cfg, project))
+    OptionalSubject.assertThat(backendConfig.getPathExpressionsForProject(cfg, project))
         .value()
         .isEqualTo(PathExpressions.GLOB);
   }
@@ -284,7 +287,7 @@
   public void getPathExpressionsForProjectIfConfigIsInvalid() throws Exception {
     Config cfg = new Config();
     cfg.setString(SECTION_CODE_OWNERS, null, KEY_PATH_EXPRESSIONS, "INVALID");
-    assertThat(backendConfig.getPathExpressionsForProject(cfg, project)).isEmpty();
+    OptionalSubject.assertThat(backendConfig.getPathExpressionsForProject(cfg, project)).isEmpty();
   }
 
   @Test
@@ -307,19 +310,21 @@
 
   @Test
   public void getDefaultPathExpressions() throws Exception {
-    assertThat(backendConfig.getDefaultPathExpressions()).isEmpty();
+    OptionalSubject.assertThat(backendConfig.getDefaultPathExpressions()).isEmpty();
   }
 
   @Test
   @GerritConfig(name = "plugin.code-owners.pathExpressions", value = "GLOB")
   public void getConfiguredDefaultPathExpressions() throws Exception {
-    assertThat(backendConfig.getDefaultPathExpressions()).value().isEqualTo(PathExpressions.GLOB);
+    OptionalSubject.assertThat(backendConfig.getDefaultPathExpressions())
+        .value()
+        .isEqualTo(PathExpressions.GLOB);
   }
 
   @Test
   @GerritConfig(name = "plugin.code-owners.pathExpressions", value = "INVALID")
   public void getDefaultPathExpressionsIfConfigIsInvalid() throws Exception {
-    assertThat(backendConfig.getDefaultPathExpressions()).isEmpty();
+    OptionalSubject.assertThat(backendConfig.getDefaultPathExpressions()).isEmpty();
   }
 
   @Test
diff --git a/javatests/com/google/gerrit/plugins/codeowners/backend/config/CodeOwnersPluginGlobalConfigSnapshotTest.java b/javatests/com/google/gerrit/plugins/codeowners/backend/config/CodeOwnersPluginGlobalConfigSnapshotTest.java
index 6a5c03d..e40d437 100644
--- a/javatests/com/google/gerrit/plugins/codeowners/backend/config/CodeOwnersPluginGlobalConfigSnapshotTest.java
+++ b/javatests/com/google/gerrit/plugins/codeowners/backend/config/CodeOwnersPluginGlobalConfigSnapshotTest.java
@@ -16,11 +16,11 @@
 
 import static com.google.common.truth.Truth.assertThat;
 import static com.google.gerrit.testing.GerritJUnit.assertThrows;
-import static com.google.gerrit.truth.OptionalSubject.assertThat;
 
 import com.google.gerrit.acceptance.config.GerritConfig;
 import com.google.gerrit.extensions.restapi.MethodNotAllowedException;
 import com.google.gerrit.plugins.codeowners.acceptance.AbstractCodeOwnersTest;
+import com.google.gerrit.truth.OptionalSubject;
 import org.junit.Before;
 import org.junit.Test;
 
@@ -65,7 +65,7 @@
 
   @Test
   public void codeOwnerConfigCacheSizeIsLimitedByDefault() throws Exception {
-    assertThat(cfgSnapshot().getMaxCodeOwnerConfigCacheSize())
+    OptionalSubject.assertThat(cfgSnapshot().getMaxCodeOwnerConfigCacheSize())
         .value()
         .isEqualTo(CodeOwnersPluginGlobalConfigSnapshot.DEFAULT_MAX_CODE_OWNER_CONFIG_CACHE_SIZE);
   }
@@ -73,26 +73,28 @@
   @Test
   @GerritConfig(name = "plugin.code-owners.maxCodeOwnerConfigCacheSize", value = "0")
   public void codeOwnerConfigCacheSizeIsUnlimited() throws Exception {
-    assertThat(cfgSnapshot().getMaxCodeOwnerConfigCacheSize()).isEmpty();
+    OptionalSubject.assertThat(cfgSnapshot().getMaxCodeOwnerConfigCacheSize()).isEmpty();
   }
 
   @Test
   @GerritConfig(name = "plugin.code-owners.maxCodeOwnerConfigCacheSize", value = "10")
   public void codeOwnerConfigCacheSizeIsLimited() throws Exception {
-    assertThat(cfgSnapshot().getMaxCodeOwnerConfigCacheSize()).value().isEqualTo(10);
+    OptionalSubject.assertThat(cfgSnapshot().getMaxCodeOwnerConfigCacheSize())
+        .value()
+        .isEqualTo(10);
   }
 
   @Test
   @GerritConfig(name = "plugin.code-owners.maxCodeOwnerConfigCacheSize", value = "invalid")
   public void maxCodeOwnerConfigCacheSize_invalidConfig() throws Exception {
-    assertThat(cfgSnapshot().getMaxCodeOwnerConfigCacheSize())
+    OptionalSubject.assertThat(cfgSnapshot().getMaxCodeOwnerConfigCacheSize())
         .value()
         .isEqualTo(CodeOwnersPluginGlobalConfigSnapshot.DEFAULT_MAX_CODE_OWNER_CONFIG_CACHE_SIZE);
   }
 
   @Test
   public void codeOwnerCacheSizeIsLimitedByDefault() throws Exception {
-    assertThat(cfgSnapshot().getMaxCodeOwnerCacheSize())
+    OptionalSubject.assertThat(cfgSnapshot().getMaxCodeOwnerCacheSize())
         .value()
         .isEqualTo(CodeOwnersPluginGlobalConfigSnapshot.DEFAULT_MAX_CODE_OWNER_CACHE_SIZE);
   }
@@ -100,19 +102,19 @@
   @Test
   @GerritConfig(name = "plugin.code-owners.maxCodeOwnerCacheSize", value = "0")
   public void codeOwnerCacheSizeIsUnlimited() throws Exception {
-    assertThat(cfgSnapshot().getMaxCodeOwnerCacheSize()).isEmpty();
+    OptionalSubject.assertThat(cfgSnapshot().getMaxCodeOwnerCacheSize()).isEmpty();
   }
 
   @Test
   @GerritConfig(name = "plugin.code-owners.maxCodeOwnerCacheSize", value = "10")
   public void codeOwnerCacheSizeIsLimited() throws Exception {
-    assertThat(cfgSnapshot().getMaxCodeOwnerCacheSize()).value().isEqualTo(10);
+    OptionalSubject.assertThat(cfgSnapshot().getMaxCodeOwnerCacheSize()).value().isEqualTo(10);
   }
 
   @Test
   @GerritConfig(name = "plugin.code-owners.maxCodeOwnerCacheSize", value = "invalid")
   public void maxCodeOwnerCacheSize_invalidConfig() throws Exception {
-    assertThat(cfgSnapshot().getMaxCodeOwnerCacheSize())
+    OptionalSubject.assertThat(cfgSnapshot().getMaxCodeOwnerCacheSize())
         .value()
         .isEqualTo(CodeOwnersPluginGlobalConfigSnapshot.DEFAULT_MAX_CODE_OWNER_CACHE_SIZE);
   }
diff --git a/javatests/com/google/gerrit/plugins/codeowners/backend/config/CodeOwnersPluginProjectConfigSnapshotTest.java b/javatests/com/google/gerrit/plugins/codeowners/backend/config/CodeOwnersPluginProjectConfigSnapshotTest.java
index 66649f9..77f79bf 100644
--- a/javatests/com/google/gerrit/plugins/codeowners/backend/config/CodeOwnersPluginProjectConfigSnapshotTest.java
+++ b/javatests/com/google/gerrit/plugins/codeowners/backend/config/CodeOwnersPluginProjectConfigSnapshotTest.java
@@ -19,7 +19,6 @@
 import static com.google.gerrit.plugins.codeowners.testing.CodeOwnerSetSubject.hasEmail;
 import static com.google.gerrit.plugins.codeowners.testing.RequiredApprovalSubject.assertThat;
 import static com.google.gerrit.testing.GerritJUnit.assertThrows;
-import static com.google.gerrit.truth.OptionalSubject.assertThat;
 
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.ImmutableMap;
@@ -48,6 +47,7 @@
 import com.google.gerrit.plugins.codeowners.common.CodeOwnerConfigValidationPolicy;
 import com.google.gerrit.plugins.codeowners.common.MergeCommitStrategy;
 import com.google.gerrit.server.IdentifiedUser;
+import com.google.gerrit.truth.OptionalSubject;
 import com.google.inject.Inject;
 import com.google.inject.Key;
 import com.google.inject.util.Providers;
@@ -76,28 +76,28 @@
   @Test
   @GerritConfig(name = "plugin.code-owners.fileExtension", value = "foo")
   public void getFileExtensionIfNoneIsConfiguredOnProjectLevel() throws Exception {
-    assertThat(cfgSnapshot().getFileExtension()).value().isEqualTo("foo");
+    OptionalSubject.assertThat(cfgSnapshot().getFileExtension()).value().isEqualTo("foo");
   }
 
   @Test
   @GerritConfig(name = "plugin.code-owners.fileExtension", value = "foo")
   public void fileExtensionOnProjectLevelOverridesDefaultFileExtension() throws Exception {
     configureFileExtension(project, "bar");
-    assertThat(cfgSnapshot().getFileExtension()).value().isEqualTo("bar");
+    OptionalSubject.assertThat(cfgSnapshot().getFileExtension()).value().isEqualTo("bar");
   }
 
   @Test
   @GerritConfig(name = "plugin.code-owners.fileExtension", value = "foo")
   public void fileExtensionIsInheritedFromParentProject() throws Exception {
     configureFileExtension(allProjects, "bar");
-    assertThat(cfgSnapshot().getFileExtension()).value().isEqualTo("bar");
+    OptionalSubject.assertThat(cfgSnapshot().getFileExtension()).value().isEqualTo("bar");
   }
 
   @Test
   public void inheritedFileExtensionCanBeOverridden() throws Exception {
     configureFileExtension(allProjects, "foo");
     configureFileExtension(project, "bar");
-    assertThat(cfgSnapshot().getFileExtension()).value().isEqualTo("bar");
+    OptionalSubject.assertThat(cfgSnapshot().getFileExtension()).value().isEqualTo("bar");
   }
 
   @Test
@@ -1043,18 +1043,20 @@
 
   @Test
   public void getPathExpressionsForNonExistingBranch() throws Exception {
-    assertThat(cfgSnapshot().getPathExpressions("non-existing")).isEmpty();
+    OptionalSubject.assertThat(cfgSnapshot().getPathExpressions("non-existing")).isEmpty();
   }
 
   @Test
   public void getPathExpressionsWhenNoPathExpressionsAreConfigured() throws Exception {
-    assertThat(cfgSnapshot().getPathExpressions("master")).isEmpty();
+    OptionalSubject.assertThat(cfgSnapshot().getPathExpressions("master")).isEmpty();
   }
 
   @Test
   @GerritConfig(name = "plugin.code-owners.pathExpressions", value = "GLOB")
   public void getConfiguredPathExpressions() throws Exception {
-    assertThat(cfgSnapshot().getPathExpressions("master")).value().isEqualTo(PathExpressions.GLOB);
+    OptionalSubject.assertThat(cfgSnapshot().getPathExpressions("master"))
+        .value()
+        .isEqualTo(PathExpressions.GLOB);
   }
 
   @Test
@@ -1062,13 +1064,15 @@
       name = "plugin.code-owners.pathExpressions",
       value = "non-existing-path-expressions")
   public void getPathExpressionsIfNonExistingPathExpressionsAreConfigured() throws Exception {
-    assertThat(cfgSnapshot().getPathExpressions("master")).isEmpty();
+    OptionalSubject.assertThat(cfgSnapshot().getPathExpressions("master")).isEmpty();
   }
 
   @Test
   public void getPathExpressionsConfiguredOnProjectLevel() throws Exception {
     configurePathExpressions(project, PathExpressions.GLOB.name());
-    assertThat(cfgSnapshot().getPathExpressions("master")).value().isEqualTo(PathExpressions.GLOB);
+    OptionalSubject.assertThat(cfgSnapshot().getPathExpressions("master"))
+        .value()
+        .isEqualTo(PathExpressions.GLOB);
   }
 
   @Test
@@ -1076,7 +1080,7 @@
   public void pathExpressionsConfiguredOnProjectLevelOverrideDefaultPathExpressions()
       throws Exception {
     configurePathExpressions(project, PathExpressions.SIMPLE.name());
-    assertThat(cfgSnapshot().getPathExpressions("master"))
+    OptionalSubject.assertThat(cfgSnapshot().getPathExpressions("master"))
         .value()
         .isEqualTo(PathExpressions.SIMPLE);
   }
@@ -1084,14 +1088,16 @@
   @Test
   public void pathExpressionsAreInheritedFromParentProject() throws Exception {
     configurePathExpressions(allProjects, PathExpressions.GLOB.name());
-    assertThat(cfgSnapshot().getPathExpressions("master")).value().isEqualTo(PathExpressions.GLOB);
+    OptionalSubject.assertThat(cfgSnapshot().getPathExpressions("master"))
+        .value()
+        .isEqualTo(PathExpressions.GLOB);
   }
 
   @Test
   @GerritConfig(name = "plugin.code-owners.pathExpressions", value = "GLOB")
   public void inheritedPathExpressionsOverrideDefaultPathExpressions() throws Exception {
     configurePathExpressions(allProjects, PathExpressions.SIMPLE.name());
-    assertThat(cfgSnapshot().getPathExpressions("master"))
+    OptionalSubject.assertThat(cfgSnapshot().getPathExpressions("master"))
         .value()
         .isEqualTo(PathExpressions.SIMPLE);
   }
@@ -1100,7 +1106,7 @@
   public void projectLevelPathExpressionsOverrideInheritedPathExpressions() throws Exception {
     configurePathExpressions(allProjects, PathExpressions.GLOB.name());
     configurePathExpressions(project, PathExpressions.SIMPLE.name());
-    assertThat(cfgSnapshot().getPathExpressions("master"))
+    OptionalSubject.assertThat(cfgSnapshot().getPathExpressions("master"))
         .value()
         .isEqualTo(PathExpressions.SIMPLE);
   }
@@ -1111,26 +1117,32 @@
       pathExpressionsAreReadFromGlobalConfigIfNonExistingPathExpressionsAreConfiguredOnProjectLevel()
           throws Exception {
     configurePathExpressions(project, "non-existing-path-expressions");
-    assertThat(cfgSnapshot().getPathExpressions("master")).value().isEqualTo(PathExpressions.GLOB);
+    OptionalSubject.assertThat(cfgSnapshot().getPathExpressions("master"))
+        .value()
+        .isEqualTo(PathExpressions.GLOB);
   }
 
   @Test
   public void projectLevelPathExpressionsForOtherProjectHasNoEffect() throws Exception {
     Project.NameKey otherProject = projectOperations.newProject().create();
     configurePathExpressions(otherProject, PathExpressions.GLOB.name());
-    assertThat(cfgSnapshot().getPathExpressions("master")).isEmpty();
+    OptionalSubject.assertThat(cfgSnapshot().getPathExpressions("master")).isEmpty();
   }
 
   @Test
   public void getPathExpressionsConfiguredOnBranchLevel() throws Exception {
     configurePathExpressions(project, "refs/heads/master", PathExpressions.GLOB.name());
-    assertThat(cfgSnapshot().getPathExpressions("master")).value().isEqualTo(PathExpressions.GLOB);
+    OptionalSubject.assertThat(cfgSnapshot().getPathExpressions("master"))
+        .value()
+        .isEqualTo(PathExpressions.GLOB);
   }
 
   @Test
   public void getPathExpressionsConfiguredOnBranchLevelShortName() throws Exception {
     configurePathExpressions(project, "master", PathExpressions.GLOB.name());
-    assertThat(cfgSnapshot().getPathExpressions("master")).value().isEqualTo(PathExpressions.GLOB);
+    OptionalSubject.assertThat(cfgSnapshot().getPathExpressions("master"))
+        .value()
+        .isEqualTo(PathExpressions.GLOB);
   }
 
   @Test
@@ -1139,7 +1151,7 @@
           throws Exception {
     configurePathExpressions(project, "master", PathExpressions.GLOB.name());
     configurePathExpressions(project, "refs/heads/master", PathExpressions.SIMPLE.name());
-    assertThat(cfgSnapshot().getPathExpressions("master"))
+    OptionalSubject.assertThat(cfgSnapshot().getPathExpressions("master"))
         .value()
         .isEqualTo(PathExpressions.SIMPLE);
   }
@@ -1148,7 +1160,7 @@
   public void branchLevelPathExpressionsOverridesProjectLevelPathExpressions() throws Exception {
     configurePathExpressions(project, PathExpressions.GLOB.name());
     configurePathExpressions(project, "master", PathExpressions.SIMPLE.name());
-    assertThat(cfgSnapshot().getPathExpressions("master"))
+    OptionalSubject.assertThat(cfgSnapshot().getPathExpressions("master"))
         .value()
         .isEqualTo(PathExpressions.SIMPLE);
   }
@@ -1171,13 +1183,15 @@
               BackendConfig.KEY_PATH_EXPRESSIONS,
               "non-existing-path-expressions");
         });
-    assertThat(cfgSnapshot().getPathExpressions("master")).value().isEqualTo(PathExpressions.GLOB);
+    OptionalSubject.assertThat(cfgSnapshot().getPathExpressions("master"))
+        .value()
+        .isEqualTo(PathExpressions.GLOB);
   }
 
   @Test
   public void branchLevelPathExpressionsForOtherBranchHaveNoEffect() throws Exception {
     configurePathExpressions(project, "foo", PathExpressions.GLOB.name());
-    assertThat(cfgSnapshot().getPathExpressions("master")).isEmpty();
+    OptionalSubject.assertThat(cfgSnapshot().getPathExpressions("master")).isEmpty();
   }
 
   @Test
diff --git a/javatests/com/google/gerrit/plugins/codeowners/backend/config/GeneralConfigTest.java b/javatests/com/google/gerrit/plugins/codeowners/backend/config/GeneralConfigTest.java
index 17663b2..819411a 100644
--- a/javatests/com/google/gerrit/plugins/codeowners/backend/config/GeneralConfigTest.java
+++ b/javatests/com/google/gerrit/plugins/codeowners/backend/config/GeneralConfigTest.java
@@ -39,7 +39,6 @@
 import static com.google.gerrit.plugins.codeowners.backend.config.GeneralConfig.KEY_REJECT_NON_RESOLVABLE_IMPORTS;
 import static com.google.gerrit.plugins.codeowners.backend.config.GeneralConfig.SECTION_VALIDATION;
 import static com.google.gerrit.testing.GerritJUnit.assertThrows;
-import static com.google.gerrit.truth.OptionalSubject.assertThat;
 
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.Iterables;
@@ -54,6 +53,7 @@
 import com.google.gerrit.server.git.validators.CommitValidationMessage;
 import com.google.gerrit.server.git.validators.ValidationMessage;
 import com.google.gerrit.testing.ConfigSuite;
+import com.google.gerrit.truth.OptionalSubject;
 import org.eclipse.jgit.lib.Config;
 import org.junit.Before;
 import org.junit.Test;
@@ -84,14 +84,16 @@
 
   @Test
   public void noFileExtensionConfigured() throws Exception {
-    assertThat(generalConfig.getFileExtension(new Config())).isEmpty();
+    OptionalSubject.assertThat(generalConfig.getFileExtension(new Config())).isEmpty();
   }
 
   @Test
   @GerritConfig(name = "plugin.code-owners.fileExtension", value = "foo")
   public void fileExtensionIsRetrievedFromGerritConfigIfNotSpecifiedOnProjectLevel()
       throws Exception {
-    assertThat(generalConfig.getFileExtension(new Config())).value().isEqualTo("foo");
+    OptionalSubject.assertThat(generalConfig.getFileExtension(new Config()))
+        .value()
+        .isEqualTo("foo");
   }
 
   @Test
@@ -99,7 +101,7 @@
   public void fileExtensionInPluginConfigOverridesFileExtensionInGerritConfig() throws Exception {
     Config cfg = new Config();
     cfg.setString(SECTION_CODE_OWNERS, /* subsection= */ null, KEY_FILE_EXTENSION, "bar");
-    assertThat(generalConfig.getFileExtension(cfg)).value().isEqualTo("bar");
+    OptionalSubject.assertThat(generalConfig.getFileExtension(cfg)).value().isEqualTo("bar");
   }
 
   @Test
@@ -401,7 +403,7 @@
 
   @Test
   public void noBranchSpecificRejectNonResolvableCodeOwnersConfiguration() throws Exception {
-    assertThat(
+    OptionalSubject.assertThat(
             generalConfig.getRejectNonResolvableCodeOwnersForBranch(
                 BranchNameKey.create(project, "master"), new Config()))
         .isEmpty();
@@ -416,7 +418,7 @@
         "refs/heads/foo",
         KEY_REJECT_NON_RESOLVABLE_CODE_OWNERS,
         /* value= */ false);
-    assertThat(
+    OptionalSubject.assertThat(
             generalConfig.getRejectNonResolvableCodeOwnersForBranch(
                 BranchNameKey.create(project, "master"), cfg))
         .isEmpty();
@@ -431,7 +433,7 @@
         "refs/heads/foo/*",
         KEY_REJECT_NON_RESOLVABLE_CODE_OWNERS,
         /* value= */ false);
-    assertThat(
+    OptionalSubject.assertThat(
             generalConfig.getRejectNonResolvableCodeOwnersForBranch(
                 BranchNameKey.create(project, "master"), cfg))
         .isEmpty();
@@ -446,7 +448,7 @@
         "^refs/heads/.*foo.*",
         KEY_REJECT_NON_RESOLVABLE_CODE_OWNERS,
         /* value= */ false);
-    assertThat(
+    OptionalSubject.assertThat(
             generalConfig.getRejectNonResolvableCodeOwnersForBranch(
                 BranchNameKey.create(project, "master"), cfg))
         .isEmpty();
@@ -461,7 +463,7 @@
         "^refs/heads/[",
         KEY_REJECT_NON_RESOLVABLE_CODE_OWNERS,
         /* value= */ false);
-    assertThat(
+    OptionalSubject.assertThat(
             generalConfig.getRejectNonResolvableCodeOwnersForBranch(
                 BranchNameKey.create(project, "master"), cfg))
         .isEmpty();
@@ -476,7 +478,7 @@
         "refs/heads/master",
         KEY_REJECT_NON_RESOLVABLE_CODE_OWNERS,
         /* value= */ false);
-    assertThat(
+    OptionalSubject.assertThat(
             generalConfig.getRejectNonResolvableCodeOwnersForBranch(
                 BranchNameKey.create(project, "master"), cfg))
         .value()
@@ -492,7 +494,7 @@
         "refs/heads/*",
         KEY_REJECT_NON_RESOLVABLE_CODE_OWNERS,
         /* value= */ false);
-    assertThat(
+    OptionalSubject.assertThat(
             generalConfig.getRejectNonResolvableCodeOwnersForBranch(
                 BranchNameKey.create(project, "master"), cfg))
         .value()
@@ -508,7 +510,7 @@
         "^refs/heads/.*bar.*",
         KEY_REJECT_NON_RESOLVABLE_CODE_OWNERS,
         /* value= */ false);
-    assertThat(
+    OptionalSubject.assertThat(
             generalConfig.getRejectNonResolvableCodeOwnersForBranch(
                 BranchNameKey.create(project, "foobarbaz"), cfg))
         .value()
@@ -521,7 +523,7 @@
     Config cfg = new Config();
     cfg.setString(
         SECTION_VALIDATION, "refs/heads/master", KEY_REJECT_NON_RESOLVABLE_CODE_OWNERS, "INVALID");
-    assertThat(
+    OptionalSubject.assertThat(
             generalConfig.getRejectNonResolvableCodeOwnersForBranch(
                 BranchNameKey.create(project, "master"), cfg))
         .isEmpty();
@@ -549,7 +551,7 @@
 
     // it is non-deterministic which of the branch-specific configurations takes precedence, but
     // since they all configure the same value it's not important for this assertion
-    assertThat(
+    OptionalSubject.assertThat(
             generalConfig.getRejectNonResolvableCodeOwnersForBranch(
                 BranchNameKey.create(project, "master"), cfg))
         .value()
@@ -638,7 +640,7 @@
 
   @Test
   public void noBranchSpecificRejectNonResolvableImportsConfiguration() throws Exception {
-    assertThat(
+    OptionalSubject.assertThat(
             generalConfig.getRejectNonResolvableImportsForBranch(
                 BranchNameKey.create(project, "master"), new Config()))
         .isEmpty();
@@ -653,7 +655,7 @@
         "refs/heads/foo",
         KEY_REJECT_NON_RESOLVABLE_IMPORTS,
         /* value= */ false);
-    assertThat(
+    OptionalSubject.assertThat(
             generalConfig.getRejectNonResolvableImportsForBranch(
                 BranchNameKey.create(project, "master"), cfg))
         .isEmpty();
@@ -668,7 +670,7 @@
         "refs/heads/foo/*",
         KEY_REJECT_NON_RESOLVABLE_IMPORTS,
         /* value= */ false);
-    assertThat(
+    OptionalSubject.assertThat(
             generalConfig.getRejectNonResolvableImportsForBranch(
                 BranchNameKey.create(project, "master"), cfg))
         .isEmpty();
@@ -683,7 +685,7 @@
         "^refs/heads/.*foo.*",
         KEY_REJECT_NON_RESOLVABLE_IMPORTS,
         /* value= */ false);
-    assertThat(
+    OptionalSubject.assertThat(
             generalConfig.getRejectNonResolvableImportsForBranch(
                 BranchNameKey.create(project, "master"), cfg))
         .isEmpty();
@@ -695,7 +697,7 @@
     Config cfg = new Config();
     cfg.setBoolean(
         SECTION_VALIDATION, "^refs/heads/[", KEY_REJECT_NON_RESOLVABLE_IMPORTS, /* value= */ false);
-    assertThat(
+    OptionalSubject.assertThat(
             generalConfig.getRejectNonResolvableImportsForBranch(
                 BranchNameKey.create(project, "master"), cfg))
         .isEmpty();
@@ -710,7 +712,7 @@
         "refs/heads/master",
         KEY_REJECT_NON_RESOLVABLE_IMPORTS,
         /* value= */ false);
-    assertThat(
+    OptionalSubject.assertThat(
             generalConfig.getRejectNonResolvableImportsForBranch(
                 BranchNameKey.create(project, "master"), cfg))
         .value()
@@ -723,7 +725,7 @@
     Config cfg = new Config();
     cfg.setBoolean(
         SECTION_VALIDATION, "refs/heads/*", KEY_REJECT_NON_RESOLVABLE_IMPORTS, /* value= */ false);
-    assertThat(
+    OptionalSubject.assertThat(
             generalConfig.getRejectNonResolvableImportsForBranch(
                 BranchNameKey.create(project, "master"), cfg))
         .value()
@@ -739,7 +741,7 @@
         "^refs/heads/.*bar.*",
         KEY_REJECT_NON_RESOLVABLE_IMPORTS,
         /* value= */ false);
-    assertThat(
+    OptionalSubject.assertThat(
             generalConfig.getRejectNonResolvableImportsForBranch(
                 BranchNameKey.create(project, "foobarbaz"), cfg))
         .value()
@@ -752,7 +754,7 @@
     Config cfg = new Config();
     cfg.setString(
         SECTION_VALIDATION, "refs/heads/master", KEY_REJECT_NON_RESOLVABLE_IMPORTS, "INVALID");
-    assertThat(
+    OptionalSubject.assertThat(
             generalConfig.getRejectNonResolvableImportsForBranch(
                 BranchNameKey.create(project, "master"), cfg))
         .isEmpty();
@@ -777,7 +779,7 @@
 
     // it is non-deterministic which of the branch-specific configurations takes precedence, but
     // since they all configure the same value it's not important for this assertion
-    assertThat(
+    OptionalSubject.assertThat(
             generalConfig.getRejectNonResolvableImportsForBranch(
                 BranchNameKey.create(project, "master"), cfg))
         .value()
@@ -889,7 +891,7 @@
 
   @Test
   public void noBranchSpecificEnableValidationOnBranchCreationConfiguration() throws Exception {
-    assertThat(
+    OptionalSubject.assertThat(
             generalConfig.getCodeOwnerConfigValidationPolicyForBranchCreationForBranch(
                 BranchNameKey.create(project, "master"), new Config()))
         .isEmpty();
@@ -901,7 +903,7 @@
     Config cfg = new Config();
     cfg.setString(
         SECTION_VALIDATION, "refs/heads/foo", KEY_ENABLE_VALIDATION_ON_BRANCH_CREATION, "false");
-    assertThat(
+    OptionalSubject.assertThat(
             generalConfig.getCodeOwnerConfigValidationPolicyForBranchCreationForBranch(
                 BranchNameKey.create(project, "master"), cfg))
         .isEmpty();
@@ -913,7 +915,7 @@
     Config cfg = new Config();
     cfg.setString(
         SECTION_VALIDATION, "refs/heads/foo/*", KEY_ENABLE_VALIDATION_ON_COMMIT_RECEIVED, "false");
-    assertThat(
+    OptionalSubject.assertThat(
             generalConfig.getCodeOwnerConfigValidationPolicyForBranchCreationForBranch(
                 BranchNameKey.create(project, "master"), cfg))
         .isEmpty();
@@ -928,7 +930,7 @@
         "^refs/heads/.*foo.*",
         KEY_ENABLE_VALIDATION_ON_BRANCH_CREATION,
         "false");
-    assertThat(
+    OptionalSubject.assertThat(
             generalConfig.getCodeOwnerConfigValidationPolicyForBranchCreationForBranch(
                 BranchNameKey.create(project, "master"), cfg))
         .isEmpty();
@@ -940,7 +942,7 @@
     Config cfg = new Config();
     cfg.setString(
         SECTION_VALIDATION, "^refs/heads/[", KEY_ENABLE_VALIDATION_ON_BRANCH_CREATION, "false");
-    assertThat(
+    OptionalSubject.assertThat(
             generalConfig.getCodeOwnerConfigValidationPolicyForBranchCreationForBranch(
                 BranchNameKey.create(project, "master"), cfg))
         .isEmpty();
@@ -952,7 +954,7 @@
     Config cfg = new Config();
     cfg.setString(
         SECTION_VALIDATION, "refs/heads/master", KEY_ENABLE_VALIDATION_ON_BRANCH_CREATION, "false");
-    assertThat(
+    OptionalSubject.assertThat(
             generalConfig.getCodeOwnerConfigValidationPolicyForBranchCreationForBranch(
                 BranchNameKey.create(project, "master"), cfg))
         .value()
@@ -965,7 +967,7 @@
     Config cfg = new Config();
     cfg.setString(
         SECTION_VALIDATION, "refs/heads/*", KEY_ENABLE_VALIDATION_ON_BRANCH_CREATION, "false");
-    assertThat(
+    OptionalSubject.assertThat(
             generalConfig.getCodeOwnerConfigValidationPolicyForBranchCreationForBranch(
                 BranchNameKey.create(project, "master"), cfg))
         .value()
@@ -981,7 +983,7 @@
         "^refs/heads/.*bar.*",
         KEY_ENABLE_VALIDATION_ON_BRANCH_CREATION,
         "false");
-    assertThat(
+    OptionalSubject.assertThat(
             generalConfig.getCodeOwnerConfigValidationPolicyForBranchCreationForBranch(
                 BranchNameKey.create(project, "foobarbaz"), cfg))
         .value()
@@ -997,7 +999,7 @@
         "refs/heads/master",
         KEY_ENABLE_VALIDATION_ON_BRANCH_CREATION,
         "INVALID");
-    assertThat(
+    OptionalSubject.assertThat(
             generalConfig.getCodeOwnerConfigValidationPolicyForBranchCreationForBranch(
                 BranchNameKey.create(project, "master"), cfg))
         .isEmpty();
@@ -1016,7 +1018,7 @@
 
     // it is non-deterministic which of the branch-specific configurations takes precedence, but
     // since they all configure the same value it's not important for this assertion
-    assertThat(
+    OptionalSubject.assertThat(
             generalConfig.getCodeOwnerConfigValidationPolicyForBranchCreationForBranch(
                 BranchNameKey.create(project, "master"), cfg))
         .value()
@@ -1117,7 +1119,7 @@
 
   @Test
   public void noBranchSpecificEnableValidationOnCommitReceivedConfiguration() throws Exception {
-    assertThat(
+    OptionalSubject.assertThat(
             generalConfig.getCodeOwnerConfigValidationPolicyForCommitReceivedForBranch(
                 BranchNameKey.create(project, "master"), new Config()))
         .isEmpty();
@@ -1129,7 +1131,7 @@
     Config cfg = new Config();
     cfg.setString(
         SECTION_VALIDATION, "refs/heads/foo", KEY_ENABLE_VALIDATION_ON_COMMIT_RECEIVED, "false");
-    assertThat(
+    OptionalSubject.assertThat(
             generalConfig.getCodeOwnerConfigValidationPolicyForCommitReceivedForBranch(
                 BranchNameKey.create(project, "master"), cfg))
         .isEmpty();
@@ -1141,7 +1143,7 @@
     Config cfg = new Config();
     cfg.setString(
         SECTION_VALIDATION, "refs/heads/foo/*", KEY_ENABLE_VALIDATION_ON_COMMIT_RECEIVED, "false");
-    assertThat(
+    OptionalSubject.assertThat(
             generalConfig.getCodeOwnerConfigValidationPolicyForCommitReceivedForBranch(
                 BranchNameKey.create(project, "master"), cfg))
         .isEmpty();
@@ -1156,7 +1158,7 @@
         "^refs/heads/.*foo.*",
         KEY_ENABLE_VALIDATION_ON_COMMIT_RECEIVED,
         "false");
-    assertThat(
+    OptionalSubject.assertThat(
             generalConfig.getCodeOwnerConfigValidationPolicyForCommitReceivedForBranch(
                 BranchNameKey.create(project, "master"), cfg))
         .isEmpty();
@@ -1168,7 +1170,7 @@
     Config cfg = new Config();
     cfg.setString(
         SECTION_VALIDATION, "^refs/heads/[", KEY_ENABLE_VALIDATION_ON_COMMIT_RECEIVED, "false");
-    assertThat(
+    OptionalSubject.assertThat(
             generalConfig.getCodeOwnerConfigValidationPolicyForCommitReceivedForBranch(
                 BranchNameKey.create(project, "master"), cfg))
         .isEmpty();
@@ -1180,7 +1182,7 @@
     Config cfg = new Config();
     cfg.setString(
         SECTION_VALIDATION, "refs/heads/master", KEY_ENABLE_VALIDATION_ON_COMMIT_RECEIVED, "false");
-    assertThat(
+    OptionalSubject.assertThat(
             generalConfig.getCodeOwnerConfigValidationPolicyForCommitReceivedForBranch(
                 BranchNameKey.create(project, "master"), cfg))
         .value()
@@ -1193,7 +1195,7 @@
     Config cfg = new Config();
     cfg.setString(
         SECTION_VALIDATION, "refs/heads/*", KEY_ENABLE_VALIDATION_ON_COMMIT_RECEIVED, "false");
-    assertThat(
+    OptionalSubject.assertThat(
             generalConfig.getCodeOwnerConfigValidationPolicyForCommitReceivedForBranch(
                 BranchNameKey.create(project, "master"), cfg))
         .value()
@@ -1209,7 +1211,7 @@
         "^refs/heads/.*bar.*",
         KEY_ENABLE_VALIDATION_ON_COMMIT_RECEIVED,
         "false");
-    assertThat(
+    OptionalSubject.assertThat(
             generalConfig.getCodeOwnerConfigValidationPolicyForCommitReceivedForBranch(
                 BranchNameKey.create(project, "foobarbaz"), cfg))
         .value()
@@ -1225,7 +1227,7 @@
         "refs/heads/master",
         KEY_ENABLE_VALIDATION_ON_COMMIT_RECEIVED,
         "INVALID");
-    assertThat(
+    OptionalSubject.assertThat(
             generalConfig.getCodeOwnerConfigValidationPolicyForCommitReceivedForBranch(
                 BranchNameKey.create(project, "master"), cfg))
         .isEmpty();
@@ -1244,7 +1246,7 @@
 
     // it is non-deterministic which of the branch-specific configurations takes precedence, but
     // since they all configure the same value it's not important for this assertion
-    assertThat(
+    OptionalSubject.assertThat(
             generalConfig.getCodeOwnerConfigValidationPolicyForCommitReceivedForBranch(
                 BranchNameKey.create(project, "master"), cfg))
         .value()
@@ -1343,7 +1345,7 @@
 
   @Test
   public void noBranchSpecificEnableValidationOnSubmitConfiguration() throws Exception {
-    assertThat(
+    OptionalSubject.assertThat(
             generalConfig.getCodeOwnerConfigValidationPolicyForSubmitForBranch(
                 BranchNameKey.create(project, "master"), new Config()))
         .isEmpty();
@@ -1354,7 +1356,7 @@
       throws Exception {
     Config cfg = new Config();
     cfg.setString(SECTION_VALIDATION, "refs/heads/foo", KEY_ENABLE_VALIDATION_ON_SUBMIT, "false");
-    assertThat(
+    OptionalSubject.assertThat(
             generalConfig.getCodeOwnerConfigValidationPolicyForSubmitForBranch(
                 BranchNameKey.create(project, "master"), cfg))
         .isEmpty();
@@ -1365,7 +1367,7 @@
       throws Exception {
     Config cfg = new Config();
     cfg.setString(SECTION_VALIDATION, "refs/heads/foo/*", KEY_ENABLE_VALIDATION_ON_SUBMIT, "false");
-    assertThat(
+    OptionalSubject.assertThat(
             generalConfig.getCodeOwnerConfigValidationPolicyForSubmitForBranch(
                 BranchNameKey.create(project, "master"), cfg))
         .isEmpty();
@@ -1377,7 +1379,7 @@
     Config cfg = new Config();
     cfg.setString(
         SECTION_VALIDATION, "^refs/heads/.*foo.*", KEY_ENABLE_VALIDATION_ON_SUBMIT, "false");
-    assertThat(
+    OptionalSubject.assertThat(
             generalConfig.getCodeOwnerConfigValidationPolicyForCommitReceivedForBranch(
                 BranchNameKey.create(project, "master"), cfg))
         .isEmpty();
@@ -1388,7 +1390,7 @@
       throws Exception {
     Config cfg = new Config();
     cfg.setString(SECTION_VALIDATION, "^refs/heads/[", KEY_ENABLE_VALIDATION_ON_SUBMIT, "false");
-    assertThat(
+    OptionalSubject.assertThat(
             generalConfig.getCodeOwnerConfigValidationPolicyForSubmitForBranch(
                 BranchNameKey.create(project, "master"), cfg))
         .isEmpty();
@@ -1399,7 +1401,7 @@
     Config cfg = new Config();
     cfg.setString(
         SECTION_VALIDATION, "refs/heads/master", KEY_ENABLE_VALIDATION_ON_SUBMIT, "false");
-    assertThat(
+    OptionalSubject.assertThat(
             generalConfig.getCodeOwnerConfigValidationPolicyForSubmitForBranch(
                 BranchNameKey.create(project, "master"), cfg))
         .value()
@@ -1411,7 +1413,7 @@
       throws Exception {
     Config cfg = new Config();
     cfg.setString(SECTION_VALIDATION, "refs/heads/*", KEY_ENABLE_VALIDATION_ON_SUBMIT, "false");
-    assertThat(
+    OptionalSubject.assertThat(
             generalConfig.getCodeOwnerConfigValidationPolicyForSubmitForBranch(
                 BranchNameKey.create(project, "master"), cfg))
         .value()
@@ -1423,7 +1425,7 @@
     Config cfg = new Config();
     cfg.setString(
         SECTION_VALIDATION, "^refs/heads/.*bar.*", KEY_ENABLE_VALIDATION_ON_SUBMIT, "false");
-    assertThat(
+    OptionalSubject.assertThat(
             generalConfig.getCodeOwnerConfigValidationPolicyForSubmitForBranch(
                 BranchNameKey.create(project, "foobarbaz"), cfg))
         .value()
@@ -1436,7 +1438,7 @@
     Config cfg = new Config();
     cfg.setString(
         SECTION_VALIDATION, "refs/heads/master", KEY_ENABLE_VALIDATION_ON_SUBMIT, "INVALID");
-    assertThat(
+    OptionalSubject.assertThat(
             generalConfig.getCodeOwnerConfigValidationPolicyForSubmitForBranch(
                 BranchNameKey.create(project, "master"), cfg))
         .isEmpty();
@@ -1453,7 +1455,7 @@
 
     // it is non-deterministic which of the branch-specific configurations takes precedence, but
     // since they all configure the same value it's not important for this assertion
-    assertThat(
+    OptionalSubject.assertThat(
             generalConfig.getCodeOwnerConfigValidationPolicyForSubmitForBranch(
                 BranchNameKey.create(project, "master"), cfg))
         .value()
@@ -1856,14 +1858,14 @@
 
   @Test
   public void noOverrideInfoUrlConfigured() throws Exception {
-    assertThat(generalConfig.getOverrideInfoUrl(new Config())).isEmpty();
+    OptionalSubject.assertThat(generalConfig.getOverrideInfoUrl(new Config())).isEmpty();
   }
 
   @Test
   @GerritConfig(name = "plugin.code-owners.overrideInfoUrl", value = "http://foo.example.com")
   public void overrideInfoIsRetrievedFromGerritConfigIfNotSpecifiedOnProjectLevel()
       throws Exception {
-    assertThat(generalConfig.getOverrideInfoUrl(new Config()))
+    OptionalSubject.assertThat(generalConfig.getOverrideInfoUrl(new Config()))
         .value()
         .isEqualTo("http://foo.example.com");
   }
@@ -1878,7 +1880,9 @@
         /* subsection= */ null,
         KEY_OVERRIDE_INFO_URL,
         "http://bar.example.com");
-    assertThat(generalConfig.getOverrideInfoUrl(cfg)).value().isEqualTo("http://bar.example.com");
+    OptionalSubject.assertThat(generalConfig.getOverrideInfoUrl(cfg))
+        .value()
+        .isEqualTo("http://bar.example.com");
   }
 
   @Test
@@ -1892,7 +1896,8 @@
 
   @Test
   public void noInvalidCodeOwnerConfigInfoUrlConfigured() throws Exception {
-    assertThat(generalConfig.getInvalidCodeOwnerConfigInfoUrl(new Config())).isEmpty();
+    OptionalSubject.assertThat(generalConfig.getInvalidCodeOwnerConfigInfoUrl(new Config()))
+        .isEmpty();
   }
 
   @Test
@@ -1901,7 +1906,7 @@
       value = "http://foo.example.com")
   public void invalidCodeOwnerConfigInfoIsRetrievedFromGerritConfigIfNotSpecifiedOnProjectLevel()
       throws Exception {
-    assertThat(generalConfig.getInvalidCodeOwnerConfigInfoUrl(new Config()))
+    OptionalSubject.assertThat(generalConfig.getInvalidCodeOwnerConfigInfoUrl(new Config()))
         .value()
         .isEqualTo("http://foo.example.com");
   }
@@ -1918,7 +1923,7 @@
         /* subsection= */ null,
         KEY_INVALID_CODE_OWNER_CONFIG_INFO_URL,
         "http://bar.example.com");
-    assertThat(generalConfig.getInvalidCodeOwnerConfigInfoUrl(cfg))
+    OptionalSubject.assertThat(generalConfig.getInvalidCodeOwnerConfigInfoUrl(cfg))
         .value()
         .isEqualTo("http://bar.example.com");
   }