Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[profile] Removed failing timestamp offset test #2555

Merged
merged 1 commit into from
Nov 3, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.mockito.Mockito.*;

import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.ZoneOffset;
import java.util.Collection;
import java.util.HashMap;
Expand Down Expand Up @@ -48,13 +46,10 @@ public class TimestampOffsetProfileTest {
public static class ParameterSet {
public final long seconds;
public final @Nullable String timeZone;
public final ZoneOffset expectedZoneOffset;

public ParameterSet(long seconds, @Nullable String timeZone) {
this.seconds = seconds;
this.timeZone = timeZone;
this.expectedZoneOffset = timeZone == null ? ZoneOffset.UTC
: ZoneId.of(timeZone).getRules().getOffset(LocalDateTime.now());
}
}

Expand Down Expand Up @@ -121,7 +116,6 @@ public void testOnCommandFromHandler(ParameterSet parameterSet) {
DateTimeType updateResult = (DateTimeType) result;
DateTimeType expectedResult = new DateTimeType(
((DateTimeType) cmd).getZonedDateTime().plusSeconds(parameterSet.seconds));
assertEquals(parameterSet.expectedZoneOffset, updateResult.getZonedDateTime().getOffset());
String timeZone = parameterSet.timeZone;
if (timeZone != null) {
expectedResult = expectedResult.toZone(timeZone);
Expand All @@ -146,7 +140,6 @@ public void testOnStateUpdateFromHandler(ParameterSet parameterSet) {
DateTimeType updateResult = (DateTimeType) result;
DateTimeType expectedResult = new DateTimeType(
((DateTimeType) state).getZonedDateTime().plusSeconds(parameterSet.seconds));
assertEquals(parameterSet.expectedZoneOffset, updateResult.getZonedDateTime().getOffset());
String timeZone = parameterSet.timeZone;
if (timeZone != null) {
expectedResult = expectedResult.toZone(timeZone);
Expand Down