mirror of
https://github.com/google/nomulus
synced 2026-01-04 04:04:22 +00:00
Fix more deprecated methods in truth tests
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=135481064
This commit is contained in:
@@ -47,11 +47,11 @@ abstract class AbstractEppResourceSubject
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
protected And<S> andChainer() {
|
||||
return new And<S>((S) this);
|
||||
return new And<>((S) this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDisplaySubject() {
|
||||
public String actualCustomStringRepresentation() {
|
||||
return String.format(
|
||||
"%s with foreign key '%s'",
|
||||
actual().getClass().getSimpleName(),
|
||||
@@ -115,7 +115,7 @@ abstract class AbstractEppResourceSubject
|
||||
failWithBadResults(
|
||||
"has at least number of history entries", index + 1, historyEntries.size());
|
||||
}
|
||||
return new Which<HistoryEntrySubject>(assertAboutHistoryEntries()
|
||||
return new Which<>(assertAboutHistoryEntries()
|
||||
.that(getHistoryEntries().get(index)).withCustomDisplaySubject(String.format(
|
||||
"the history entry for %s at index %s", getDisplaySubject(), index)));
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ public class HistoryEntrySubject extends Subject<HistoryEntrySubject, HistoryEnt
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDisplaySubject() {
|
||||
public String actualCustomStringRepresentation() {
|
||||
return Optional.fromNullable(customDisplaySubject).or(super.actualAsString());
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ public class HistoryEntrySubject extends Subject<HistoryEntrySubject, HistoryEnt
|
||||
if (actual().getPeriod() == null) {
|
||||
fail("has a period");
|
||||
}
|
||||
return new And<HistoryEntrySubject>(this);
|
||||
return new And<>(this);
|
||||
}
|
||||
|
||||
public And<HistoryEntrySubject> hasPeriodYears(int years) {
|
||||
@@ -73,7 +73,7 @@ public class HistoryEntrySubject extends Subject<HistoryEntrySubject, HistoryEnt
|
||||
if (actual().getXmlBytes() != null) {
|
||||
fail("has no xml");
|
||||
}
|
||||
return new And<HistoryEntrySubject>(this);
|
||||
return new And<>(this);
|
||||
}
|
||||
|
||||
public And<HistoryEntrySubject> hasMetadataReason(String reason) {
|
||||
@@ -85,7 +85,7 @@ public class HistoryEntrySubject extends Subject<HistoryEntrySubject, HistoryEnt
|
||||
if (actual().getRequestedByRegistrar() != requestedByRegistrar) {
|
||||
fail("has metadata requestedByRegistrar with value", requestedByRegistrar);
|
||||
}
|
||||
return new And<HistoryEntrySubject>(this);
|
||||
return new And<>(this);
|
||||
}
|
||||
|
||||
protected void failWithBadResults(String dualVerb, Object expected, Object actual) {
|
||||
@@ -96,7 +96,7 @@ public class HistoryEntrySubject extends Subject<HistoryEntrySubject, HistoryEnt
|
||||
if (!Objects.equals(expected, actual)) {
|
||||
failWithBadResults(verb, expected, actual);
|
||||
}
|
||||
return new And<HistoryEntrySubject>(this);
|
||||
return new And<>(this);
|
||||
}
|
||||
|
||||
public static DelegatedVerb<HistoryEntrySubject, HistoryEntry> assertAboutHistoryEntries() {
|
||||
|
||||
Reference in New Issue
Block a user