From 0941f94a8e00e7b0661eed05fa3c0179b347ae78 Mon Sep 17 00:00:00 2001 From: Thomas Leber Date: Sun, 10 Nov 2024 23:22:17 +0100 Subject: [PATCH] [aWATTar] Refactor AwattarBestPriceTest and AwattarApiTest by initializing zoneId directly and removing unnecessary setup method Signed-off-by: Thomas Leber --- .../binding/awattar/internal/AwattarBestPriceTest.java | 8 +------- .../binding/awattar/internal/api/AwattarApiTest.java | 2 -- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/bundles/org.openhab.binding.awattar/src/test/java/org/openhab/binding/awattar/internal/AwattarBestPriceTest.java b/bundles/org.openhab.binding.awattar/src/test/java/org/openhab/binding/awattar/internal/AwattarBestPriceTest.java index c818985cbf00b..b180f11482a1d 100644 --- a/bundles/org.openhab.binding.awattar/src/test/java/org/openhab/binding/awattar/internal/AwattarBestPriceTest.java +++ b/bundles/org.openhab.binding.awattar/src/test/java/org/openhab/binding/awattar/internal/AwattarBestPriceTest.java @@ -25,7 +25,6 @@ import java.util.SortedSet; import java.util.TreeSet; -import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.openhab.binding.awattar.internal.handler.TimeRange; @@ -37,7 +36,7 @@ */ public class AwattarBestPriceTest { - private ZoneId zoneId; + private ZoneId zoneId = ZoneId.of("GMT"); public static ZonedDateTime getCalendarForHour(int hour, ZoneId zone) { return ZonedDateTime.ofInstant(Instant.ofEpochSecond(1731283200L), zone).truncatedTo(ChronoUnit.HOURS) @@ -75,11 +74,6 @@ public synchronized SortedSet getPrices() { return prices; } - @BeforeEach - public void setUp() { - zoneId = ZoneId.of("GMT"); - } - @Test void AwattarConsecutiveBestPriceResult() { int length = 8; diff --git a/bundles/org.openhab.binding.awattar/src/test/java/org/openhab/binding/awattar/internal/api/AwattarApiTest.java b/bundles/org.openhab.binding.awattar/src/test/java/org/openhab/binding/awattar/internal/api/AwattarApiTest.java index f543757746d5a..3d7d232f4d03e 100644 --- a/bundles/org.openhab.binding.awattar/src/test/java/org/openhab/binding/awattar/internal/api/AwattarApiTest.java +++ b/bundles/org.openhab.binding.awattar/src/test/java/org/openhab/binding/awattar/internal/api/AwattarApiTest.java @@ -45,8 +45,6 @@ import org.openhab.binding.awattar.internal.AwattarBridgeConfiguration; import org.openhab.binding.awattar.internal.AwattarPrice; import org.openhab.binding.awattar.internal.api.AwattarApi.AwattarApiException; -import org.openhab.binding.awattar.internal.handler.AwattarBridgeHandler; -import org.openhab.binding.awattar.internal.handler.AwattarBridgeHandlerTest; import org.openhab.core.i18n.TimeZoneProvider; import org.openhab.core.test.java.JavaTest;