Skip to content
This repository was archived by the owner on Jan 3, 2023. It is now read-only.
This repository was archived by the owner on Jan 3, 2023. It is now read-only.

AbstractTextViewAssert.hasText() leads to java.util.UnknownFormatConversionException if text contains "%" #90

Description

@larsblumberg

Assuming that a text view contains the '%' character, calling

assertThat(textView).hasText("any text")

will throw java.util.UnknownFormatConversionException if the assertion fails (expected text is not actual text).

This is due to AssertionError.failureIfErrorMessageIsOverriden() calling MessageFormatter.instance().format().

The solution would be to escape '%' characters in the description to be formatted.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions