File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
driver/src/test/java/org/neo4j/driver/v1/util Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change 28
28
import java .time .ZonedDateTime ;
29
29
import java .time .temporal .ChronoField ;
30
30
import java .time .temporal .ValueRange ;
31
+ import java .util .Collections ;
31
32
import java .util .Set ;
32
33
import java .util .concurrent .ThreadLocalRandom ;
33
34
41
42
import static java .time .temporal .ChronoField .NANO_OF_SECOND ;
42
43
import static java .time .temporal .ChronoField .SECOND_OF_MINUTE ;
43
44
import static java .time .temporal .ChronoField .YEAR ;
45
+ import static java .util .stream .Collectors .toSet ;
44
46
45
47
public final class TemporalUtil
46
48
{
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
+
47
55
private TemporalUtil ()
48
56
{
49
57
}
@@ -106,7 +114,11 @@ private static ZoneOffset randomZoneOffset()
106
114
107
115
private static ZoneId randomZoneId ()
108
116
{
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
+
110
122
int randomIndex = random ().nextInt ( availableZoneIds .size () );
111
123
int index = 0 ;
112
124
for ( String id : availableZoneIds )
You can’t perform that action at this time.
0 commit comments