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 27
27
import java .time .ZonedDateTime ;
28
28
import java .time .temporal .ChronoField ;
29
29
import java .time .temporal .ValueRange ;
30
+ import java .util .Collections ;
30
31
import java .util .Set ;
31
32
import java .util .concurrent .ThreadLocalRandom ;
32
33
40
41
import static java .time .temporal .ChronoField .NANO_OF_SECOND ;
41
42
import static java .time .temporal .ChronoField .SECOND_OF_MINUTE ;
42
43
import static java .time .temporal .ChronoField .YEAR ;
44
+ import static java .util .stream .Collectors .toSet ;
43
45
44
46
public final class TemporalUtil
45
47
{
48
+ /**
49
+ * These zone ids were removed from the tz database and neo4j can re-map such ids to other ids.
50
+ * For example "Canada/East-Saskatchewan" will be returned as "Canada/Saskatchewan".
51
+ */
52
+ private static final Set <String > BLACKLISTED_ZONE_IDS = Collections .singleton ( "Canada/East-Saskatchewan" );
53
+
46
54
private TemporalUtil ()
47
55
{
48
56
}
@@ -100,7 +108,11 @@ private static ZoneOffset randomZoneOffset()
100
108
101
109
private static ZoneId randomZoneId ()
102
110
{
103
- Set <String > availableZoneIds = ZoneId .getAvailableZoneIds ();
111
+ Set <String > availableZoneIds = ZoneId .getAvailableZoneIds ()
112
+ .stream ()
113
+ .filter ( id -> !BLACKLISTED_ZONE_IDS .contains ( id ) )
114
+ .collect ( toSet () );
115
+
104
116
int randomIndex = random ().nextInt ( availableZoneIds .size () );
105
117
int index = 0 ;
106
118
for ( String id : availableZoneIds )
You can’t perform that action at this time.
0 commit comments