Top Description Fields Constructors Methods
org.assertj.core.error

public Class ShouldHaveContent

extends AbstractShouldHaveTextContent
Class Inheritance
Imports
java.io.File, java.nio.charset.Charset, java.nio.file.Path, java.util.List, org.assertj.core.util.diff.Delta

Creates an error message indicating that an assertion that verifies that a file/path has a given text content failed.
Author
Olivier Michallat

Field Summary

Inherited from org.assertj.core.error.AbstractShouldHaveTextContent:
diffs

Constructor Summary

AccessConstructor and Description
private
ShouldHaveContent(File actual, Charset charset, String diffs)

private
ShouldHaveContent(Path actual, Charset charset, String diffs)

Method Summary

Modifier and TypeMethod and Description
public static ErrorMessageFactory

Returns:

the created ErrorMessageFactory.
shouldHaveContent
(File
the actual file in the failed assertion.
actual
,
Charset
the charset that was used to read the file.
charset
,
List<Delta<String>>
the differences between actual and the expected text that was provided in the assertion.
diffs
)

Creates a new ShouldHaveContent.

public static ErrorMessageFactory

Returns:

the created ErrorMessageFactory.
shouldHaveContent
(Path
the actual path in the failed assertion.
actual
,
Charset
the charset that was used to read the path.
charset
,
List<Delta<String>>
the differences between actual and the expected text that was provided in the assertion.
diffs
)

Creates a new ShouldHaveContent.

Inherited from org.assertj.core.error.AbstractShouldHaveTextContent:
creatediffsAsString

Constructor Detail

ShouldHaveContentback to summary
private ShouldHaveContent(File actual, Charset charset, String diffs)
ShouldHaveContentback to summary
private ShouldHaveContent(Path actual, Charset charset, String diffs)

Method Detail

shouldHaveContentback to summary
public static ErrorMessageFactory shouldHaveContent(File actual, Charset charset, List<Delta<String>> diffs)

Creates a new ShouldHaveContent.

Parameters
actual:File

the actual file in the failed assertion.

charset:Charset

the charset that was used to read the file.

diffs:List<Delta<String>>

the differences between actual and the expected text that was provided in the assertion.

Returns:ErrorMessageFactory

the created ErrorMessageFactory.

shouldHaveContentback to summary
public static ErrorMessageFactory shouldHaveContent(Path actual, Charset charset, List<Delta<String>> diffs)

Creates a new ShouldHaveContent.

Parameters
actual:Path

the actual path in the failed assertion.

charset:Charset

the charset that was used to read the path.

diffs:List<Delta<String>>

the differences between actual and the expected text that was provided in the assertion.

Returns:ErrorMessageFactory

the created ErrorMessageFactory.