Package org.assertj.core.error
Class ShouldContain
- java.lang.Object
-
- org.assertj.core.error.BasicErrorMessageFactory
-
- org.assertj.core.error.ShouldContain
-
- All Implemented Interfaces:
ErrorMessageFactory
public class ShouldContain extends BasicErrorMessageFactory
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 aString
.
It also mention theComparisonStrategy
used.- Author:
- Alex Ruiz, Joel Costigliola
-
-
Field Summary
-
Fields inherited from class org.assertj.core.error.BasicErrorMessageFactory
arguments, format, formatter
-
-
Constructor Summary
Constructors Modifier Constructor Description private
ShouldContain(Object actual, Object expected, Object notFound, ComparisonStrategy comparisonStrategy, GroupTypeDescription groupTypeDescription)
private
ShouldContain(Object actual, List<String> directoryContent, String filterDescription)
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ErrorMessageFactory
directoryShouldContain(File actual, List<String> directoryContent, String filterDescription)
static ErrorMessageFactory
directoryShouldContain(Path actual, List<String> directoryContent, String filterDescription)
static ErrorMessageFactory
shouldContain(Object actual, Object expected, Object notFound)
Creates a new
.ShouldContain
static ErrorMessageFactory
shouldContain(Object actual, Object expected, Object notFound, ComparisonStrategy comparisonStrategy)
Creates a new
.ShouldContain
-
Methods inherited from class org.assertj.core.error.BasicErrorMessageFactory
create, create, create, equals, hashCode, toString, unquotedString
-
-
-
-
Constructor Detail
-
ShouldContain
private ShouldContain(Object actual, Object expected, Object notFound, ComparisonStrategy comparisonStrategy, GroupTypeDescription groupTypeDescription)
-
-
Method Detail
-
shouldContain
public static ErrorMessageFactory shouldContain(Object actual, Object expected, Object notFound, ComparisonStrategy comparisonStrategy)
Creates a new
.ShouldContain
- Parameters:
actual
- the actual value in the failed assertion.expected
- values expected to be inactual
.notFound
- the values inexpected
not found inactual
.comparisonStrategy
- theComparisonStrategy
used to evaluate assertion.- Returns:
- the created
ErrorMessageFactory
.
-
shouldContain
public static ErrorMessageFactory shouldContain(Object actual, Object expected, Object notFound)
Creates a new
.ShouldContain
- Parameters:
actual
- the actual value in the failed assertion.expected
- values expected to be inactual
.notFound
- the values inexpected
not found inactual
.- Returns:
- the created
ErrorMessageFactory
.
-
directoryShouldContain
public static ErrorMessageFactory directoryShouldContain(File actual, List<String> directoryContent, String filterDescription)
-
directoryShouldContain
public static ErrorMessageFactory directoryShouldContain(Path actual, List<String> directoryContent, String filterDescription)
-
-