mirror of
https://github.com/google/nomulus.git
synced 2025-05-13 07:57:13 +02:00
Scope down lastTransferTime to only ContactResource, DomainResource
and HostResource. DomainApplication is not transferable and has no need for this field. HostResource needs it because it can be transferred with a domain. This is all in service of removing the ofy().load() inside of host's cloneProjectedAtTime. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=139346925
This commit is contained in:
parent
5368489987
commit
fdc8ceb6bb
15 changed files with 121 additions and 56 deletions
|
@ -255,13 +255,15 @@ public final class ResourceFlowUtils {
|
||||||
* including the extended registration years field, and sets the expiration time of the last
|
* including the extended registration years field, and sets the expiration time of the last
|
||||||
* pending transfer to now.
|
* pending transfer to now.
|
||||||
*/
|
*/
|
||||||
public static <R extends EppResource & ResourceWithTransferData> R approvePendingTransfer(
|
public static <
|
||||||
R resource, TransferStatus transferStatus, DateTime now) {
|
R extends EppResource & ResourceWithTransferData,
|
||||||
Builder<R, ?> builder = resolvePendingTransfer(resource, transferStatus, now);
|
B extends Builder<R, B> & BuilderWithTransferData<B>>
|
||||||
builder
|
R approvePendingTransfer(R resource, TransferStatus transferStatus, DateTime now) {
|
||||||
|
B builder = resolvePendingTransfer(resource, transferStatus, now);
|
||||||
|
return builder
|
||||||
.setLastTransferTime(now)
|
.setLastTransferTime(now)
|
||||||
.setCurrentSponsorClientId(resource.getTransferData().getGainingClientId());
|
.setCurrentSponsorClientId(resource.getTransferData().getGainingClientId())
|
||||||
return builder.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -105,15 +105,6 @@ public abstract class EppResource extends BackupGroupRoot implements Buildable,
|
||||||
@XmlElement(name = "upDate")
|
@XmlElement(name = "upDate")
|
||||||
DateTime lastEppUpdateTime;
|
DateTime lastEppUpdateTime;
|
||||||
|
|
||||||
/**
|
|
||||||
* The time that this resource was last transferred.
|
|
||||||
*
|
|
||||||
* <p>Can be null if the resource has never been transferred.
|
|
||||||
*/
|
|
||||||
// Map the method to XML, not the field, so subclasses can override it.
|
|
||||||
@XmlTransient
|
|
||||||
DateTime lastTransferTime;
|
|
||||||
|
|
||||||
/** Status values associated with this resource. */
|
/** Status values associated with this resource. */
|
||||||
Set<StatusValue> status;
|
Set<StatusValue> status;
|
||||||
|
|
||||||
|
@ -157,11 +148,6 @@ public abstract class EppResource extends BackupGroupRoot implements Buildable,
|
||||||
return nullToEmptyImmutableCopy(status);
|
return nullToEmptyImmutableCopy(status);
|
||||||
}
|
}
|
||||||
|
|
||||||
@XmlElement(name = "trDate")
|
|
||||||
public DateTime getLastTransferTime() {
|
|
||||||
return lastTransferTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public final DateTime getDeletionTime() {
|
public final DateTime getDeletionTime() {
|
||||||
return deletionTime;
|
return deletionTime;
|
||||||
}
|
}
|
||||||
|
@ -186,11 +172,21 @@ public abstract class EppResource extends BackupGroupRoot implements Buildable,
|
||||||
/** An interface for resources that have transfer data. */
|
/** An interface for resources that have transfer data. */
|
||||||
public interface ResourceWithTransferData {
|
public interface ResourceWithTransferData {
|
||||||
public TransferData getTransferData();
|
public TransferData getTransferData();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The time that this resource was last transferred.
|
||||||
|
*
|
||||||
|
* <p>Can be null if the resource has never been transferred.
|
||||||
|
*/
|
||||||
|
public DateTime getLastTransferTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** An interface for builders of resources that have transfer data. */
|
/** An interface for builders of resources that have transfer data. */
|
||||||
public interface BuilderWithTransferData<B extends BuilderWithTransferData<B>> {
|
public interface BuilderWithTransferData<B extends BuilderWithTransferData<B>> {
|
||||||
public B setTransferData(TransferData transferData);
|
public B setTransferData(TransferData transferData);
|
||||||
|
|
||||||
|
/** Set the time when this resource was transferred. */
|
||||||
|
public B setLastTransferTime(DateTime lastTransferTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Abstract builder for {@link EppResource} types. */
|
/** Abstract builder for {@link EppResource} types. */
|
||||||
|
@ -255,12 +251,6 @@ public abstract class EppResource extends BackupGroupRoot implements Buildable,
|
||||||
return thisCastToDerived();
|
return thisCastToDerived();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Set the time when this resource was transferred. */
|
|
||||||
public B setLastTransferTime(DateTime lastTransferTime) {
|
|
||||||
getInstance().lastTransferTime = lastTransferTime;
|
|
||||||
return thisCastToDerived();
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Set this resource's status values. */
|
/** Set this resource's status values. */
|
||||||
public B setStatusValues(ImmutableSet<StatusValue> statusValues) {
|
public B setStatusValues(ImmutableSet<StatusValue> statusValues) {
|
||||||
getInstance().status = statusValues;
|
getInstance().status = statusValues;
|
||||||
|
|
|
@ -125,6 +125,14 @@ public class ContactResource extends EppResource
|
||||||
@XmlTransient
|
@XmlTransient
|
||||||
TransferData transferData;
|
TransferData transferData;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The time that this resource was last transferred.
|
||||||
|
*
|
||||||
|
* <p>Can be null if the resource has never been transferred.
|
||||||
|
*/
|
||||||
|
@XmlElement(name = "trDate")
|
||||||
|
DateTime lastTransferTime;
|
||||||
|
|
||||||
// If any new fields are added which contain personal information, make sure they are cleared by
|
// If any new fields are added which contain personal information, make sure they are cleared by
|
||||||
// the wipeOut() function, so that data is not kept around for deleted contacts.
|
// the wipeOut() function, so that data is not kept around for deleted contacts.
|
||||||
|
|
||||||
|
@ -170,6 +178,11 @@ public class ContactResource extends EppResource
|
||||||
return Optional.fromNullable(transferData).or(TransferData.EMPTY);
|
return Optional.fromNullable(transferData).or(TransferData.EMPTY);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public DateTime getLastTransferTime() {
|
||||||
|
return lastTransferTime;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getForeignKey() {
|
public String getForeignKey() {
|
||||||
return contactId;
|
return contactId;
|
||||||
|
@ -275,6 +288,12 @@ public class ContactResource extends EppResource
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Builder setLastTransferTime(DateTime lastTransferTime) {
|
||||||
|
getInstance().lastTransferTime = lastTransferTime;
|
||||||
|
return thisCastToDerived();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Remove all personally identifying information about a contact.
|
* Remove all personally identifying information about a contact.
|
||||||
*
|
*
|
||||||
|
|
|
@ -185,13 +185,6 @@ public class DomainApplication extends DomainBase {
|
||||||
return auctionPrice;
|
return auctionPrice;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Domain applications don't expose transfer time, so override this and mark it xml transient. */
|
|
||||||
@XmlTransient
|
|
||||||
@Override
|
|
||||||
public final DateTime getLastTransferTime() {
|
|
||||||
return super.getLastTransferTime();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The application id is the repoId.
|
* The application id is the repoId.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -162,6 +162,14 @@ public class DomainResource extends DomainBase
|
||||||
@XmlTransient
|
@XmlTransient
|
||||||
TransferData transferData;
|
TransferData transferData;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The time that this resource was last transferred.
|
||||||
|
*
|
||||||
|
* <p>Can be null if the resource has never been transferred.
|
||||||
|
*/
|
||||||
|
@XmlElement(name = "trDate")
|
||||||
|
DateTime lastTransferTime;
|
||||||
|
|
||||||
public ImmutableSet<String> getSubordinateHosts() {
|
public ImmutableSet<String> getSubordinateHosts() {
|
||||||
return nullToEmptyImmutableCopy(subordinateHosts);
|
return nullToEmptyImmutableCopy(subordinateHosts);
|
||||||
}
|
}
|
||||||
|
@ -203,6 +211,11 @@ public class DomainResource extends DomainBase
|
||||||
return Optional.fromNullable(transferData).or(TransferData.EMPTY);
|
return Optional.fromNullable(transferData).or(TransferData.EMPTY);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public DateTime getLastTransferTime() {
|
||||||
|
return lastTransferTime;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getForeignKey() {
|
public String getForeignKey() {
|
||||||
return fullyQualifiedDomainName;
|
return fullyQualifiedDomainName;
|
||||||
|
@ -462,5 +475,12 @@ public class DomainResource extends DomainBase
|
||||||
getInstance().transferData = transferData;
|
getInstance().transferData = transferData;
|
||||||
return thisCastToDerived();
|
return thisCastToDerived();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Builder setLastTransferTime(DateTime lastTransferTime) {
|
||||||
|
getInstance().lastTransferTime = lastTransferTime;
|
||||||
|
return thisCastToDerived();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -92,6 +92,14 @@ public class HostResource extends EppResource implements ForeignKeyedEppResource
|
||||||
@DoNotHydrate
|
@DoNotHydrate
|
||||||
Key<DomainResource> superordinateDomain;
|
Key<DomainResource> superordinateDomain;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The time that this resource was last transferred.
|
||||||
|
*
|
||||||
|
* <p>Can be null if the resource has never been transferred.
|
||||||
|
*/
|
||||||
|
@XmlElement(name = "trDate")
|
||||||
|
DateTime lastTransferTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The most recent time that the superordinate domain was changed, or null if this host is
|
* The most recent time that the superordinate domain was changed, or null if this host is
|
||||||
* external.
|
* external.
|
||||||
|
@ -113,6 +121,10 @@ public class HostResource extends EppResource implements ForeignKeyedEppResource
|
||||||
return nullToEmptyImmutableCopy(inetAddresses);
|
return nullToEmptyImmutableCopy(inetAddresses);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public DateTime getLastTransferTime() {
|
||||||
|
return lastTransferTime;
|
||||||
|
}
|
||||||
|
|
||||||
public DateTime getLastSuperordinateChange() {
|
public DateTime getLastSuperordinateChange() {
|
||||||
return lastSuperordinateChange;
|
return lastSuperordinateChange;
|
||||||
}
|
}
|
||||||
|
@ -198,6 +210,11 @@ public class HostResource extends EppResource implements ForeignKeyedEppResource
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Builder setLastTransferTime(DateTime lastTransferTime) {
|
||||||
|
getInstance().lastTransferTime = lastTransferTime;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public HostResource build() {
|
public HostResource build() {
|
||||||
return super.build();
|
return super.build();
|
||||||
|
|
|
@ -90,7 +90,6 @@ public class DomainApplicationInfoFlowTest
|
||||||
.setLastEppUpdateClientId("NewRegistrar")
|
.setLastEppUpdateClientId("NewRegistrar")
|
||||||
.setCreationTimeForTest(DateTime.parse("1999-04-03T22:00:00.0Z"))
|
.setCreationTimeForTest(DateTime.parse("1999-04-03T22:00:00.0Z"))
|
||||||
.setLastEppUpdateTime(DateTime.parse("1999-12-03T09:00:00.0Z"))
|
.setLastEppUpdateTime(DateTime.parse("1999-12-03T09:00:00.0Z"))
|
||||||
.setLastTransferTime(DateTime.parse("2000-04-08T09:00:00.0Z"))
|
|
||||||
.setRegistrant(Key.create(registrant))
|
.setRegistrant(Key.create(registrant))
|
||||||
.setContacts(ImmutableSet.of(
|
.setContacts(ImmutableSet.of(
|
||||||
DesignatedContact.create(Type.ADMIN, Key.create(contact)),
|
DesignatedContact.create(Type.ADMIN, Key.create(contact)),
|
||||||
|
@ -125,7 +124,6 @@ public class DomainApplicationInfoFlowTest
|
||||||
.setLastEppUpdateClientId("NewRegistrar")
|
.setLastEppUpdateClientId("NewRegistrar")
|
||||||
.setCreationTimeForTest(DateTime.parse("1999-04-03T22:00:00.0Z"))
|
.setCreationTimeForTest(DateTime.parse("1999-04-03T22:00:00.0Z"))
|
||||||
.setLastEppUpdateTime(DateTime.parse("1999-12-03T09:00:00.0Z"))
|
.setLastEppUpdateTime(DateTime.parse("1999-12-03T09:00:00.0Z"))
|
||||||
.setLastTransferTime(DateTime.parse("2000-04-08T09:00:00.0Z"))
|
|
||||||
.setRegistrant(Key.create(registrant))
|
.setRegistrant(Key.create(registrant))
|
||||||
.setContacts(ImmutableSet.of(
|
.setContacts(ImmutableSet.of(
|
||||||
DesignatedContact.create(Type.ADMIN, Key.create(contact)),
|
DesignatedContact.create(Type.ADMIN, Key.create(contact)),
|
||||||
|
|
|
@ -26,7 +26,7 @@ import static google.registry.testing.DatastoreHelper.getOnlyPollMessage;
|
||||||
import static google.registry.testing.DatastoreHelper.getPollMessages;
|
import static google.registry.testing.DatastoreHelper.getPollMessages;
|
||||||
import static google.registry.testing.DatastoreHelper.persistResource;
|
import static google.registry.testing.DatastoreHelper.persistResource;
|
||||||
import static google.registry.testing.DomainResourceSubject.assertAboutDomains;
|
import static google.registry.testing.DomainResourceSubject.assertAboutDomains;
|
||||||
import static google.registry.testing.GenericEppResourceSubject.assertAboutEppResources;
|
import static google.registry.testing.HostResourceSubject.assertAboutHosts;
|
||||||
import static google.registry.util.DateTimeUtils.START_OF_TIME;
|
import static google.registry.util.DateTimeUtils.START_OF_TIME;
|
||||||
import static java.util.Arrays.asList;
|
import static java.util.Arrays.asList;
|
||||||
import static org.joda.money.CurrencyUnit.USD;
|
import static org.joda.money.CurrencyUnit.USD;
|
||||||
|
@ -111,7 +111,7 @@ public class DomainTransferApproveFlowTest
|
||||||
}
|
}
|
||||||
|
|
||||||
private void assertTransferApproved(HostResource host) {
|
private void assertTransferApproved(HostResource host) {
|
||||||
assertAboutEppResources().that(host)
|
assertAboutHosts().that(host)
|
||||||
.hasCurrentSponsorClientId("NewRegistrar").and()
|
.hasCurrentSponsorClientId("NewRegistrar").and()
|
||||||
.hasLastTransferTime(clock.nowUtc()).and()
|
.hasLastTransferTime(clock.nowUtc()).and()
|
||||||
.doesNotHaveStatusValue(StatusValue.PENDING_TRANSFER);
|
.doesNotHaveStatusValue(StatusValue.PENDING_TRANSFER);
|
||||||
|
|
|
@ -132,7 +132,7 @@ public class DomainTransferRequestFlowTest
|
||||||
|
|
||||||
private void assertTransferApproved(HostResource host) {
|
private void assertTransferApproved(HostResource host) {
|
||||||
DateTime afterAutoAck = clock.nowUtc().plus(Registry.get("tld").getAutomaticTransferLength());
|
DateTime afterAutoAck = clock.nowUtc().plus(Registry.get("tld").getAutomaticTransferLength());
|
||||||
assertAboutEppResources().that(host)
|
assertAboutHosts().that(host)
|
||||||
.hasCurrentSponsorClientId("NewRegistrar").and()
|
.hasCurrentSponsorClientId("NewRegistrar").and()
|
||||||
.hasLastTransferTime(afterAutoAck).and()
|
.hasLastTransferTime(afterAutoAck).and()
|
||||||
.doesNotHaveStatusValue(StatusValue.PENDING_TRANSFER);
|
.doesNotHaveStatusValue(StatusValue.PENDING_TRANSFER);
|
||||||
|
|
|
@ -72,7 +72,6 @@ public class DomainApplicationTest extends EntityTestCase {
|
||||||
.setCreationClientId("a registrar")
|
.setCreationClientId("a registrar")
|
||||||
.setLastEppUpdateTime(clock.nowUtc())
|
.setLastEppUpdateTime(clock.nowUtc())
|
||||||
.setLastEppUpdateClientId("another registrar")
|
.setLastEppUpdateClientId("another registrar")
|
||||||
.setLastTransferTime(clock.nowUtc())
|
|
||||||
.setStatusValues(ImmutableSet.of(
|
.setStatusValues(ImmutableSet.of(
|
||||||
StatusValue.CLIENT_DELETE_PROHIBITED,
|
StatusValue.CLIENT_DELETE_PROHIBITED,
|
||||||
StatusValue.SERVER_DELETE_PROHIBITED,
|
StatusValue.SERVER_DELETE_PROHIBITED,
|
||||||
|
|
|
@ -220,7 +220,6 @@ class google.registry.model.domain.DomainApplication {
|
||||||
org.joda.money.Money auctionPrice;
|
org.joda.money.Money auctionPrice;
|
||||||
org.joda.time.DateTime deletionTime;
|
org.joda.time.DateTime deletionTime;
|
||||||
org.joda.time.DateTime lastEppUpdateTime;
|
org.joda.time.DateTime lastEppUpdateTime;
|
||||||
org.joda.time.DateTime lastTransferTime;
|
|
||||||
}
|
}
|
||||||
class google.registry.model.domain.DomainAuthInfo {
|
class google.registry.model.domain.DomainAuthInfo {
|
||||||
google.registry.model.eppcommon.AuthInfo$PasswordAuth pw;
|
google.registry.model.eppcommon.AuthInfo$PasswordAuth pw;
|
||||||
|
@ -244,7 +243,6 @@ class google.registry.model.domain.DomainBase {
|
||||||
java.util.Set<google.registry.model.eppcommon.StatusValue> status;
|
java.util.Set<google.registry.model.eppcommon.StatusValue> status;
|
||||||
org.joda.time.DateTime deletionTime;
|
org.joda.time.DateTime deletionTime;
|
||||||
org.joda.time.DateTime lastEppUpdateTime;
|
org.joda.time.DateTime lastEppUpdateTime;
|
||||||
org.joda.time.DateTime lastTransferTime;
|
|
||||||
}
|
}
|
||||||
class google.registry.model.domain.DomainResource {
|
class google.registry.model.domain.DomainResource {
|
||||||
@Id java.lang.String repoId;
|
@Id java.lang.String repoId;
|
||||||
|
|
|
@ -150,20 +150,6 @@ abstract class AbstractEppResourceSubject
|
||||||
"has deletionTime");
|
"has deletionTime");
|
||||||
}
|
}
|
||||||
|
|
||||||
public And<S> hasLastTransferTime(DateTime lastTransferTime) {
|
|
||||||
return hasValue(
|
|
||||||
lastTransferTime,
|
|
||||||
actual().getLastTransferTime(),
|
|
||||||
"has lastTransferTime");
|
|
||||||
}
|
|
||||||
|
|
||||||
public And<S> hasLastTransferTimeNotEqualTo(DateTime lastTransferTime) {
|
|
||||||
return doesNotHaveValue(
|
|
||||||
lastTransferTime,
|
|
||||||
actual().getLastTransferTime(),
|
|
||||||
"lastTransferTime");
|
|
||||||
}
|
|
||||||
|
|
||||||
public And<S> hasLastEppUpdateTime(DateTime lastUpdateTime) {
|
public And<S> hasLastEppUpdateTime(DateTime lastUpdateTime) {
|
||||||
return hasValue(
|
return hasValue(
|
||||||
lastUpdateTime,
|
lastUpdateTime,
|
||||||
|
|
|
@ -162,6 +162,19 @@ public final class ContactResourceSubject
|
||||||
"has transfer losingClientId");
|
"has transfer losingClientId");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public And<ContactResourceSubject> hasLastTransferTime(DateTime lastTransferTime) {
|
||||||
|
return hasValue(
|
||||||
|
lastTransferTime,
|
||||||
|
actual().getLastTransferTime(),
|
||||||
|
"has lastTransferTime");
|
||||||
|
}
|
||||||
|
|
||||||
|
public And<ContactResourceSubject> hasLastTransferTimeNotEqualTo(DateTime lastTransferTime) {
|
||||||
|
return doesNotHaveValue(
|
||||||
|
lastTransferTime,
|
||||||
|
actual().getLastTransferTime(),
|
||||||
|
"lastTransferTime");
|
||||||
|
}
|
||||||
public static DelegatedVerb<ContactResourceSubject, ContactResource> assertAboutContacts() {
|
public static DelegatedVerb<ContactResourceSubject, ContactResource> assertAboutContacts() {
|
||||||
return assertAbout(new SubjectFactory());
|
return assertAbout(new SubjectFactory());
|
||||||
}
|
}
|
||||||
|
|
|
@ -79,6 +79,20 @@ public final class DomainResourceSubject
|
||||||
return andChainer();
|
return andChainer();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public And<DomainResourceSubject> hasLastTransferTime(DateTime lastTransferTime) {
|
||||||
|
return hasValue(
|
||||||
|
lastTransferTime,
|
||||||
|
actual().getLastTransferTime(),
|
||||||
|
"has lastTransferTime");
|
||||||
|
}
|
||||||
|
|
||||||
|
public And<DomainResourceSubject> hasLastTransferTimeNotEqualTo(DateTime lastTransferTime) {
|
||||||
|
return doesNotHaveValue(
|
||||||
|
lastTransferTime,
|
||||||
|
actual().getLastTransferTime(),
|
||||||
|
"lastTransferTime");
|
||||||
|
}
|
||||||
|
|
||||||
public And<DomainResourceSubject> hasDeletePollMessage() {
|
public And<DomainResourceSubject> hasDeletePollMessage() {
|
||||||
if (actual().getDeletePollMessage() == null) {
|
if (actual().getDeletePollMessage() == null) {
|
||||||
fail("has a delete poll message");
|
fail("has a delete poll message");
|
||||||
|
|
|
@ -20,6 +20,8 @@ import static com.google.common.truth.Truth.assertAbout;
|
||||||
import com.google.common.truth.AbstractVerb.DelegatedVerb;
|
import com.google.common.truth.AbstractVerb.DelegatedVerb;
|
||||||
import com.google.common.truth.FailureStrategy;
|
import com.google.common.truth.FailureStrategy;
|
||||||
import google.registry.model.host.HostResource;
|
import google.registry.model.host.HostResource;
|
||||||
|
import google.registry.testing.TruthChainer.And;
|
||||||
|
import org.joda.time.DateTime;
|
||||||
|
|
||||||
/** Truth subject for asserting things about {@link HostResource} instances. */
|
/** Truth subject for asserting things about {@link HostResource} instances. */
|
||||||
public final class HostResourceSubject
|
public final class HostResourceSubject
|
||||||
|
@ -36,4 +38,18 @@ public final class HostResourceSubject
|
||||||
public static DelegatedVerb<HostResourceSubject, HostResource> assertAboutHosts() {
|
public static DelegatedVerb<HostResourceSubject, HostResource> assertAboutHosts() {
|
||||||
return assertAbout(new SubjectFactory());
|
return assertAbout(new SubjectFactory());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public And<HostResourceSubject> hasLastTransferTime(DateTime lastTransferTime) {
|
||||||
|
return hasValue(
|
||||||
|
lastTransferTime,
|
||||||
|
actual().getLastTransferTime(),
|
||||||
|
"has lastTransferTime");
|
||||||
|
}
|
||||||
|
|
||||||
|
public And<HostResourceSubject> hasLastTransferTimeNotEqualTo(DateTime lastTransferTime) {
|
||||||
|
return doesNotHaveValue(
|
||||||
|
lastTransferTime,
|
||||||
|
actual().getLastTransferTime(),
|
||||||
|
"lastTransferTime");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue