aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authordiamondm <diamondm@google.com>2019-03-19 07:02:06 -0700
committerRon Shapiro <shapiro.rd@gmail.com>2019-03-22 14:22:26 -0400
commit282a3a706a01d1dc3776f618014e7179ddd9bb19 (patch)
tree6f3d960c6c6eedd6ae9f30aa0bd9f5cb0ee15d8b /common
parent643eda4d180f5a2dc266021807e72e92e8fd6038 (diff)
downloadauto-282a3a706a01d1dc3776f618014e7179ddd9bb19.tar.gz
Refactor exception-message assertions to use ThrowableSubject.hasMessageThat(). This replaces assertions of the form assertThat(e).hasMessage(...) and assertThat(e.getMessage()) with assertThat(e).hasMessageThat().
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=239181584
Diffstat (limited to 'common')
-rw-r--r--common/src/test/java/com/google/auto/common/AnnotationMirrorsTest.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/common/src/test/java/com/google/auto/common/AnnotationMirrorsTest.java b/common/src/test/java/com/google/auto/common/AnnotationMirrorsTest.java
index c1857b7e..d5609a20 100644
--- a/common/src/test/java/com/google/auto/common/AnnotationMirrorsTest.java
+++ b/common/src/test/java/com/google/auto/common/AnnotationMirrorsTest.java
@@ -199,8 +199,10 @@ public class AnnotationMirrorsTest {
try {
AnnotationMirrors.getAnnotationValue(annotationOn(TestClassBlah.class), "a");
} catch (IllegalArgumentException e) {
- assertThat(e).hasMessage(
- "@com.google.auto.common.AnnotationMirrorsTest.Outer does not define an element a()");
+ assertThat(e)
+ .hasMessageThat()
+ .isEqualTo(
+ "@com.google.auto.common.AnnotationMirrorsTest.Outer does not define an element a()");
return;
}
fail("Should have thrown.");