Skip to content

Commit cea8f09

Browse files
committed
Merge branch 1.6 into 1.7
2 parents 0a4eb49 + 2a21e5f commit cea8f09

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

driver/src/test/java/org/neo4j/driver/v1/util/TemporalUtil.java

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import java.time.ZonedDateTime;
2929
import java.time.temporal.ChronoField;
3030
import java.time.temporal.ValueRange;
31+
import java.util.Collections;
3132
import java.util.Set;
3233
import java.util.concurrent.ThreadLocalRandom;
3334

@@ -41,9 +42,16 @@
4142
import static java.time.temporal.ChronoField.NANO_OF_SECOND;
4243
import static java.time.temporal.ChronoField.SECOND_OF_MINUTE;
4344
import static java.time.temporal.ChronoField.YEAR;
45+
import static java.util.stream.Collectors.toSet;
4446

4547
public final class TemporalUtil
4648
{
49+
/**
50+
* These zone ids were removed from the tz database and neo4j can re-map such ids to other ids.
51+
* For example "Canada/East-Saskatchewan" will be returned as "Canada/Saskatchewan".
52+
*/
53+
private static final Set<String> BLACKLISTED_ZONE_IDS = Collections.singleton( "Canada/East-Saskatchewan" );
54+
4755
private TemporalUtil()
4856
{
4957
}
@@ -106,7 +114,11 @@ private static ZoneOffset randomZoneOffset()
106114

107115
private static ZoneId randomZoneId()
108116
{
109-
Set<String> availableZoneIds = ZoneId.getAvailableZoneIds();
117+
Set<String> availableZoneIds = ZoneId.getAvailableZoneIds()
118+
.stream()
119+
.filter( id -> !BLACKLISTED_ZONE_IDS.contains( id ) )
120+
.collect( toSet() );
121+
110122
int randomIndex = random().nextInt( availableZoneIds.size() );
111123
int index = 0;
112124
for ( String id : availableZoneIds )

0 commit comments

Comments
 (0)