Search in sources :

Example 1 with Md5DigestOf

use of org.cactoos.io.Md5DigestOf in project cactoos by yegor256.

the class TextHasStringTest method hasClearDescriptionForFailedTest.

@Test
public void hasClearDescriptionForFailedTest() throws Exception {
    final HexOf hex = new HexOf(new Md5DigestOf(new InputOf("Hello World!")));
    final Description description = new StringDescription();
    final TextHasString matcher = new TextHasString("ed076287532e86365e841e92bfc50d8c6");
    matcher.matchesSafely(hex);
    matcher.describeMismatchSafely(hex, description);
    MatcherAssert.assertThat("Description is not clear ", description.toString(), new StringContains("Text with \"ed076287532e86365e841e92bfc50d8c\""));
}
Also used : Md5DigestOf(org.cactoos.io.Md5DigestOf) Description(org.hamcrest.Description) StringDescription(org.hamcrest.StringDescription) HexOf(org.cactoos.text.HexOf) StringDescription(org.hamcrest.StringDescription) InputOf(org.cactoos.io.InputOf) StringContains(org.hamcrest.core.StringContains) Test(org.junit.Test)

Aggregations

InputOf (org.cactoos.io.InputOf)1 Md5DigestOf (org.cactoos.io.Md5DigestOf)1 HexOf (org.cactoos.text.HexOf)1 Description (org.hamcrest.Description)1 StringDescription (org.hamcrest.StringDescription)1 StringContains (org.hamcrest.core.StringContains)1 Test (org.junit.Test)1