org.hamcrest.junit.MatcherAssert Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hamcrest-junit Show documentation
Show all versions of hamcrest-junit Show documentation
Classes to use Hamcrest matchers within JUnit tests
/* Copyright (c) 2000-2006 hamcrest.org
*/
package org.hamcrest.junit;
import org.hamcrest.Matcher;
import org.hamcrest.junit.internal.Matching;
import org.hamcrest.junit.internal.MismatchAction;
public class MatcherAssert {
public static void assertThat(T actual, Matcher super T> matcher) {
assertThat("", actual, matcher);
}
public static void assertThat(String message, T actual, Matcher super T> matcher) {
Matching.checkMatch(message, actual, matcher, new MismatchAction() {
@Override
public void mismatch(String description) {
throw new AssertionError(description);
}
});
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy