net.thucydides.core.hamcrest.ContainsInOrderMatcher Maven / Gradle / Ivy
package net.thucydides.core.hamcrest;
import org.hamcrest.Description;
import org.hamcrest.TypeSafeMatcher;
import java.util.Arrays;
import java.util.List;
/**
* Check that a list of strings contains specific strings in a specific order.
*/
public class ContainsInOrderMatcher extends TypeSafeMatcher> {
private List values;
public ContainsInOrderMatcher(final String... values) {
this.values = Arrays.asList(values);
}
public boolean matchesSafely(final List orderedListOfValues) {
return values.equals(orderedListOfValues);
}
public void describeTo(final Description description) {
description.appendText("an ordered list containing ").appendText(values.toString());
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy