Hamcrest 3.0 API
Matchers that can be combined to create flexible expressions of intent.
For example:
import org.junit.jupiter.api.Test;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.*;
public class BiscuitTest {
@Test
public void testEquals() {
Biscuit theBiscuit = new Biscuit("Ginger");
Biscuit myBiscuit = new Biscuit("Ginger");
assertThat(theBiscuit, equalTo(myBiscuit));
}
}
For more information and documentation, see:
- The Getting Started tutorial
- The source code on GitHub
Package
Description
Top level matcher classes and interfaces.
Matchers of Java Bean properties and their values.
Matchers of arrays and collections.
Helper classes for building matcher comparators.
Fundamental matchers of objects and values, and composite matchers.
Matchers that perform file comparisons.
Matchers that perform numeric comparisons.
Matchers that inspect objects and classes.
Matchers that perform text comparisons.
Matchers of XML documents.