Skip to content

Commit

Permalink
deprecate witFailureMessage
Browse files Browse the repository at this point in the history
  • Loading branch information
cpovirk committed Jun 23, 2017
1 parent 7d038d6 commit 0e0bc9e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions core/src/main/java/com/google/common/truth/AbstractVerb.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,10 @@ public final void fail(@Nullable String format, Object /*@NullableType*/... args
* @param failureMessage a descriptive message.
* @return A custom verb which will show the descriptive message along with the normal failure
* text.
* @deprecated Use {@code withMessage}, the new name of this method.
*/
// TODO(cgruber) try to delete this (binary incompatible, but see if there's a way.
@Deprecated
public abstract T withFailureMessage(@Nullable String failureMessage);

/**
Expand All @@ -76,7 +78,9 @@ public final void fail(@Nullable String format, Object /*@NullableType*/... args
* @param args object parameters to be substituted into the message template.
* @return A custom verb which will show the descriptive message along with the normal failure
* text.
* @deprecated Use {@code withMessage}, the new name of this method.
*/
@Deprecated
public abstract T withFailureMessage(@Nullable String format, Object /*@NullableType*/... args);

/**
Expand Down
4 changes: 4 additions & 0 deletions core/src/main/java/com/google/common/truth/TestVerb.java
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,8 @@ public AtomicLongMapSubject that(@Nullable AtomicLongMap<?> target) {
return new AtomicLongMapSubject(getFailureStrategy(), target);
}

/** @deprecated Use {@code withMessage}, the new name of this method. */
@Deprecated
@Override
public TestVerb withFailureMessage(@Nullable String failureMessage) {
return withMessage(failureMessage);
Expand All @@ -189,7 +191,9 @@ public TestVerb withFailureMessage(@Nullable String failureMessage) {
*
* @throws IllegalArgumentException if the number of placeholders in the format string does not
* equal the number of given arguments
* @deprecated Use {@code withMessage}, the new name of this method.
*/
@Deprecated
@Override
public TestVerb withFailureMessage(@Nullable String format, Object /* @NullableType */... args) {
return withMessage(format, args);
Expand Down

0 comments on commit 0e0bc9e

Please sign in to comment.