mirror of
https://github.com/google/nomulus.git
synced 2025-05-28 16:30:12 +02:00
Instead of calling Subject.actual(), store the actual value in a field, and read that.
actual() is being removed. More information: [] Tested: TAP --sample ran all affected tests and none failed [] ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=247415370
This commit is contained in:
parent
38e2175699
commit
5bb93e9e4a
9 changed files with 107 additions and 119 deletions
|
@ -33,8 +33,11 @@ import java.util.logging.LogRecord;
|
|||
/** Utility methods for asserting things about logging {@link Handler} instances. */
|
||||
public class LogsSubject extends Subject<LogsSubject, TestLogHandler> {
|
||||
|
||||
private final TestLogHandler actual;
|
||||
|
||||
public LogsSubject(FailureMetadata failureMetadata, TestLogHandler subject) {
|
||||
super(failureMetadata, subject);
|
||||
this.actual = subject;
|
||||
}
|
||||
|
||||
private static final Correspondence<String, String> CONTAINS_CORRESPONDENCE =
|
||||
|
@ -52,7 +55,7 @@ public class LogsSubject extends Subject<LogsSubject, TestLogHandler> {
|
|||
|
||||
private List<String> getMessagesAtLevel(Level level) {
|
||||
ImmutableList.Builder<String> builder = new ImmutableList.Builder<>();
|
||||
for (LogRecord log : actual().getStoredLogRecords()) {
|
||||
for (LogRecord log : actual.getStoredLogRecords()) {
|
||||
if (log.getLevel().equals(level)) {
|
||||
builder.add(log.getMessage());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue