Migrate users from the old, deprecated Subject.fail* methods to the new Subject.fail* methods or, in some cases, to Subject.check.

Most of the changes in this CL were made manually.

I've tried to preserve all information (and of course behavior!), but the format and grammar of the messages does change. For example before-and-after messages, see the LSC doc.

In some of the CLs in this round (e.g., jscomp), I don't know a lot about the domain being tested, and the assertions are complex, so please let me know if my new phrasing is wrong or confusing.

Thanks again for your patience with all the Truth changes lately.

END_PUBLIC

More information:
  []

Tested:
    TAP for global presubmit queue
    []

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=248543745
This commit is contained in:
cpovirk 2019-05-16 09:41:11 -07:00 committed by jianglai
parent 210c08cbb9
commit 37f1734ee2
5 changed files with 43 additions and 86 deletions

View file

@ -26,7 +26,6 @@ import google.registry.model.domain.launch.LaunchNotice;
import google.registry.model.domain.secdns.DelegationSignerData;
import google.registry.model.eppcommon.AuthInfo;
import google.registry.testing.TruthChainer.And;
import java.util.Objects;
import java.util.Set;
import org.joda.time.DateTime;
@ -74,19 +73,17 @@ public final class DomainBaseSubject
}
public And<DomainBaseSubject> hasRegistrationExpirationTime(DateTime expiration) {
if (!Objects.equals(actual.getRegistrationExpirationTime(), expiration)) {
failWithBadResults(
"has registrationExpirationTime", expiration, actual.getRegistrationExpirationTime());
}
return andChainer();
return hasValue(
expiration, actual.getRegistrationExpirationTime(), "getRegistrationExpirationTime()");
}
public And<DomainBaseSubject> hasLastTransferTime(DateTime lastTransferTime) {
return hasValue(lastTransferTime, actual.getLastTransferTime(), "has lastTransferTime");
return hasValue(lastTransferTime, actual.getLastTransferTime(), "getLastTransferTime()");
}
public And<DomainBaseSubject> hasLastTransferTimeNotEqualTo(DateTime lastTransferTime) {
return doesNotHaveValue(lastTransferTime, actual.getLastTransferTime(), "lastTransferTime");
return doesNotHaveValue(
lastTransferTime, actual.getLastTransferTime(), "getLastTransferTime()");
}
public And<DomainBaseSubject> hasDeletePollMessage() {
@ -104,7 +101,7 @@ public final class DomainBaseSubject
}
public And<DomainBaseSubject> hasSmdId(String smdId) {
return hasValue(smdId, actual.getSmdId(), "has smdId");
return hasValue(smdId, actual.getSmdId(), "getSmdId()");
}
public static SimpleSubjectBuilder<DomainBaseSubject, DomainBase> assertAboutDomains() {