Improve handling of lastSubordinateChange and beef up tests

See [] for the comments that led to this.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=147796087
This commit is contained in:
cgoldfeder 2017-02-16 18:54:16 -08:00 committed by Ben McIlwain
parent be30ecdf66
commit c23bbe35bb
5 changed files with 159 additions and 124 deletions

View file

@ -19,6 +19,8 @@ import static com.google.common.truth.Truth.assertAbout;
import com.google.common.truth.AbstractVerb.DelegatedVerb;
import com.google.common.truth.FailureStrategy;
import com.googlecode.objectify.Key;
import google.registry.model.domain.DomainResource;
import google.registry.model.host.HostResource;
import google.registry.testing.TruthChainer.And;
import org.joda.time.DateTime;
@ -52,4 +54,18 @@ public final class HostResourceSubject
actual().getLastTransferTime(),
"lastTransferTime");
}
public And<HostResourceSubject> hasLastSuperordinateChange(DateTime lastSuperordinateChange) {
return hasValue(
lastSuperordinateChange,
actual().getLastSuperordinateChange(),
"has lastSuperordinateChange");
}
public And<HostResourceSubject> hasSuperordinateDomain(Key<DomainResource> superordinateDomain) {
return hasValue(
superordinateDomain,
actual().getSuperordinateDomain(),
"has superordinateDomain");
}
}