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

public Class ShouldContain

extends BasicErrorMessageFactory
Class Inheritance
Static Imports
java.util.stream.Collectors.toList, org.assertj.core.error.GroupTypeDescription.getGroupTypeDescription, org.assertj.core.util.Strings.escapePercent

Creates an error message indicating that an assertion that verifies a group of elements contains a given set of values failed. A group of elements can be a collection, an array or a String.
It also mentions the ComparisonStrategy used.
Authors
Alex Ruiz, Joel Costigliola

Field Summary

Inherited from org.assertj.core.error.BasicErrorMessageFactory:
argumentsformatformatter

Constructor Summary

AccessConstructor and Description
private
ShouldContain(Object actual, Object expected, Object notFound, ComparisonStrategy comparisonStrategy, GroupTypeDescription groupTypeDescription)

private
ShouldContain(Object actual, List<String> directoryContent, String filterDescription)

Method Summary

Modifier and TypeMethod and Description
public static ErrorMessageFactory
directoryShouldContain(File actual, List<File> directoryContent, String filterDescription)

public static ErrorMessageFactory
directoryShouldContain(Path actual, List<Path> directoryContent, String filterDescription)

public static ErrorMessageFactory

Returns:

the created ErrorMessageFactory.
shouldContain
(Object
the actual value in the failed assertion.
actual
,
Object
values expected to be in actual.
expected
,
Object
the values in expected not found in actual.
notFound
,
ComparisonStrategy
the ComparisonStrategy used to evaluate assertion.
comparisonStrategy
)

Creates a new ShouldContain.

public static ErrorMessageFactory

Returns:

the created ErrorMessageFactory.
shouldContain
(Class<?>
the actual value class in the failed assertion.
clazz
,
Object
the actual value in the failed assertion.
actual
,
Object
values expected to be in actual.
expected
,
Object
the values in expected not found in actual.
notFound
,
ComparisonStrategy
the ComparisonStrategy used to evaluate assertion.
comparisonStrategy
)

Creates a new ShouldContain.

public static ErrorMessageFactory

Returns:

the created ErrorMessageFactory.
shouldContain
(Object
the actual value in the failed assertion.
actual
,
Object
values expected to be in actual.
expected
,
Object
the values in expected not found in actual.
notFound
)

Creates a new ShouldContain.

private static List<String>
private static List<String>
Inherited from org.assertj.core.error.BasicErrorMessageFactory:
createcreatecreateequalshashCodetoStringunquotedString

Constructor Detail

ShouldContainback to summary
private ShouldContain(Object actual, Object expected, Object notFound, ComparisonStrategy comparisonStrategy, GroupTypeDescription groupTypeDescription)
ShouldContainback to summary
private ShouldContain(Object actual, List<String> directoryContent, String filterDescription)

Method Detail

directoryShouldContainback to summary
public static ErrorMessageFactory directoryShouldContain(File actual, List<File> directoryContent, String filterDescription)
directoryShouldContainback to summary
public static ErrorMessageFactory directoryShouldContain(Path actual, List<Path> directoryContent, String filterDescription)
shouldContainback to summary
public static ErrorMessageFactory shouldContain(Object actual, Object expected, Object notFound, ComparisonStrategy comparisonStrategy)

Creates a new ShouldContain.

Parameters
actual:Object

the actual value in the failed assertion.

expected:Object

values expected to be in actual.

notFound:Object

the values in expected not found in actual.

comparisonStrategy:ComparisonStrategy

the ComparisonStrategy used to evaluate assertion.

Returns:ErrorMessageFactory

the created ErrorMessageFactory.

shouldContainback to summary
public static ErrorMessageFactory shouldContain(Class<?> clazz, Object actual, Object expected, Object notFound, ComparisonStrategy comparisonStrategy)

Creates a new ShouldContain.

Parameters
clazz:Class<?>

the actual value class in the failed assertion.

actual:Object

the actual value in the failed assertion.

expected:Object

values expected to be in actual.

notFound:Object

the values in expected not found in actual.

comparisonStrategy:ComparisonStrategy

the ComparisonStrategy used to evaluate assertion.

Returns:ErrorMessageFactory

the created ErrorMessageFactory.

shouldContainback to summary
public static ErrorMessageFactory shouldContain(Object actual, Object expected, Object notFound)

Creates a new ShouldContain.

Parameters
actual:Object

the actual value in the failed assertion.

expected:Object

values expected to be in actual.

notFound:Object

the values in expected not found in actual.

Returns:ErrorMessageFactory

the created ErrorMessageFactory.

toFileNamesback to summary
private static List<String> toFileNames(List<File> files)
toPathNamesback to summary
private static List<String> toPathNames(List<Path> files)