diff options
Diffstat (limited to 'document/src/test/java/com/yahoo/document/DocumentIdTestCase.java')
-rw-r--r-- | document/src/test/java/com/yahoo/document/DocumentIdTestCase.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/document/src/test/java/com/yahoo/document/DocumentIdTestCase.java b/document/src/test/java/com/yahoo/document/DocumentIdTestCase.java index a0c5da52ff7..fea3b265b6d 100644 --- a/document/src/test/java/com/yahoo/document/DocumentIdTestCase.java +++ b/document/src/test/java/com/yahoo/document/DocumentIdTestCase.java @@ -16,8 +16,10 @@ import java.io.UnsupportedEncodingException; import java.util.regex.Pattern; import java.util.Arrays; +import static org.hamcrest.Matchers.containsString; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertThat; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; @@ -225,7 +227,7 @@ public class DocumentIdTestCase { new DocumentId(strId); fail("Expected an IllegalArgumentException to be thrown"); } catch (IllegalArgumentException ex) { - assertTrue(ex.getMessage().contains(exceptionMsg)); + assertThat(ex.getMessage(), containsString(exceptionMsg)); } } @@ -252,7 +254,7 @@ public class DocumentIdTestCase { DocumentId.createFromSerialized(strId); fail("Expected an IllegalArgumentException to be thrown"); } catch (IllegalArgumentException ex) { - assertTrue(ex.getMessage().contains("illegal zero byte code point")); + assertThat(ex.getMessage(), containsString("illegal zero byte code point")); } } |