Hamcrest Date adds Java 8 Support

Hamcrest Date adds Java 8 Support

On October 31, 2015, Posted by , In Uncategorized, With No Comments

An major update to the hamcrest-date library has been released that adds support for matching Java 8 date types using hamcrest. For example:

LocalDate today = LocalDate.now(); myBirthday = LocalDate.of(2015, AUGUST, 9);
assertThat(today, within(1, DAY, myBirthday));

The library is available from maven by adding the below to your pom;

<dependency>
<groupId>org.exparity</groupId>
<artifactId>hamcrest-date</artifactId>
<version>2.0.1</version>
</dependency>

Source code and complete documentation is at github

Leave a Reply

Your email address will not be published. Required fields are marked *