Skip to content

Commit

Permalink
Update Truth to 0.34 and migrate TestVerb.withFailureMessage to withM…
Browse files Browse the repository at this point in the history
…essage for third_party/guice/throwingproviders.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=161972427
  • Loading branch information
JiangJi authored and ronshapiro committed Jan 25, 2018
1 parent aa2b4c5 commit 5eb69b2
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion build.xml
Expand Up @@ -120,7 +120,7 @@
<pathelement location="lib/build/guava-testlib-19.0.jar"/>
<pathelement location="lib/build/junit.jar"/>
<pathelement location="lib/build/servlet-api-2.5.jar"/>
<pathelement location="lib/build/truth-0.33.jar"/>
<pathelement location="lib/build/truth-0.34.jar"/>
<pathelement location="lib/build/easymock.jar"/>
<pathelement location="lib/build/javax.inject-tck.jar"/>
<pathelement location="lib/build/bnd-0.0.384.jar"/>
Expand Down
Expand Up @@ -57,7 +57,7 @@ public Subject<?, Object> providedValue() {
failureStrategy.fail(String.format("checked provider <%s> threw an exception", provider), e);
return ignoreCheck().that(new Object());
}
return check().withFailureMessage("value provided by <%s>", provider).that(got);
return check().withMessage("value provided by <%s>", provider).that(got);
}

/**
Expand All @@ -75,7 +75,7 @@ public ThrowableSubject thrownException() {
try {
got = provider.get();
} catch (Throwable e) {
return check().withFailureMessage("exception thrown by <%s>", provider).that(e);
return check().withMessage("exception thrown by <%s>", provider).that(e);
}
failWithBadResults("threw", "an exception", "provided", got);
return ignoreCheck().that(new Throwable());
Expand Down
@@ -1,8 +1,7 @@
package com.google.inject.throwingproviders;

import static com.google.common.truth.Truth.assertThat;
import static com.google.common.truth.Truth.assert_;
import static org.junit.Assert.fail;
import static com.google.common.truth.Truth.assertWithMessage;

import com.google.inject.TypeLiteral;
import java.util.Arrays;
Expand Down Expand Up @@ -108,8 +107,7 @@ public void testCheckThrowable_unsupportedThrowableConstructor_throwsIllegalArgu
fail("Expected an exception to be thrown");
} catch (IllegalArgumentException e) {
assertThat(e).hasMessage(message);
assert_()
.withFailureMessage(String.format("exception <%s> with cause", e))
assertWithMessage(String.format("exception <%s> with cause", e))
.that(e.getCause())
.isInstanceOf(NoSuchMethodException.class);
}
Expand Down
Binary file not shown.
2 changes: 1 addition & 1 deletion pom.xml
Expand Up @@ -170,7 +170,7 @@ See the Apache License Version 2.0 for the specific language governing permissio
<dependency>
<groupId>com.google.truth</groupId>
<artifactId>truth</artifactId>
<version>0.33</version>
<version>0.34</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down

0 comments on commit 5eb69b2

Please sign in to comment.