Skip to content

Commit

Permalink
#505 fixing puzzle. the zone is specified within the string from its …
Browse files Browse the repository at this point in the history
…offset only. So the ZonedDateTime constructed from this only carries offset information. The test needed to be constructed to use a zoneid from its offset only to be equal.
  • Loading branch information
svendiedrichsen committed Dec 27, 2017
1 parent e36349a commit 8b5cd5c
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/test/java/org/cactoos/time/ZonedDateTimeOfTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@

import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.ZoneOffset;
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;
import org.hamcrest.MatcherAssert;
import org.hamcrest.Matchers;
import org.junit.Ignore;
import org.junit.Test;

/**
Expand All @@ -43,18 +43,15 @@
@SuppressWarnings("PMD.AvoidDuplicateLiterals")
public class ZonedDateTimeOfTest {

// @todo #504:30min This test fails for some reason and I can't
// understand what's wrong. Seems to be some issue with the Zone
// we are not detecting in the text.
@Test
@Ignore
public final void testParsingIsoFormattedStringToZonedDateTime() {
MatcherAssert.assertThat(
"Can't parse a ZonedDateTime with default/ISO format.",
new ZonedDateTimeOf("2017-12-13T14:15:16.000000017+01:00").value(),
Matchers.equalTo(
ZonedDateTime.of(
2017, 12, 13, 14, 15, 16, 17, ZoneId.of("Europe/Berlin")
2017, 12, 13, 14, 15, 16, 17,
ZoneId.ofOffset("", ZoneOffset.ofHours(1))
)
)
);
Expand Down

0 comments on commit 8b5cd5c

Please sign in to comment.