From fabbf8871c8d6850c5f09413d1416457917eca82 Mon Sep 17 00:00:00 2001 From: cgoldfeder Date: Fri, 7 Oct 2016 08:58:58 -0700 Subject: [PATCH] Fix more deprecated methods in truth tests ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=135481064 --- .../registry/testing/AbstractEppResourceSubject.java | 6 +++--- .../google/registry/testing/HistoryEntrySubject.java | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/javatests/google/registry/testing/AbstractEppResourceSubject.java b/javatests/google/registry/testing/AbstractEppResourceSubject.java index fe847da8a..267e2a972 100644 --- a/javatests/google/registry/testing/AbstractEppResourceSubject.java +++ b/javatests/google/registry/testing/AbstractEppResourceSubject.java @@ -47,11 +47,11 @@ abstract class AbstractEppResourceSubject @SuppressWarnings("unchecked") protected And andChainer() { - return new And((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(assertAboutHistoryEntries() + return new Which<>(assertAboutHistoryEntries() .that(getHistoryEntries().get(index)).withCustomDisplaySubject(String.format( "the history entry for %s at index %s", getDisplaySubject(), index))); } diff --git a/javatests/google/registry/testing/HistoryEntrySubject.java b/javatests/google/registry/testing/HistoryEntrySubject.java index 623911489..e062324db 100644 --- a/javatests/google/registry/testing/HistoryEntrySubject.java +++ b/javatests/google/registry/testing/HistoryEntrySubject.java @@ -39,7 +39,7 @@ public class HistoryEntrySubject extends Subject(this); + return new And<>(this); } public And hasPeriodYears(int years) { @@ -73,7 +73,7 @@ public class HistoryEntrySubject extends Subject(this); + return new And<>(this); } public And hasMetadataReason(String reason) { @@ -85,7 +85,7 @@ public class HistoryEntrySubject extends Subject(this); + return new And<>(this); } protected void failWithBadResults(String dualVerb, Object expected, Object actual) { @@ -96,7 +96,7 @@ public class HistoryEntrySubject extends Subject(this); + return new And<>(this); } public static DelegatedVerb assertAboutHistoryEntries() {