mirror of
https://github.com/google/nomulus.git
synced 2025-06-27 14:54:51 +02:00
Replace Truth's deprecated getSubject() method with actual()
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=135361382
This commit is contained in:
parent
b65b855067
commit
3525205984
7 changed files with 66 additions and 66 deletions
|
@ -36,7 +36,7 @@ public abstract class AbstractDomainBaseSubject
|
||||||
public And<S> hasFullyQualifiedDomainName(String fullyQualifiedDomainName) {
|
public And<S> hasFullyQualifiedDomainName(String fullyQualifiedDomainName) {
|
||||||
return hasValue(
|
return hasValue(
|
||||||
fullyQualifiedDomainName,
|
fullyQualifiedDomainName,
|
||||||
getSubject().getFullyQualifiedDomainName(),
|
actual().getFullyQualifiedDomainName(),
|
||||||
"has fullyQualifiedDomainName");
|
"has fullyQualifiedDomainName");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -45,19 +45,19 @@ public abstract class AbstractDomainBaseSubject
|
||||||
}
|
}
|
||||||
|
|
||||||
public And<S> hasExactlyDsData(Set<DelegationSignerData> dsData) {
|
public And<S> hasExactlyDsData(Set<DelegationSignerData> dsData) {
|
||||||
return hasValue(dsData, getSubject().getDsData(), "has dsData");
|
return hasValue(dsData, actual().getDsData(), "has dsData");
|
||||||
}
|
}
|
||||||
|
|
||||||
public And<S> hasNumDsData(int num) {
|
public And<S> hasNumDsData(int num) {
|
||||||
return hasValue(num, getSubject().getDsData().size(), "has num dsData");
|
return hasValue(num, actual().getDsData().size(), "has num dsData");
|
||||||
}
|
}
|
||||||
|
|
||||||
public And<S> hasLaunchNotice(LaunchNotice launchNotice) {
|
public And<S> hasLaunchNotice(LaunchNotice launchNotice) {
|
||||||
return hasValue(launchNotice, getSubject().getLaunchNotice(), "has launchNotice");
|
return hasValue(launchNotice, actual().getLaunchNotice(), "has launchNotice");
|
||||||
}
|
}
|
||||||
|
|
||||||
public And<S> hasAuthInfoPwd(String pw) {
|
public And<S> hasAuthInfoPwd(String pw) {
|
||||||
AuthInfo authInfo = getSubject().getAuthInfo();
|
AuthInfo authInfo = actual().getAuthInfo();
|
||||||
return hasValue(pw, authInfo == null ? null : authInfo.getPw().getValue(), "has auth info pw");
|
return hasValue(pw, authInfo == null ? null : authInfo.getPw().getValue(), "has auth info pw");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,7 +42,7 @@ abstract class AbstractEppResourceSubject
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<HistoryEntry> getHistoryEntries() {
|
private List<HistoryEntry> getHistoryEntries() {
|
||||||
return DatastoreHelper.getHistoryEntries(getSubject());
|
return DatastoreHelper.getHistoryEntries(actual());
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
|
@ -54,12 +54,12 @@ abstract class AbstractEppResourceSubject
|
||||||
public String getDisplaySubject() {
|
public String getDisplaySubject() {
|
||||||
return String.format(
|
return String.format(
|
||||||
"%s with foreign key '%s'",
|
"%s with foreign key '%s'",
|
||||||
getSubject().getClass().getSimpleName(),
|
actual().getClass().getSimpleName(),
|
||||||
getSubject().getForeignKey());
|
actual().getForeignKey());
|
||||||
}
|
}
|
||||||
|
|
||||||
public And<S> hasRepoId(long roid) {
|
public And<S> hasRepoId(long roid) {
|
||||||
return hasValue(roid, getSubject().getRepoId(), "has repoId");
|
return hasValue(roid, actual().getRepoId(), "has repoId");
|
||||||
}
|
}
|
||||||
|
|
||||||
public And<S> hasNoHistoryEntries() {
|
public And<S> hasNoHistoryEntries() {
|
||||||
|
@ -77,7 +77,7 @@ abstract class AbstractEppResourceSubject
|
||||||
}
|
}
|
||||||
|
|
||||||
public And<S> hasNumHistoryEntriesOfType(HistoryEntry.Type type, int num) {
|
public And<S> hasNumHistoryEntriesOfType(HistoryEntry.Type type, int num) {
|
||||||
List<HistoryEntry> entries = getHistoryEntriesOfType(getSubject(), type);
|
List<HistoryEntry> entries = getHistoryEntriesOfType(actual(), type);
|
||||||
if (entries.size() != num) {
|
if (entries.size() != num) {
|
||||||
failWithBadResults(
|
failWithBadResults(
|
||||||
String.format("has this number of history entries of type %s", type.toString()),
|
String.format("has this number of history entries of type %s", type.toString()),
|
||||||
|
@ -121,14 +121,14 @@ abstract class AbstractEppResourceSubject
|
||||||
}
|
}
|
||||||
|
|
||||||
public And<S> hasStatusValue(StatusValue statusValue) {
|
public And<S> hasStatusValue(StatusValue statusValue) {
|
||||||
if (!getSubject().getStatusValues().contains(statusValue)) {
|
if (!actual().getStatusValues().contains(statusValue)) {
|
||||||
failWithRawMessage("%s should have had status value %s", getDisplaySubject(), statusValue);
|
failWithRawMessage("%s should have had status value %s", getDisplaySubject(), statusValue);
|
||||||
}
|
}
|
||||||
return andChainer();
|
return andChainer();
|
||||||
}
|
}
|
||||||
|
|
||||||
public And<S> doesNotHaveStatusValue(StatusValue statusValue) {
|
public And<S> doesNotHaveStatusValue(StatusValue statusValue) {
|
||||||
if (getSubject().getStatusValues().contains(statusValue)) {
|
if (actual().getStatusValues().contains(statusValue)) {
|
||||||
failWithRawMessage(
|
failWithRawMessage(
|
||||||
"%s should not have had status value %s", getDisplaySubject(), statusValue);
|
"%s should not have had status value %s", getDisplaySubject(), statusValue);
|
||||||
}
|
}
|
||||||
|
@ -136,9 +136,9 @@ abstract class AbstractEppResourceSubject
|
||||||
}
|
}
|
||||||
|
|
||||||
public And<S> hasExactlyStatusValues(StatusValue... statusValues) {
|
public And<S> hasExactlyStatusValues(StatusValue... statusValues) {
|
||||||
if (!ImmutableSet.copyOf(getSubject().getStatusValues())
|
if (!ImmutableSet.copyOf(actual().getStatusValues())
|
||||||
.equals(ImmutableSet.copyOf(statusValues))) {
|
.equals(ImmutableSet.copyOf(statusValues))) {
|
||||||
assertThat(getSubject().getStatusValues()).named("status values for " + getDisplaySubject())
|
assertThat(actual().getStatusValues()).named("status values for " + getDisplaySubject())
|
||||||
.containsExactly((Object[]) statusValues);
|
.containsExactly((Object[]) statusValues);
|
||||||
}
|
}
|
||||||
return andChainer();
|
return andChainer();
|
||||||
|
@ -147,33 +147,33 @@ abstract class AbstractEppResourceSubject
|
||||||
public And<S> hasDeletionTime(DateTime deletionTime) {
|
public And<S> hasDeletionTime(DateTime deletionTime) {
|
||||||
return hasValue(
|
return hasValue(
|
||||||
deletionTime,
|
deletionTime,
|
||||||
getSubject().getDeletionTime(),
|
actual().getDeletionTime(),
|
||||||
"has deletionTime");
|
"has deletionTime");
|
||||||
}
|
}
|
||||||
|
|
||||||
public And<S> hasLastTransferTime(DateTime lastTransferTime) {
|
public And<S> hasLastTransferTime(DateTime lastTransferTime) {
|
||||||
return hasValue(
|
return hasValue(
|
||||||
lastTransferTime,
|
lastTransferTime,
|
||||||
getSubject().getLastTransferTime(),
|
actual().getLastTransferTime(),
|
||||||
"has lastTransferTime");
|
"has lastTransferTime");
|
||||||
}
|
}
|
||||||
|
|
||||||
public And<S> hasLastTransferTimeNotEqualTo(DateTime lastTransferTime) {
|
public And<S> hasLastTransferTimeNotEqualTo(DateTime lastTransferTime) {
|
||||||
return doesNotHaveValue(
|
return doesNotHaveValue(
|
||||||
lastTransferTime,
|
lastTransferTime,
|
||||||
getSubject().getLastTransferTime(),
|
actual().getLastTransferTime(),
|
||||||
"lastTransferTime");
|
"lastTransferTime");
|
||||||
}
|
}
|
||||||
|
|
||||||
public And<S> hasLastEppUpdateTime(DateTime lastUpdateTime) {
|
public And<S> hasLastEppUpdateTime(DateTime lastUpdateTime) {
|
||||||
return hasValue(
|
return hasValue(
|
||||||
lastUpdateTime,
|
lastUpdateTime,
|
||||||
getSubject().getLastEppUpdateTime(),
|
actual().getLastEppUpdateTime(),
|
||||||
"has lastEppUpdateTime");
|
"has lastEppUpdateTime");
|
||||||
}
|
}
|
||||||
|
|
||||||
public And<S> hasLastEppUpdateTimeAtLeast(DateTime before) {
|
public And<S> hasLastEppUpdateTimeAtLeast(DateTime before) {
|
||||||
DateTime lastEppUpdateTime = getSubject().getLastEppUpdateTime();
|
DateTime lastEppUpdateTime = actual().getLastEppUpdateTime();
|
||||||
if (lastEppUpdateTime == null || before.isAfter(lastEppUpdateTime)) {
|
if (lastEppUpdateTime == null || before.isAfter(lastEppUpdateTime)) {
|
||||||
failWithBadResults("has lastEppUpdateTime at least", before, lastEppUpdateTime);
|
failWithBadResults("has lastEppUpdateTime at least", before, lastEppUpdateTime);
|
||||||
}
|
}
|
||||||
|
@ -183,61 +183,61 @@ abstract class AbstractEppResourceSubject
|
||||||
public And<S> hasLastEppUpdateClientId(String clientId) {
|
public And<S> hasLastEppUpdateClientId(String clientId) {
|
||||||
return hasValue(
|
return hasValue(
|
||||||
clientId,
|
clientId,
|
||||||
getSubject().getLastEppUpdateClientId(),
|
actual().getLastEppUpdateClientId(),
|
||||||
"has lastEppUpdateClientId");
|
"has lastEppUpdateClientId");
|
||||||
}
|
}
|
||||||
|
|
||||||
public And<S> hasCurrentSponsorClientId(String clientId) {
|
public And<S> hasCurrentSponsorClientId(String clientId) {
|
||||||
return hasValue(
|
return hasValue(
|
||||||
clientId,
|
clientId,
|
||||||
getSubject().getCurrentSponsorClientId(),
|
actual().getCurrentSponsorClientId(),
|
||||||
"has currentSponsorClientId");
|
"has currentSponsorClientId");
|
||||||
}
|
}
|
||||||
|
|
||||||
public And<S> hasTransferStatus(TransferStatus transferStatus) {
|
public And<S> hasTransferStatus(TransferStatus transferStatus) {
|
||||||
return hasValue(
|
return hasValue(
|
||||||
transferStatus,
|
transferStatus,
|
||||||
getSubject().getTransferData().getTransferStatus(),
|
actual().getTransferData().getTransferStatus(),
|
||||||
"has transferStatus");
|
"has transferStatus");
|
||||||
}
|
}
|
||||||
|
|
||||||
public And<S> hasTransferRequestClientTrid(String clTrid) {
|
public And<S> hasTransferRequestClientTrid(String clTrid) {
|
||||||
return hasValue(
|
return hasValue(
|
||||||
clTrid,
|
clTrid,
|
||||||
getSubject().getTransferData().getTransferRequestTrid().getClientTransactionId(),
|
actual().getTransferData().getTransferRequestTrid().getClientTransactionId(),
|
||||||
"has trid");
|
"has trid");
|
||||||
}
|
}
|
||||||
|
|
||||||
public And<S> hasPendingTransferExpirationTime(DateTime pendingTransferExpirationTime) {
|
public And<S> hasPendingTransferExpirationTime(DateTime pendingTransferExpirationTime) {
|
||||||
return hasValue(
|
return hasValue(
|
||||||
pendingTransferExpirationTime,
|
pendingTransferExpirationTime,
|
||||||
getSubject().getTransferData().getPendingTransferExpirationTime(),
|
actual().getTransferData().getPendingTransferExpirationTime(),
|
||||||
"has pendingTransferExpirationTime");
|
"has pendingTransferExpirationTime");
|
||||||
}
|
}
|
||||||
|
|
||||||
public And<S> hasTransferGainingClientId(String gainingClientId) {
|
public And<S> hasTransferGainingClientId(String gainingClientId) {
|
||||||
return hasValue(
|
return hasValue(
|
||||||
gainingClientId,
|
gainingClientId,
|
||||||
getSubject().getTransferData().getGainingClientId(),
|
actual().getTransferData().getGainingClientId(),
|
||||||
"has transfer ga");
|
"has transfer ga");
|
||||||
}
|
}
|
||||||
|
|
||||||
public And<S> hasTransferLosingClientId(String losingClientId) {
|
public And<S> hasTransferLosingClientId(String losingClientId) {
|
||||||
return hasValue(
|
return hasValue(
|
||||||
losingClientId,
|
losingClientId,
|
||||||
getSubject().getTransferData().getLosingClientId(),
|
actual().getTransferData().getLosingClientId(),
|
||||||
"has transfer losingClientId");
|
"has transfer losingClientId");
|
||||||
}
|
}
|
||||||
|
|
||||||
public And<S> isActiveAt(DateTime time) {
|
public And<S> isActiveAt(DateTime time) {
|
||||||
if (!isActive(getSubject(), time)) {
|
if (!isActive(actual(), time)) {
|
||||||
fail("is active at " + time);
|
fail("is active at " + time);
|
||||||
}
|
}
|
||||||
return andChainer();
|
return andChainer();
|
||||||
}
|
}
|
||||||
|
|
||||||
public And<S> isNotActiveAt(DateTime time) {
|
public And<S> isNotActiveAt(DateTime time) {
|
||||||
if (isActive(getSubject(), time)) {
|
if (isActive(actual(), time)) {
|
||||||
fail("is not active at " + time);
|
fail("is not active at " + time);
|
||||||
}
|
}
|
||||||
return andChainer();
|
return andChainer();
|
||||||
|
|
|
@ -37,18 +37,18 @@ public final class ContactResourceSubject
|
||||||
}
|
}
|
||||||
|
|
||||||
public And<ContactResourceSubject> hasLocalizedPostalInfo(PostalInfo postalInfo) {
|
public And<ContactResourceSubject> hasLocalizedPostalInfo(PostalInfo postalInfo) {
|
||||||
return hasValue(postalInfo, getSubject().getLocalizedPostalInfo(), "has localizedPostalInfo");
|
return hasValue(postalInfo, actual().getLocalizedPostalInfo(), "has localizedPostalInfo");
|
||||||
}
|
}
|
||||||
|
|
||||||
public And<ContactResourceSubject> hasNullLocalizedPostalInfo() {
|
public And<ContactResourceSubject> hasNullLocalizedPostalInfo() {
|
||||||
if (getSubject().getLocalizedPostalInfo() != null) {
|
if (actual().getLocalizedPostalInfo() != null) {
|
||||||
fail("has null localized postal info");
|
fail("has null localized postal info");
|
||||||
}
|
}
|
||||||
return andChainer();
|
return andChainer();
|
||||||
}
|
}
|
||||||
|
|
||||||
public And<ContactResourceSubject> hasNonNullLocalizedPostalInfo() {
|
public And<ContactResourceSubject> hasNonNullLocalizedPostalInfo() {
|
||||||
if (getSubject().getLocalizedPostalInfo() == null) {
|
if (actual().getLocalizedPostalInfo() == null) {
|
||||||
fail("has non-null localized postal info");
|
fail("has non-null localized postal info");
|
||||||
}
|
}
|
||||||
return andChainer();
|
return andChainer();
|
||||||
|
@ -58,12 +58,12 @@ public final class ContactResourceSubject
|
||||||
PostalInfo postalInfo) {
|
PostalInfo postalInfo) {
|
||||||
return hasValue(
|
return hasValue(
|
||||||
postalInfo,
|
postalInfo,
|
||||||
getSubject().getInternationalizedPostalInfo(),
|
actual().getInternationalizedPostalInfo(),
|
||||||
"has internationalizedPostalInfo");
|
"has internationalizedPostalInfo");
|
||||||
}
|
}
|
||||||
|
|
||||||
public And<ContactResourceSubject> hasNullInternationalizedPostalInfo() {
|
public And<ContactResourceSubject> hasNullInternationalizedPostalInfo() {
|
||||||
if (getSubject().getInternationalizedPostalInfo() != null) {
|
if (actual().getInternationalizedPostalInfo() != null) {
|
||||||
fail("has null internationalized postal info");
|
fail("has null internationalized postal info");
|
||||||
}
|
}
|
||||||
return andChainer();
|
return andChainer();
|
||||||
|
@ -71,56 +71,56 @@ public final class ContactResourceSubject
|
||||||
|
|
||||||
|
|
||||||
public And<ContactResourceSubject> hasNonNullInternationalizedPostalInfo() {
|
public And<ContactResourceSubject> hasNonNullInternationalizedPostalInfo() {
|
||||||
if (getSubject().getInternationalizedPostalInfo() == null) {
|
if (actual().getInternationalizedPostalInfo() == null) {
|
||||||
fail("has non-null internationalized postal info");
|
fail("has non-null internationalized postal info");
|
||||||
}
|
}
|
||||||
return andChainer();
|
return andChainer();
|
||||||
}
|
}
|
||||||
|
|
||||||
public And<ContactResourceSubject> hasNullEmailAddress() {
|
public And<ContactResourceSubject> hasNullEmailAddress() {
|
||||||
if (getSubject().getEmailAddress() != null) {
|
if (actual().getEmailAddress() != null) {
|
||||||
fail("has null email address");
|
fail("has null email address");
|
||||||
}
|
}
|
||||||
return andChainer();
|
return andChainer();
|
||||||
}
|
}
|
||||||
|
|
||||||
public And<ContactResourceSubject> hasNonNullEmailAddress() {
|
public And<ContactResourceSubject> hasNonNullEmailAddress() {
|
||||||
if (getSubject().getEmailAddress() == null) {
|
if (actual().getEmailAddress() == null) {
|
||||||
fail("has non-null email address");
|
fail("has non-null email address");
|
||||||
}
|
}
|
||||||
return andChainer();
|
return andChainer();
|
||||||
}
|
}
|
||||||
|
|
||||||
public And<ContactResourceSubject> hasNullVoiceNumber() {
|
public And<ContactResourceSubject> hasNullVoiceNumber() {
|
||||||
if (getSubject().getVoiceNumber() != null) {
|
if (actual().getVoiceNumber() != null) {
|
||||||
fail("has null voice number");
|
fail("has null voice number");
|
||||||
}
|
}
|
||||||
return andChainer();
|
return andChainer();
|
||||||
}
|
}
|
||||||
|
|
||||||
public And<ContactResourceSubject> hasNonNullVoiceNumber() {
|
public And<ContactResourceSubject> hasNonNullVoiceNumber() {
|
||||||
if (getSubject().getVoiceNumber() == null) {
|
if (actual().getVoiceNumber() == null) {
|
||||||
fail("has non-null voice number");
|
fail("has non-null voice number");
|
||||||
}
|
}
|
||||||
return andChainer();
|
return andChainer();
|
||||||
}
|
}
|
||||||
|
|
||||||
public And<ContactResourceSubject> hasNullFaxNumber() {
|
public And<ContactResourceSubject> hasNullFaxNumber() {
|
||||||
if (getSubject().getFaxNumber() != null) {
|
if (actual().getFaxNumber() != null) {
|
||||||
fail("has null fax number");
|
fail("has null fax number");
|
||||||
}
|
}
|
||||||
return andChainer();
|
return andChainer();
|
||||||
}
|
}
|
||||||
|
|
||||||
public And<ContactResourceSubject> hasNonNullFaxNumber() {
|
public And<ContactResourceSubject> hasNonNullFaxNumber() {
|
||||||
if (getSubject().getFaxNumber() == null) {
|
if (actual().getFaxNumber() == null) {
|
||||||
fail("has non-null fax number");
|
fail("has non-null fax number");
|
||||||
}
|
}
|
||||||
return andChainer();
|
return andChainer();
|
||||||
}
|
}
|
||||||
|
|
||||||
public And<ContactResourceSubject> hasAuthInfoPwd(String pw) {
|
public And<ContactResourceSubject> hasAuthInfoPwd(String pw) {
|
||||||
AuthInfo authInfo = getSubject().getAuthInfo();
|
AuthInfo authInfo = actual().getAuthInfo();
|
||||||
return hasValue(pw, authInfo == null ? null : authInfo.getPw().getValue(), "has auth info pw");
|
return hasValue(pw, authInfo == null ? null : authInfo.getPw().getValue(), "has auth info pw");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -33,9 +33,9 @@ public final class DomainApplicationSubject
|
||||||
|
|
||||||
public And<DomainApplicationSubject> hasApplicationStatus(
|
public And<DomainApplicationSubject> hasApplicationStatus(
|
||||||
ApplicationStatus applicationStatus) {
|
ApplicationStatus applicationStatus) {
|
||||||
if (!Objects.equals(getSubject().getApplicationStatus(), applicationStatus)) {
|
if (!Objects.equals(actual().getApplicationStatus(), applicationStatus)) {
|
||||||
failWithBadResults(
|
failWithBadResults(
|
||||||
"has application status", applicationStatus, getSubject().getApplicationStatus());
|
"has application status", applicationStatus, actual().getApplicationStatus());
|
||||||
}
|
}
|
||||||
return andChainer();
|
return andChainer();
|
||||||
}
|
}
|
||||||
|
@ -44,16 +44,16 @@ public final class DomainApplicationSubject
|
||||||
ApplicationStatus applicationStatus) {
|
ApplicationStatus applicationStatus) {
|
||||||
return doesNotHaveValue(
|
return doesNotHaveValue(
|
||||||
applicationStatus,
|
applicationStatus,
|
||||||
getSubject().getApplicationStatus(),
|
actual().getApplicationStatus(),
|
||||||
"application status");
|
"application status");
|
||||||
}
|
}
|
||||||
|
|
||||||
public And<DomainApplicationSubject> hasExactlyEncodedSignedMarks(
|
public And<DomainApplicationSubject> hasExactlyEncodedSignedMarks(
|
||||||
EncodedSignedMark... encodedSignedMarks) {
|
EncodedSignedMark... encodedSignedMarks) {
|
||||||
if (!Objects.equals(
|
if (!Objects.equals(
|
||||||
ImmutableSet.copyOf(getSubject().getEncodedSignedMarks()),
|
ImmutableSet.copyOf(actual().getEncodedSignedMarks()),
|
||||||
ImmutableSet.of(encodedSignedMarks))) {
|
ImmutableSet.of(encodedSignedMarks))) {
|
||||||
assertThat(getSubject().getEncodedSignedMarks())
|
assertThat(actual().getEncodedSignedMarks())
|
||||||
.named("the encoded signed marks of " + getDisplaySubject())
|
.named("the encoded signed marks of " + getDisplaySubject())
|
||||||
.containsExactly((Object[]) encodedSignedMarks);
|
.containsExactly((Object[]) encodedSignedMarks);
|
||||||
}
|
}
|
||||||
|
@ -61,9 +61,9 @@ public final class DomainApplicationSubject
|
||||||
}
|
}
|
||||||
|
|
||||||
public And<DomainApplicationSubject> hasNumEncodedSignedMarks(int num) {
|
public And<DomainApplicationSubject> hasNumEncodedSignedMarks(int num) {
|
||||||
if (getSubject().getEncodedSignedMarks().size() != num) {
|
if (actual().getEncodedSignedMarks().size() != num) {
|
||||||
failWithBadResults(
|
failWithBadResults(
|
||||||
"has this many encoded signed marks: ", num, getSubject().getEncodedSignedMarks().size());
|
"has this many encoded signed marks: ", num, actual().getEncodedSignedMarks().size());
|
||||||
}
|
}
|
||||||
return andChainer();
|
return andChainer();
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,31 +33,31 @@ public final class DomainResourceSubject
|
||||||
extends ReflectiveSubjectFactory<DomainResource, DomainResourceSubject>{}
|
extends ReflectiveSubjectFactory<DomainResource, DomainResourceSubject>{}
|
||||||
|
|
||||||
public And<DomainResourceSubject> hasRegistrationExpirationTime(DateTime expiration) {
|
public And<DomainResourceSubject> hasRegistrationExpirationTime(DateTime expiration) {
|
||||||
if (!Objects.equals(getSubject().getRegistrationExpirationTime(), expiration)) {
|
if (!Objects.equals(actual().getRegistrationExpirationTime(), expiration)) {
|
||||||
failWithBadResults(
|
failWithBadResults(
|
||||||
"has registrationExpirationTime",
|
"has registrationExpirationTime",
|
||||||
expiration,
|
expiration,
|
||||||
getSubject().getRegistrationExpirationTime());
|
actual().getRegistrationExpirationTime());
|
||||||
}
|
}
|
||||||
return andChainer();
|
return andChainer();
|
||||||
}
|
}
|
||||||
|
|
||||||
public And<DomainResourceSubject> hasDeletePollMessage() {
|
public And<DomainResourceSubject> hasDeletePollMessage() {
|
||||||
if (getSubject().getDeletePollMessage() == null) {
|
if (actual().getDeletePollMessage() == null) {
|
||||||
fail("has a delete poll message");
|
fail("has a delete poll message");
|
||||||
}
|
}
|
||||||
return andChainer();
|
return andChainer();
|
||||||
}
|
}
|
||||||
|
|
||||||
public And<DomainResourceSubject> hasNoDeletePollMessage() {
|
public And<DomainResourceSubject> hasNoDeletePollMessage() {
|
||||||
if (getSubject().getDeletePollMessage() != null) {
|
if (actual().getDeletePollMessage() != null) {
|
||||||
fail("has no delete poll message");
|
fail("has no delete poll message");
|
||||||
}
|
}
|
||||||
return andChainer();
|
return andChainer();
|
||||||
}
|
}
|
||||||
|
|
||||||
public And<DomainResourceSubject> hasSmdId(String smdId) {
|
public And<DomainResourceSubject> hasSmdId(String smdId) {
|
||||||
return hasValue(smdId, getSubject().getSmdId(), "has smdId");
|
return hasValue(smdId, actual().getSmdId(), "has smdId");
|
||||||
}
|
}
|
||||||
|
|
||||||
public DomainResourceSubject(FailureStrategy strategy, DomainResource subject) {
|
public DomainResourceSubject(FailureStrategy strategy, DomainResource subject) {
|
||||||
|
|
|
@ -40,7 +40,7 @@ public class HistoryEntrySubject extends Subject<HistoryEntrySubject, HistoryEnt
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getDisplaySubject() {
|
public String getDisplaySubject() {
|
||||||
return Optional.fromNullable(customDisplaySubject).or(super.getDisplaySubject());
|
return Optional.fromNullable(customDisplaySubject).or(super.actualAsString());
|
||||||
}
|
}
|
||||||
|
|
||||||
public HistoryEntrySubject withCustomDisplaySubject(String customDisplaySubject) {
|
public HistoryEntrySubject withCustomDisplaySubject(String customDisplaySubject) {
|
||||||
|
@ -49,15 +49,15 @@ public class HistoryEntrySubject extends Subject<HistoryEntrySubject, HistoryEnt
|
||||||
}
|
}
|
||||||
|
|
||||||
public And<HistoryEntrySubject> hasType(HistoryEntry.Type type) {
|
public And<HistoryEntrySubject> hasType(HistoryEntry.Type type) {
|
||||||
return hasValue(type, getSubject().getType(), "has type");
|
return hasValue(type, actual().getType(), "has type");
|
||||||
}
|
}
|
||||||
|
|
||||||
public And<HistoryEntrySubject> hasClientId(String clientId) {
|
public And<HistoryEntrySubject> hasClientId(String clientId) {
|
||||||
return hasValue(clientId, getSubject().getClientId(), "has client ID");
|
return hasValue(clientId, actual().getClientId(), "has client ID");
|
||||||
}
|
}
|
||||||
|
|
||||||
public And<HistoryEntrySubject> hasPeriod() {
|
public And<HistoryEntrySubject> hasPeriod() {
|
||||||
if (getSubject().getPeriod() == null) {
|
if (actual().getPeriod() == null) {
|
||||||
fail("has a period");
|
fail("has a period");
|
||||||
}
|
}
|
||||||
return new And<HistoryEntrySubject>(this);
|
return new And<HistoryEntrySubject>(this);
|
||||||
|
@ -65,24 +65,24 @@ public class HistoryEntrySubject extends Subject<HistoryEntrySubject, HistoryEnt
|
||||||
|
|
||||||
public And<HistoryEntrySubject> hasPeriodYears(int years) {
|
public And<HistoryEntrySubject> hasPeriodYears(int years) {
|
||||||
return hasPeriod().and()
|
return hasPeriod().and()
|
||||||
.hasValue(Period.Unit.YEARS, getSubject().getPeriod().getUnit(), "has period in").and()
|
.hasValue(Period.Unit.YEARS, actual().getPeriod().getUnit(), "has period in").and()
|
||||||
.hasValue(years, getSubject().getPeriod().getValue(), "has period length");
|
.hasValue(years, actual().getPeriod().getValue(), "has period length");
|
||||||
}
|
}
|
||||||
|
|
||||||
public And<HistoryEntrySubject> hasNoXml() {
|
public And<HistoryEntrySubject> hasNoXml() {
|
||||||
if (getSubject().getXmlBytes() != null) {
|
if (actual().getXmlBytes() != null) {
|
||||||
fail("has no xml");
|
fail("has no xml");
|
||||||
}
|
}
|
||||||
return new And<HistoryEntrySubject>(this);
|
return new And<HistoryEntrySubject>(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public And<HistoryEntrySubject> hasMetadataReason(String reason) {
|
public And<HistoryEntrySubject> hasMetadataReason(String reason) {
|
||||||
return hasValue(reason, getSubject().getReason(), "has metadata reason");
|
return hasValue(reason, actual().getReason(), "has metadata reason");
|
||||||
}
|
}
|
||||||
|
|
||||||
public And<HistoryEntrySubject> hasMetadataRequestedByRegistrar(
|
public And<HistoryEntrySubject> hasMetadataRequestedByRegistrar(
|
||||||
boolean requestedByRegistrar) {
|
boolean requestedByRegistrar) {
|
||||||
if (getSubject().getRequestedByRegistrar() != requestedByRegistrar) {
|
if (actual().getRequestedByRegistrar() != requestedByRegistrar) {
|
||||||
fail("has metadata requestedByRegistrar with value", requestedByRegistrar);
|
fail("has metadata requestedByRegistrar with value", requestedByRegistrar);
|
||||||
}
|
}
|
||||||
return new And<HistoryEntrySubject>(this);
|
return new And<HistoryEntrySubject>(this);
|
||||||
|
|
|
@ -37,8 +37,8 @@ public class LogsSubject extends Subject<LogsSubject, TestLogHandler> {
|
||||||
}
|
}
|
||||||
|
|
||||||
public And<LogsSubject> hasNoLogsAtLevel(Level level) {
|
public And<LogsSubject> hasNoLogsAtLevel(Level level) {
|
||||||
for (LogRecord log : getSubject().getStoredLogRecords()) {
|
for (LogRecord log : actual().getStoredLogRecords()) {
|
||||||
if (log.getLevel() == level) {
|
if (log.getLevel().equals(level)) {
|
||||||
failWithRawMessage(
|
failWithRawMessage(
|
||||||
"Not true that there are no logs at level %s. Found <%s>.", level, log.getMessage());
|
"Not true that there are no logs at level %s. Found <%s>.", level, log.getMessage());
|
||||||
}
|
}
|
||||||
|
@ -48,8 +48,8 @@ public class LogsSubject extends Subject<LogsSubject, TestLogHandler> {
|
||||||
|
|
||||||
public And<LogsSubject> hasLogAtLevelWithMessage(Level level, String message) {
|
public And<LogsSubject> hasLogAtLevelWithMessage(Level level, String message) {
|
||||||
boolean found = false;
|
boolean found = false;
|
||||||
for (LogRecord log : getSubject().getStoredLogRecords()) {
|
for (LogRecord log : actual().getStoredLogRecords()) {
|
||||||
if (log.getLevel() == level && log.getMessage().contains(message)) {
|
if (log.getLevel().equals(level) && log.getMessage().contains(message)) {
|
||||||
found = true;
|
found = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue