diff --git a/src/test/java/com/google/devtools/build/skyframe/EvaluationResultSubject.java b/src/test/java/com/google/devtools/build/skyframe/EvaluationResultSubject.java index 3bef7d87e7380e..1c8254a2f3df96 100644 --- a/src/test/java/com/google/devtools/build/skyframe/EvaluationResultSubject.java +++ b/src/test/java/com/google/devtools/build/skyframe/EvaluationResultSubject.java @@ -14,8 +14,6 @@ package com.google.devtools.build.skyframe; import static com.google.common.truth.Fact.simpleFact; -import static com.google.common.truth.Truth.assertWithMessage; -import static com.google.devtools.build.skyframe.ErrorInfoSubjectFactory.assertThatErrorInfo; import com.google.common.collect.ImmutableList; import com.google.common.truth.FailureMetadata; @@ -48,20 +46,22 @@ public void hasNoError() { } public Subject hasEntryThat(SkyKey key) { - return assertWithMessage("Entry for " + actualAsString()).that(actual.get(key)); + return check("get(%s)", key).that(actual.get(key)); } public ErrorInfoSubject hasErrorEntryForKeyThat(SkyKey key) { - return assertThatErrorInfo(actual.getError(key)).named("Error entry for " + actualAsString()); + return check("getError(%s)", key) + .about(new ErrorInfoSubjectFactory()) + .that(actual.getError(key)); } public IterableSubject hasDirectDepsInGraphThat(SkyKey parent) throws InterruptedException { - return assertWithMessage("Direct deps for " + parent + " in " + actualAsString()) + return check("directDeps(%s)", parent) .that(actual.getWalkableGraph().getDirectDeps(ImmutableList.of(parent)).get(parent)); } public IterableSubject hasReverseDepsInGraphThat(SkyKey child) throws InterruptedException { - return assertWithMessage("Reverse deps for " + child + " in " + actualAsString()) + return check("reverseDeps(%s)", child) .that(actual.getWalkableGraph().getReverseDeps(ImmutableList.of(child)).get(child)); } }