openhab / openhab-addons

Add-ons for openHAB
https://www.openhab.org/
Eclipse Public License 2.0
1.9k stars 3.59k forks source link

Fix `DateTimeType` tests #17764

Closed jlaur closed 5 days ago

jlaur commented 1 week ago

This refactors a few tests that assume the time-zone being put into a DateTimeType will be the same as returned from getZonedDateTime() or used by format(). Also fixes a few tests mixing UTC and system time-zone.

These assumptions are still valid now, but if openhab/openhab-core#3583 is merged, they no longer will be. Therefore, this PR needs to be merged at latest at the same time to not break the build, but can be merged already now. Verifying these assumptions in addon tests provide no real value - this belongs to the core tests related to DateTimeType.

Prerequisite for openhab/openhab-core#3583 Also related to #17725 which simplifies DateTimeType logic if openhab/openhab-core#3583 is merged