From 0cdbf71daf3e224d6bf0531b217912e5a81b5ca0 Mon Sep 17 00:00:00 2001 From: jianglai Date: Mon, 23 Jul 2018 12:57:49 -0700 Subject: [PATCH] Migrate callers of Truth's Subject.failWithRawMessage to Subject.failWithoutActual See [] Requires the use of Guava 25.1 for Strings.lenientFormat and Truth 0.41 for Subject.failWithoutActual RELNOTES: Migrated from Subject.failWithRawMessage to Subject.failWithoutActual BEGIN_PUBLIC Migrated from Subject.failWithRawMessage to Subject.failWithoutActual END_PUBLIC Tested: TAP --sample for global presubmit queue [] ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=205709366 --- .../registry/testing/AbstractEppResourceSubject.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/javatests/google/registry/testing/AbstractEppResourceSubject.java b/javatests/google/registry/testing/AbstractEppResourceSubject.java index 79cb666d6..059364c8b 100644 --- a/javatests/google/registry/testing/AbstractEppResourceSubject.java +++ b/javatests/google/registry/testing/AbstractEppResourceSubject.java @@ -15,6 +15,8 @@ package google.registry.testing; import static com.google.common.base.Preconditions.checkNotNull; +import static com.google.common.base.Strings.lenientFormat; +import static com.google.common.truth.Fact.simpleFact; import static com.google.common.truth.Truth.assertThat; import static google.registry.model.EppResourceUtils.isActive; import static google.registry.testing.DatastoreHelper.getHistoryEntriesOfType; @@ -136,15 +138,19 @@ abstract class AbstractEppResourceSubject public And hasStatusValue(StatusValue statusValue) { if (!actual().getStatusValues().contains(statusValue)) { - failWithRawMessage("%s should have had status value %s", actualAsString(), statusValue); + failWithoutActual( + simpleFact( + lenientFormat("%s should have had status value %s", actualAsString(), statusValue))); } return andChainer(); } public And doesNotHaveStatusValue(StatusValue statusValue) { if (actual().getStatusValues().contains(statusValue)) { - failWithRawMessage( - "%s should not have had status value %s", actualAsString(), statusValue); + failWithoutActual( + simpleFact( + lenientFormat( + "%s should not have had status value %s", actualAsString(), statusValue))); } return andChainer(); }