@@ -70,6 +70,11 @@ Boolean testStorageObjectIsEmpty(ExtendedStorageProperties storage, ArrayList<St
70
70
} else {
71
71
assertNotNull (storage .getMaximumSlope (), "maximum_slope should not be null" );
72
72
}
73
+ if (!nonNullFields .contains ("preprocessed" )) {
74
+ assertNull (storage .getPreprocessed (), "preprocessed should be null" );
75
+ } else {
76
+ assertNotNull (storage .getPreprocessed (), "preprocessed should not be null" );
77
+ }
73
78
if (!nonNullFields .contains ("boundaries" )) {
74
79
assertNull (storage .getBoundaries (), "boundaries should be null" );
75
80
} else {
@@ -135,6 +140,8 @@ void testSetBoundaries() {
135
140
assertEquals (Path .of ("" ), storage .getBoundaries ());
136
141
}
137
142
143
+
144
+
138
145
@ Test
139
146
void testSetIds () {
140
147
HelperClass storage = new HelperClass ();
@@ -421,16 +428,18 @@ void assertSetHereTrafficPathLogic(String streets, String refPattern, String pat
421
428
422
429
// Same for borders
423
430
@ ParameterizedTest
424
- @ CsvSource ({"'', '', ''" , // All paths null
425
- "'/custom/path.csv', '', ''" , // Only boundaries set
426
- "'', '/custom/path.csv', ''" , // Only ids set
427
- "'', '', '/custom/path.csv'" , // Only openborders set
428
- "'/custom/path.csv', '/custom/path.csv', ''" , // boundaries and ids set
429
- "'/custom/path.csv', '', '/custom/path.csv'" , // boundaries and openborders set
430
- "'', '/custom/path.csv', '/custom/path.csv'" , // ids and openborders set
431
- "'/custom/path.csv', '/custom/path.csv', '/custom/path.csv'" // All paths set -> Enabled!
431
+ @ CsvSource ({"'','', '', '', ''" , // All paths null
432
+ "'','/custom/path.csv', '', ''" , // Only boundaries set
433
+ "'','', '/custom/path.csv', ''" , // Only ids set
434
+ "'','', '', '/custom/path.csv'" , // Only openborders set
435
+ "'','/custom/path.csv', '/custom/path.csv', ''" , // boundaries and ids set
436
+ "'','/custom/path.csv', '', '/custom/path.csv'" , // boundaries and openborders set
437
+ "'','', '/custom/path.csv', '/custom/path.csv'" , // ids and openborders set
438
+ "'true','', '/custom/path.csv', '/custom/path.csv'" ,
439
+ "'','/custom/path.csv', '/custom/path.csv', '/custom/path.csv'" , // All paths set -> Enabled!
440
+ "'true','/custom/path.csv', '/custom/path.csv', '/custom/path.csv'"
432
441
})
433
- void assertSetBordersPathLogic (String boundaries , String ids , String openborders ) {
442
+ void assertSetBordersPathLogic (String preprocessed , String boundaries , String ids , String openborders ) {
434
443
ExtendedStorageProperties storage ;
435
444
// Test null values
436
445
storage = new ExtendedStorageProperties ();
@@ -439,13 +448,15 @@ void assertSetBordersPathLogic(String boundaries, String ids, String openborders
439
448
440
449
// Create JSON string based on parameters
441
450
storage = new ExtendedStorageProperties ();
451
+ var isPreprocessed = Boolean .parseBoolean (preprocessed );
452
+ storage .setPreprocessed (isPreprocessed );
442
453
storage .setBoundaries (Path .of (boundaries ));
443
454
storage .setIds (Path .of (ids ));
444
455
storage .setOpenborders (Path .of (openborders ));
445
456
storage .initialize (ExtendedStorageName .BORDERS );
446
457
447
458
// Check if storage is enabled or disabled based on paths
448
- boolean shouldBeEnabled = !boundaries .isEmpty () && !ids .isEmpty () && !openborders .isEmpty ();
459
+ boolean shouldBeEnabled = ( isPreprocessed || !boundaries .isEmpty () ) && !ids .isEmpty () && !openborders .isEmpty ();
449
460
assertEquals (shouldBeEnabled , storage .getEnabled (), "initialize should disable storage if one of the paths is null" );
450
461
451
462
// Check paths
@@ -471,6 +482,7 @@ void assertSetBordersPathLogic(String boundaries, String ids, String openborders
471
482
// Assert everything else was set to null
472
483
testStorageObjectIsEmpty (storage , new ArrayList <>() {{
473
484
add ("enabled" );
485
+ add ("preprocessed" );
474
486
add ("boundaries" );
475
487
add ("ids" );
476
488
add ("openborders" );
0 commit comments