ListAssert.failIfNotEndingWithSequence
Code IndexAdd Codota to your IDE (free)

Best code snippets using org.fest.assertions.ListAssert.failIfNotEndingWithSequence(Showing top 1 results out of 315)

origin: org.easytesting/fest-assert

/**
 * Verifies that the actual <code>{@link List}</code> ends with the given sequence of objects, without any other
 * objects between them. Same as <code>{@link #containsSequence}</code>, but verifies also that last given object is
 * also last element of {@code List}.
 * @param sequence the sequence of objects to look for.
 * @return this assertion object.
 * @throws AssertionError if the actual {@code List} is {@code null}.
 * @throws AssertionError if the given array is {@code null}.
 * @throws AssertionError if the actual {@code List} is not empty and with the given sequence of objects is
 * empty.
 * @throws AssertionError if the actual {@code List} does not end with the given sequence of objects.
 */
public ListAssert endsWith(Object... sequence) {
 isNotNull();
 validateIsNotNull(sequence);
 int sequenceSize = sequence.length;
 int listSize = actualGroupSize();
 if (sequenceSize == 0 && listSize == 0) return this;
 if (sequenceSize == 0 && listSize != 0) failIfNotEndingWithSequence(sequence);
 if (listSize < sequenceSize) failIfNotEndingWithSequence(sequence);
 for (int i = 0; i < sequenceSize; i++) {
  int sequenceIndex = sequenceSize - 1 - i;
  int listIndex = listSize - 1 - i;
  if (!areEqual(sequence[sequenceIndex], actual.get(listIndex))) failIfNotEndingWithSequence(sequence);
 }
 return this;
}
org.fest.assertionsListAssertfailIfNotEndingWithSequence

Popular methods of ListAssert

  • hasSize
  • isEmpty
  • containsOnly
  • as
  • containsExactly
    Verifies that the actual List contains the given objects, in the same order. This method works just
  • onProperty
    Creates a new instance of ListAssert whose target list contains the values of the given property nam
  • isEqualTo
  • contains
    Verifies that the actual List contains the given object at the given index.
  • isNotEmpty
  • describedAs
  • isNotNull
  • isNull
  • isNotNull,
  • isNull,
  • <init>,
  • actualGroupSize,
  • containsSequence,
  • excludes,
  • fail,
  • failElementNotFound,
  • failIfCustomMessageIsSet

Popular classes and methods

  • setScale (BigDecimal)
    Returns a new BigDecimal instance with the specified scale. If the new scale is greater than the old
  • startActivity (Activity)
  • getOriginalFilename (MultipartFile)
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • Path (java.nio.file)
  • MessageFormat (java.text)
    Produces concatenated messages in language-neutral way. New code should probably use java.util.Forma
  • SortedSet (java.util)
    A Set that further provides a total ordering on its elements. The elements are ordered using their C
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble

For IntelliJ IDEA,
Android Studio or Eclipse

  • Codota IntelliJ IDEA pluginCodota Android Studio pluginCode IndexSign in
  • EnterpriseFAQAboutContact Us
  • Terms of usePrivacy policyCodeboxFind Usages
Add Codota to your IDE (free)