Hi all,
Fest Eclipse plugin has been released few days ago, it allows you to generate easily assertions specific to your classes.
See the documentation here : http://joel-costigliola.github.com/fest-eclipse-plugin/
For maven users, we provide a maven plugin to generate assertions.
Second announce is the release of version 1.1.0 of Fest assertions for Joda Time, it is now available in maven central repository.
project and doc : https://github.com/joel-costigliola/fest-joda-time-assert.
One can now compare DateTime and LocalDateTime ignoring millisecond to hour fields in comparison, see the examples below :
// comparing DateTime ignoring milliseconds.
DateTime dateTime1 = new DateTime(2000, 1, 1, 0, 0, 1, 0, UTC);
DateTime dateTime2 = new DateTime(2000, 1, 1, 0, 0, 1, 456, UTC);
assertThat(dateTime1).isEqualToIgnoringMillis(dateTime2); // OK
// comparing DateTime ignoring hours, minutes, seconds and milliseconds.
DateTime dateTime1 = new DateTime(2000, 1, 1, 23, 59, 59, 999);
DateTime dateTime2 = new DateTime(2000, 1, 1, 00, 00, 00, 000);
assertThat(dateTime1).isEqualToIgnoringHours(dateTime2); // OK
maven coordinates :
<dependency>
<groupId>org.easytesting</groupId>
<artifactId>fest-joda-time-assert</artifactId>
<version>1.1.0</version>
</dependency>
Have good assertions !
Joel