Migrate from old *Verb* classes to new *SubjectBuilder* classes

This migration does not change any behavior.

More information: []

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=168248439
This commit is contained in:
jijiang 2017-09-11 10:26:13 -07:00 committed by jianglai
parent 985d14b51f
commit 211d89695a
9 changed files with 22 additions and 19 deletions

View file

@ -1134,10 +1134,10 @@ def com_google_re2j():
def com_google_truth(): def com_google_truth():
java_import_external( java_import_external(
name = "com_google_truth", name = "com_google_truth",
jar_sha256 = "772bfaccd05b9203f929536def0b4157094130629bc105d555bef8eacc3c1675", jar_sha256 = "e087f1a50e40e8aae1f0cdb7f031684a84e7dd7ca224a4b5be53caeacf0f0324",
jar_urls = [ jar_urls = [
"http://domain-registry-maven.storage.googleapis.com/repo1.maven.org/maven2/com/google/truth/truth/0.34/truth-0.34.jar", "http://domain-registry-maven.storage.googleapis.com/repo1.maven.org/maven2/com/google/truth/truth/0.35/truth-0.35.jar",
"http://repo1.maven.org/maven2/com/google/truth/truth/0.34/truth-0.34.jar", "http://repo1.maven.org/maven2/com/google/truth/truth/0.35/truth-0.35.jar",
], ],
licenses = ["notice"], # The Apache Software License, Version 2.0 licenses = ["notice"], # The Apache Software License, Version 2.0
testonly_ = True, testonly_ = True,

View file

@ -17,8 +17,8 @@ package google.registry.testing;
import static com.google.common.base.Preconditions.checkNotNull; import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.truth.Truth.assertAbout; import static com.google.common.truth.Truth.assertAbout;
import com.google.common.truth.AbstractVerb.DelegatedVerb;
import com.google.common.truth.FailureStrategy; import com.google.common.truth.FailureStrategy;
import com.google.common.truth.SimpleSubjectBuilder;
import google.registry.model.contact.ContactResource; import google.registry.model.contact.ContactResource;
import google.registry.model.contact.PostalInfo; import google.registry.model.contact.PostalInfo;
import google.registry.model.eppcommon.AuthInfo; import google.registry.model.eppcommon.AuthInfo;
@ -183,7 +183,8 @@ public final class ContactResourceSubject
"has currentSponsorClientId"); "has currentSponsorClientId");
} }
public static DelegatedVerb<ContactResourceSubject, ContactResource> assertAboutContacts() { public static SimpleSubjectBuilder<ContactResourceSubject, ContactResource>
assertAboutContacts() {
return assertAbout(new SubjectFactory()); return assertAbout(new SubjectFactory());
} }
} }

View file

@ -19,8 +19,8 @@ import static com.google.common.truth.Truth.assertAbout;
import static com.google.common.truth.Truth.assertThat; import static com.google.common.truth.Truth.assertThat;
import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableSet;
import com.google.common.truth.AbstractVerb.DelegatedVerb;
import com.google.common.truth.FailureStrategy; import com.google.common.truth.FailureStrategy;
import com.google.common.truth.SimpleSubjectBuilder;
import google.registry.model.domain.DomainApplication; import google.registry.model.domain.DomainApplication;
import google.registry.model.domain.Period; import google.registry.model.domain.Period;
import google.registry.model.domain.launch.ApplicationStatus; import google.registry.model.domain.launch.ApplicationStatus;
@ -84,7 +84,7 @@ public final class DomainApplicationSubject
super(strategy, checkNotNull(subject)); super(strategy, checkNotNull(subject));
} }
public static DelegatedVerb<DomainApplicationSubject, DomainApplication> public static SimpleSubjectBuilder<DomainApplicationSubject, DomainApplication>
assertAboutApplications() { assertAboutApplications() {
return assertAbout(new SubjectFactory()); return assertAbout(new SubjectFactory());
} }

View file

@ -17,8 +17,8 @@ package google.registry.testing;
import static com.google.common.base.Preconditions.checkNotNull; import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.truth.Truth.assertAbout; import static com.google.common.truth.Truth.assertAbout;
import com.google.common.truth.AbstractVerb.DelegatedVerb;
import com.google.common.truth.FailureStrategy; import com.google.common.truth.FailureStrategy;
import com.google.common.truth.SimpleSubjectBuilder;
import google.registry.model.domain.DomainResource; import google.registry.model.domain.DomainResource;
import google.registry.model.transfer.TransferStatus; import google.registry.model.transfer.TransferStatus;
import google.registry.testing.TruthChainer.And; import google.registry.testing.TruthChainer.And;
@ -115,7 +115,7 @@ public final class DomainResourceSubject
super(strategy, checkNotNull(subject)); super(strategy, checkNotNull(subject));
} }
public static DelegatedVerb<DomainResourceSubject, DomainResource> assertAboutDomains() { public static SimpleSubjectBuilder<DomainResourceSubject, DomainResource> assertAboutDomains() {
return assertAbout(new SubjectFactory()); return assertAbout(new SubjectFactory());
} }
} }

View file

