Remove unused methods from Subject classes Signed-off-by: Edwin Kempin <ekempin@google.com> Change-Id: I273fb5d2cf63336286d02069e7a9a727be640663
diff --git a/java/com/google/gerrit/plugins/codeowners/testing/CodeOwnerInfoSubject.java b/java/com/google/gerrit/plugins/codeowners/testing/CodeOwnerInfoSubject.java index 29df00b..33a19aa 100644 --- a/java/com/google/gerrit/plugins/codeowners/testing/CodeOwnerInfoSubject.java +++ b/java/com/google/gerrit/plugins/codeowners/testing/CodeOwnerInfoSubject.java
@@ -14,8 +14,6 @@ package com.google.gerrit.plugins.codeowners.testing; -import static com.google.common.truth.Truth.assertAbout; - import com.google.common.truth.ComparableSubject; import com.google.common.truth.Correspondence; import com.google.common.truth.FailureMetadata; @@ -23,9 +21,7 @@ import com.google.common.truth.Subject; import com.google.gerrit.entities.Account; import com.google.gerrit.plugins.codeowners.api.CodeOwnerInfo; -import com.google.gerrit.truth.ListSubject; import com.google.gerrit.truth.NullAwareCorrespondence; -import java.util.List; /** {@link Subject} for doing assertions on {@link CodeOwnerInfo}s. */ public class CodeOwnerInfoSubject extends Subject { @@ -44,21 +40,6 @@ codeOwnerInfo -> codeOwnerInfo.account.name, "has account name"); } - /** - * Starts fluent chain to do assertions on a {@link CodeOwnerInfo}. - * - * @param codeOwnerInfo the code owner info on which assertions should be done - * @return the created {@link CodeOwnerInfoSubject} - */ - public static CodeOwnerInfoSubject assertThat(CodeOwnerInfo codeOwnerInfo) { - return assertAbout(codeOwnerInfos()).that(codeOwnerInfo); - } - - public static ListSubject<CodeOwnerInfoSubject, CodeOwnerInfo> assertThatList( - List<CodeOwnerInfo> codeOwnerInfos) { - return ListSubject.assertThat(codeOwnerInfos, codeOwnerInfos()); - } - public static Factory<CodeOwnerInfoSubject, CodeOwnerInfo> codeOwnerInfos() { return CodeOwnerInfoSubject::new; }
diff --git a/java/com/google/gerrit/plugins/codeowners/testing/CodeOwnerSubject.java b/java/com/google/gerrit/plugins/codeowners/testing/CodeOwnerSubject.java index 49852bb..5e46c2c 100644 --- a/java/com/google/gerrit/plugins/codeowners/testing/CodeOwnerSubject.java +++ b/java/com/google/gerrit/plugins/codeowners/testing/CodeOwnerSubject.java
@@ -14,32 +14,19 @@ package com.google.gerrit.plugins.codeowners.testing; -import static com.google.common.collect.ImmutableList.toImmutableList; import static com.google.common.truth.Truth.assertAbout; import com.google.common.truth.ComparableSubject; -import com.google.common.truth.Correspondence; import com.google.common.truth.FailureMetadata; import com.google.common.truth.Subject; import com.google.gerrit.entities.Account; import com.google.gerrit.plugins.codeowners.backend.CodeOwner; -import com.google.gerrit.truth.ListSubject; -import com.google.gerrit.truth.NullAwareCorrespondence; import com.google.gerrit.truth.OptionalSubject; import java.util.Optional; -import java.util.stream.Stream; /** {@link Subject} for doing assertions on {@link CodeOwner}s. */ public class CodeOwnerSubject extends Subject { /** - * Constructs a {@link Correspondence} that maps {@link CodeOwner}s to {@link - * com.google.gerrit.entities.Account.Id}s. - */ - public static final Correspondence<CodeOwner, Account.Id> hasAccountId() { - return NullAwareCorrespondence.transforming(CodeOwner::accountId, "has account ID"); - } - - /** * Starts fluent chain to do assertions on a {@link CodeOwner}. * * @param codeOwner the code owner on which assertions should be done @@ -60,16 +47,6 @@ return OptionalSubject.assertThat(codeOwner, codeOwners()); } - /** - * Starts fluent chain to do assertions on a stream of {@link CodeOwner}s. - * - * @param codeOwners stream of code owners on which assertions should be done - * @return the created {@link ListSubject} - */ - public static ListSubject<CodeOwnerSubject, CodeOwner> assertThat(Stream<CodeOwner> codeOwners) { - return ListSubject.assertThat(codeOwners.collect(toImmutableList()), codeOwners()); - } - /** Creates subject factory for mapping {@link CodeOwner}s to {@link CodeOwnerSubject}s. */ private static Subject.Factory<CodeOwnerSubject, CodeOwner> codeOwners() { return CodeOwnerSubject::new;
diff --git a/java/com/google/gerrit/plugins/codeowners/testing/OptionalResultWithMessagesSubject.java b/java/com/google/gerrit/plugins/codeowners/testing/OptionalResultWithMessagesSubject.java index a0a9082..8d46152 100644 --- a/java/com/google/gerrit/plugins/codeowners/testing/OptionalResultWithMessagesSubject.java +++ b/java/com/google/gerrit/plugins/codeowners/testing/OptionalResultWithMessagesSubject.java
@@ -53,10 +53,6 @@ this.optionalResultWithMessages = optionalResultWithMessages; } - public void isPresent() { - check("result()").about(optionals()).that(optionalResultWithMessages().result()).isPresent(); - } - public void isEmpty() { check("result()").about(optionals()).that(optionalResultWithMessages().result()).isEmpty(); }
diff --git a/java/com/google/gerrit/plugins/codeowners/testing/PathCodeOwnerStatusSubject.java b/java/com/google/gerrit/plugins/codeowners/testing/PathCodeOwnerStatusSubject.java index a99c0e6..5e2f58c 100644 --- a/java/com/google/gerrit/plugins/codeowners/testing/PathCodeOwnerStatusSubject.java +++ b/java/com/google/gerrit/plugins/codeowners/testing/PathCodeOwnerStatusSubject.java
@@ -15,7 +15,6 @@ package com.google.gerrit.plugins.codeowners.testing; import static com.google.common.truth.PathSubject.paths; -import static com.google.common.truth.Truth.assertAbout; import com.google.common.truth.ComparableSubject; import com.google.common.truth.FailureMetadata; @@ -27,16 +26,6 @@ /** {@link Subject} for doing assertions on {@link PathCodeOwnerStatus}s. */ public class PathCodeOwnerStatusSubject extends Subject { /** - * Starts fluent chain to do assertions on a {@link PathCodeOwnerStatus}. - * - * @param pathCodeOwnerStatus the {@link PathCodeOwnerStatus} on which assertions should be done - * @return the created {@link PathCodeOwnerStatusSubject} - */ - public static PathCodeOwnerStatusSubject assertThat(PathCodeOwnerStatus pathCodeOwnerStatus) { - return assertAbout(pathCodeOwnerStatuses()).that(pathCodeOwnerStatus); - } - - /** * Creates subject factory for mapping {@link PathCodeOwnerStatus}es to {@link * PathCodeOwnerStatusSubject}s. */
diff --git a/java/com/google/gerrit/plugins/codeowners/testing/RequiredApprovalSubject.java b/java/com/google/gerrit/plugins/codeowners/testing/RequiredApprovalSubject.java index e869632..9e17d9a 100644 --- a/java/com/google/gerrit/plugins/codeowners/testing/RequiredApprovalSubject.java +++ b/java/com/google/gerrit/plugins/codeowners/testing/RequiredApprovalSubject.java
@@ -24,8 +24,6 @@ import com.google.common.truth.Subject; import com.google.gerrit.plugins.codeowners.backend.config.RequiredApproval; import com.google.gerrit.truth.ListSubject; -import com.google.gerrit.truth.OptionalSubject; -import java.util.Optional; /** {@link Subject} for doing assertions on {@link RequiredApproval}s. */ public class RequiredApprovalSubject extends Subject { @@ -40,17 +38,6 @@ } /** - * Starts a fluent chain to do assertions on an {@link Optional} {@link RequiredApproval}. - * - * @param requiredApproval optional required approval on which assertions should be done - * @return the created {@link OptionalSubject} - */ - public static OptionalSubject<RequiredApprovalSubject, RequiredApproval> assertThat( - Optional<RequiredApproval> requiredApproval) { - return OptionalSubject.assertThat(requiredApproval, requiredApprovals()); - } - - /** * Starts a fluent chain to do assertions on a list of {@link RequiredApproval}s. * * @param requiredApprovals list of required approvals on which assertions should be done
diff --git a/java/com/google/gerrit/plugins/codeowners/testing/SubmitRecordSubject.java b/java/com/google/gerrit/plugins/codeowners/testing/SubmitRecordSubject.java index 301fc1d..7b45e8b 100644 --- a/java/com/google/gerrit/plugins/codeowners/testing/SubmitRecordSubject.java +++ b/java/com/google/gerrit/plugins/codeowners/testing/SubmitRecordSubject.java
@@ -14,7 +14,6 @@ package com.google.gerrit.plugins.codeowners.testing; -import static com.google.common.truth.Truth.assertAbout; import static com.google.gerrit.plugins.codeowners.testing.SubmitRequirementSubject.submitRecordRequirements; import static com.google.gerrit.truth.ListSubject.elements; @@ -30,16 +29,6 @@ /** {@link Subject} for doing assertions on {@link SubmitRecord}s. */ public class SubmitRecordSubject extends Subject { /** - * Starts fluent chain to do assertions on a {@link SubmitRecord}. - * - * @param submitRecord the {@link SubmitRecord} on which assertions should be done - * @return the created {@link SubmitRecordSubject} - */ - public static SubmitRecordSubject assertThat(SubmitRecord submitRecord) { - return assertAbout(submitRecords()).that(submitRecord); - } - - /** * Starts fluent chain to do assertions on an {@link Optional} {@link SubmitRecord}. * * @param submitRecord the {@link SubmitRecord} {@link Optional} on which assertions should be