If possible try to get the current timestamp from an injected java.time.{Clock/InstantSource}
. This makes testing easier since it is then possible to manipulate time (the infrastructure is already in place). Hopefully in the future this time manipulation is available during test data creation as well and maybe even test servers.
Integration tests have access to time manipulation via injecting an instance of MutableFixedClock
. This should allow you to set a specific date in either autumn or spring to get better assertions. Use Year.now(clock)
to get the correct year for the fixed date that's been set.
Integration tests have access to time manipulation via injecting an instance of MutableFixedClock
. This should allow you to set a specific date in either autumn or spring to get better assertions. Use Year.now(clock)
to get the correct year for the fixed date that's been set.
For the future it might be a good idea to add an overload to reduce the overall diff. It is also confusing to read method calls with many null
parameters.
Replace with ldModel.map(status -> getStatusMessage(status))
to not get stale information when refreshing the page.
Should use item.getModel().map(project -> ...)
again to prevent possibility of stale data.