Class 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 a String.
    It also mentions the ComparisonStrategy used.
    Author:
    Alex Ruiz, Joel Costigliola
    • Constructor Detail

      • ShouldContain

        private ShouldContain​(Object actual,
                              Object expected,
                              Object notFound,
                              org.assertj.core.internal.ComparisonStrategy comparisonStrategy,
                              GroupTypeDescription groupTypeDescription)
      • ShouldContain

        private ShouldContain​(Object actual,
                              List<String> directoryContent,
                              String filterDescription)
    • Method Detail

      • shouldContain

        public static ErrorMessageFactory shouldContain​(Object actual,
                                                        Object expected,
                                                        Object notFound,
                                                        org.assertj.core.internal.ComparisonStrategy comparisonStrategy)
        Creates a new ShouldContain.
        Parameters:
        actual - the actual value in the failed assertion.
        expected - values expected to be in actual.
        notFound - the values in expected not found in actual.
        comparisonStrategy - the ComparisonStrategy used to evaluate assertion.
        Returns:
        the created ErrorMessageFactory.
      • shouldContain

        public static ErrorMessageFactory shouldContain​(Class<?> clazz,
                                                        Object actual,
                                                        Object expected,
                                                        Object notFound,
                                                        org.assertj.core.internal.ComparisonStrategy comparisonStrategy)
        Creates a new ShouldContain.
        Parameters:
        clazz - the actual value class in the failed assertion.
        actual - the actual value in the failed assertion.
        expected - values expected to be in actual.
        notFound - the values in expected not found in actual.
        comparisonStrategy - the ComparisonStrategy 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 in actual.
        notFound - the values in expected not found in actual.
        Returns:
        the created ErrorMessageFactory.