Mock Java Date/Time for Testing

Referencing the current date/time in your source code makes testing pretty difficult. You have to exclude such references from your assertions, which is not a trivial task to complete.

Time mocking is a viable solution to avoiding current time inconveniences during testing, which can be accomplished by using the new Java 8 Date/Time API (JSR 310).

Spring Boot – Unit Test your project architecture with ArchUnit

When building software, it's common for development teams to define a set of guidelines and code conventions that are considered best practices.

These are practices that are generally documented and communicated to the entire development team that has accepted them. However, during development, developers can violate these guidelines which are discovered during code reviews or with code quality checking tools.