@ -18,8 +18,8 @@ import static com.google.common.truth.Truth.assertAbout;
import static com.google.common.truth.Truth.assertThat; import static com.google.common.truth.Truth.assertThat;
import static google.registry.flows.EppXmlTransformer.marshal; import static google.registry.flows.EppXmlTransformer.marshal;
import com.google.common.truth.AbstractVerb.DelegatedVerb;
import com.google.common.truth.FailureStrategy; import com.google.common.truth.FailureStrategy;
import com.google.common.truth.SimpleSubjectBuilder;
import com.google.common.truth.Subject; import com.google.common.truth.Subject;
import com.google.common.truth.SubjectFactory; import com.google.common.truth.SubjectFactory;
import google.registry.flows.EppException; import google.registry.flows.EppException;
@ -57,7 +57,7 @@ public class EppExceptionSubject extends Subject<EppExceptionSubject, EppExcepti
return new And<>(this); return new And<>(this);
} }
public static DelegatedVerb<EppExceptionSubject, EppException> assertAboutEppExceptions() { public static SimpleSubjectBuilder<EppExceptionSubject, EppException> assertAboutEppExceptions() {
return assertAbout(new SubjectFactory<EppExceptionSubject, EppException>() { return assertAbout(new SubjectFactory<EppExceptionSubject, EppException>() {
@Override @Override
public EppExceptionSubject getSubject(FailureStrategy strategy, EppException subject) { public EppExceptionSubject getSubject(FailureStrategy strategy, EppException subject) {

View file

@ -17,8 +17,8 @@ package google.registry.testing;
import static com.google.common.base.Preconditions.checkNotNull; import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.truth.Truth.assertAbout; import static com.google.common.truth.Truth.assertAbout;
import com.google.common.truth.AbstractVerb.DelegatedVerb;
import com.google.common.truth.FailureStrategy; import com.google.common.truth.FailureStrategy;
import com.google.common.truth.SimpleSubjectBuilder;
import com.google.common.truth.SubjectFactory; import com.google.common.truth.SubjectFactory;
import google.registry.model.EppResource; import google.registry.model.EppResource;
@ -39,7 +39,8 @@ public final class GenericEppResourceSubject
super(strategy, checkNotNull(subject)); super(strategy, checkNotNull(subject));
} }
public static DelegatedVerb<GenericEppResourceSubject, EppResource> assertAboutEppResources() { public static SimpleSubjectBuilder<GenericEppResourceSubject, EppResource>
assertAboutEppResources() {
return assertAbout(new GenericEppResourceSubjectFactory()); return assertAbout(new GenericEppResourceSubjectFactory());
} }
} }

View file

@ -17,8 +17,8 @@ package google.registry.testing;
import static com.google.common.truth.Truth.assertAbout; import static com.google.common.truth.Truth.assertAbout;
import com.google.common.base.Optional; import com.google.common.base.Optional;
import com.google.common.truth.AbstractVerb.DelegatedVerb;
import com.google.common.truth.FailureStrategy; import com.google.common.truth.FailureStrategy;
import com.google.common.truth.SimpleSubjectBuilder;
import com.google.common.truth.Subject; import com.google.common.truth.Subject;
import google.registry.model.domain.Period; import google.registry.model.domain.Period;
import google.registry.model.reporting.HistoryEntry; import google.registry.model.reporting.HistoryEntry;
@ -103,7 +103,8 @@ public class HistoryEntrySubject extends Subject<HistoryEntrySubject, HistoryEnt
return new And<>(this); return new And<>(this);
} }
public static DelegatedVerb<HistoryEntrySubject, HistoryEntry> assertAboutHistoryEntries() { public static SimpleSubjectBuilder<HistoryEntrySubject, HistoryEntry>
assertAboutHistoryEntries() {
return assertAbout(new SubjectFactory()); return assertAbout(new SubjectFactory());
} }
} }

View file

@ -17,8 +17,8 @@ package google.registry.testing;
import static com.google.common.base.Preconditions.checkNotNull; import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.truth.Truth.assertAbout; import static com.google.common.truth.Truth.assertAbout;
import com.google.common.truth.AbstractVerb.DelegatedVerb;
import com.google.common.truth.FailureStrategy; import com.google.common.truth.FailureStrategy;
import com.google.common.truth.SimpleSubjectBuilder;
import com.googlecode.objectify.Key; import com.googlecode.objectify.Key;
import google.registry.model.domain.DomainResource; import google.registry.model.domain.DomainResource;
import google.registry.model.host.HostResource; import google.registry.model.host.HostResource;
@ -37,7 +37,7 @@ public final class HostResourceSubject
super(strategy, checkNotNull(subject)); super(strategy, checkNotNull(subject));
} }
public static DelegatedVerb<HostResourceSubject, HostResource> assertAboutHosts() { public static SimpleSubjectBuilder<HostResourceSubject, HostResource> assertAboutHosts() {
return assertAbout(new SubjectFactory()); return assertAbout(new SubjectFactory());
} }

View file

@ -19,9 +19,9 @@ import static com.google.common.truth.Truth.assertThat;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
import com.google.common.testing.TestLogHandler; import com.google.common.testing.TestLogHandler;
import com.google.common.truth.AbstractVerb.DelegatedVerb;
import com.google.common.truth.Correspondence; import com.google.common.truth.Correspondence;
import com.google.common.truth.FailureStrategy; import com.google.common.truth.FailureStrategy;
import com.google.common.truth.SimpleSubjectBuilder;
import com.google.common.truth.StringSubject; import com.google.common.truth.StringSubject;
import com.google.common.truth.Subject; import com.google.common.truth.Subject;
import google.registry.testing.TruthChainer.Which; import google.registry.testing.TruthChainer.Which;
@ -87,7 +87,7 @@ public class LogsSubject extends Subject<LogsSubject, TestLogHandler> {
throw new AssertionError("Message check passed yet matching message not found"); throw new AssertionError("Message check passed yet matching message not found");
} }
public static DelegatedVerb<LogsSubject, TestLogHandler> assertAboutLogs() { public static SimpleSubjectBuilder<LogsSubject, TestLogHandler> assertAboutLogs() {
return assertAbout(new SubjectFactory()); return assertAbout(new SubjectFactory());
} }
} }