Skip to content

Commit

Permalink
[aWATTar] Refactor AwattarBestPriceTest and AwattarApiTest by initial…
Browse files Browse the repository at this point in the history
…izing zoneId directly and removing unnecessary setup method

Signed-off-by: Thomas Leber <thomas@tl-photography.at>
  • Loading branch information
tl-photography committed Nov 10, 2024
1 parent 965b2df commit 0941f94
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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)
Expand Down Expand Up @@ -75,11 +74,6 @@ public synchronized SortedSet<AwattarPrice> getPrices() {
return prices;
}

@BeforeEach
public void setUp() {
zoneId = ZoneId.of("GMT");
}

@Test
void AwattarConsecutiveBestPriceResult() {
int length = 8;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 0941f94

Please sign in to comment.