Class ShouldHaveOnlyElementsOfType

  • All Implemented Interfaces:
    ErrorMessageFactory

    public class ShouldHaveOnlyElementsOfType
    extends BasicErrorMessageFactory
    Creates an error message indicating that a group does not have an element of the given type.
    • Constructor Detail

      • ShouldHaveOnlyElementsOfType

        private ShouldHaveOnlyElementsOfType​(Object actual,
                                             Class<?> expectedType,
                                             Class<?> unexpectedType)
    • Method Detail

      • shouldHaveOnlyElementsOfType

        public static ShouldHaveOnlyElementsOfType shouldHaveOnlyElementsOfType​(Object actual,
                                                                                Class<?> expectedType,
                                                                                Class<?> unexpectedType)
        Parameters:
        actual - array or Iterable
        expectedType - the expected type of all elements
        unexpectedType - the type of one element that is not expectedType or it subclasses.
        Returns:
        the created ErrorMessageFactory.