Class ShouldHaveOnlyElementsOfType

java.lang.Object
org.assertj.core.error.BasicErrorMessageFactory
org.assertj.core.error.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.
  • Method Details

    • 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.