Class ShouldHaveContent

All Implemented Interfaces:
ErrorMessageFactory

public class ShouldHaveContent extends AbstractShouldHaveTextContent
Creates an error message indicating that an assertion that verifies that a file/path has a given text content failed.
Author:
Olivier Michallat
  • Method Details

    • shouldHaveContent

      public static ErrorMessageFactory shouldHaveContent(File actual, Charset charset, List<Delta<String>> diffs)
      Creates a new ShouldHaveContent.
      Parameters:
      actual - the actual file in the failed assertion.
      charset - the charset that was used to read the file.
      diffs - the differences between actual and the expected text that was provided in the assertion.
      Returns:
      the created ErrorMessageFactory.
    • shouldHaveContent

      public static ErrorMessageFactory shouldHaveContent(Path actual, Charset charset, List<Delta<String>> diffs)
      Creates a new ShouldHaveContent.
      Parameters:
      actual - the actual path in the failed assertion.
      charset - the charset that was used to read the path.
      diffs - the differences between actual and the expected text that was provided in the assertion.
      Returns:
      the created ErrorMessageFactory.