Skip to content

Glossary: Spring Boot Basics

Clock

Also written: java.time.Clock, Clock.fixed

The `java.time.Clock` object that `LocalDate.now(clock)` reads the current time from. Making it a Spring bean lets tests supply a clock fixed on one moment, such as a Saturday, so time-dependent code gives predictable results.

Where the book teaches it

Related terms

@BeanUnit test