Welcome to your wiki!
This is the default page, edit it as you see fit. To add a new page simply reference it within brackets, e.g.: [SamplePage].
The wiki uses Markdown syntax.
This module freezes the current time, but be careful this only works with Jodatime.
<dependency> <groupId>org.unitils.jodatime</groupId> <artifactId>unitils-jodatime</artifactId> <version>1.0.1</version> </dependency>
unitils.modules= database, easymock, datetime unitils.module.datetime.className = org.unitils.jodatime.JodaTimeModule unitils.module.datetime.runAfter = unitils.module.datetime.enabled = true
How does it work? There are 2 annotations:
@RunWith(UnitilsJUnit4TestClassRunner.class) public class TestClass1 { @FixedDateTime(datetime="02/02/2005") @Test public void testFixedDateTime() { //the current date should be 2 february 2005 } @OffsetDateTime(days=1) @Test public void testOffsetDateTime() throws Exception { //the current date should be the date from tomorrow. } }
Log in to post a comment.
Unitils Jodatime Module
This module freezes the current time, but be careful this only works with Jodatime.
Jodatime Module load artifact (maven)
Jodatime Module project config
How does it work?
There are 2 annotations:
Example
Last edit: Willemijn Wouters 2014-01-07