diff options
author | diamondm <diamondm@google.com> | 2019-03-19 07:02:06 -0700 |
---|---|---|
committer | Ron Shapiro <shapiro.rd@gmail.com> | 2019-03-22 14:22:26 -0400 |
commit | 282a3a706a01d1dc3776f618014e7179ddd9bb19 (patch) | |
tree | 6f3d960c6c6eedd6ae9f30aa0bd9f5cb0ee15d8b /common | |
parent | 643eda4d180f5a2dc266021807e72e92e8fd6038 (diff) | |
download | auto-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.java | 6 |
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."); |