mirror of
https://github.com/google/nomulus.git
synced 2025-06-28 23:33:36 +02:00
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
This commit is contained in:
parent
03a00782d6
commit
0cdbf71daf
1 changed files with 9 additions and 3 deletions
|
@ -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<S> 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<S> 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();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue