mirror of
https://github.com/google/nomulus.git
synced 2025-05-16 17:37:13 +02:00
Migrate Correspondence subclasses to instead call Correspondence.from()
This makes the code shorter, and the subclassing approach is deprecated. Open-source note: Correspondence.from was added to Truth 0.43. (So was Correspondence.transforming, which I'm using occasionally instead.) Correspondence.formattingDiffsUsing was added in Truth 0.44. END_PUBLIC More information: []Tested: TAP --sample ran all affected tests and none failed [] ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=249913322
This commit is contained in:
parent
7cc5c16ab9
commit
b34a828b71
1 changed files with 1 additions and 11 deletions
|
@ -41,17 +41,7 @@ public class LogsSubject extends Subject<LogsSubject, TestLogHandler> {
|
|||
}
|
||||
|
||||
private static final Correspondence<String, String> CONTAINS_CORRESPONDENCE =
|
||||
new Correspondence<String, String>() {
|
||||
@Override
|
||||
public boolean compare(String actual, String expected) {
|
||||
return actual.contains(expected);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "contains";
|
||||
}
|
||||
};
|
||||
Correspondence.from((actual, expected) -> actual.contains(expected), "contains");
|
||||
|
||||
private List<String> getMessagesAtLevel(Level level) {
|
||||
ImmutableList.Builder<String> builder = new ImmutableList.Builder<>();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue