From e05d5ba84a6ded959f85eb058e68556197a07b85 Mon Sep 17 00:00:00 2001 From: Jacob Laursen Date: Sat, 9 Nov 2024 22:09:59 +0100 Subject: [PATCH] Simplify DateTimeType handling for deCONZ Signed-off-by: Jacob Laursen --- .../test/java/org/openhab/binding/deconz/DeconzTest.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/bundles/org.openhab.binding.deconz/src/test/java/org/openhab/binding/deconz/DeconzTest.java b/bundles/org.openhab.binding.deconz/src/test/java/org/openhab/binding/deconz/DeconzTest.java index e8eff1e7473..d17bd44e90c 100644 --- a/bundles/org.openhab.binding.deconz/src/test/java/org/openhab/binding/deconz/DeconzTest.java +++ b/bundles/org.openhab.binding.deconz/src/test/java/org/openhab/binding/deconz/DeconzTest.java @@ -19,8 +19,7 @@ import static org.mockito.Mockito.times; import java.io.IOException; import java.io.InputStream; import java.nio.charset.StandardCharsets; -import java.time.ZoneId; -import java.time.ZonedDateTime; +import java.time.Instant; import java.util.Map; import java.util.Objects; import java.util.Optional; @@ -119,10 +118,9 @@ public class DeconzTest { @Test public void dateTimeConversionTest() { DateTimeType dateTime = Util.convertTimestampToDateTime("2020-08-22T11:09Z"); - assertEquals(new DateTimeType(ZonedDateTime.parse("2020-08-22T11:09:00Z")), dateTime); + assertEquals(new DateTimeType(Instant.parse("2020-08-22T11:09:00Z")), dateTime); dateTime = Util.convertTimestampToDateTime("2020-08-22T11:09:47"); - assertEquals(new DateTimeType(ZonedDateTime.parse("2020-08-22T11:09:47Z")).toZone(ZoneId.systemDefault()), - dateTime); + assertEquals(new DateTimeType(Instant.parse("2020-08-22T11:09:47Z")), dateTime); } }