Skip to content
This repository has been archived by the owner on Mar 29, 2020. It is now read-only.

Latest commit

 

History

History
26 lines (16 loc) · 926 Bytes

File metadata and controls

26 lines (16 loc) · 926 Bytes

SoftwareMill Test Util

Maven dependency:

<dependency>
    <groupId>com.softwaremill.common</groupId>
    <artifactId>softwaremill-test-util</artifactId>
    <version>70</version>
</dependency>

TimeAssertions

Provides assertions like FEST Assert for org.joda.time.DateTime and java.util.Date classes. Examples

TimeAssertions.assertTime(dateTime).isBefore(laterDateTime);

Comparison methods are isBefore, isBeforeOrAt, isAfter, isAfterOrAt. It works for org.joda.time.DateTime and java.util.Date. You can freely exchange them, i.e. compare joda to joda, joda to java, java to java etc.

You can also compare joda LocalDateTime, but only to instance of the same class, as it doesn't make sense to compare LocalDateTime to DateTime or java.util.Date.

Method name is assertTime not assertThat so that you could statically import it. You can't statically import two methods with the same name.