@@ -33,7 +33,10 @@ void testEmptyDeliveryMapValidation() {
3333 GbfsJsonValidator validator = new GbfsJsonValidator ();
3434 Map <String , InputStream > deliveryMap = new HashMap <>();
3535 ValidationResult result = validator .validate (deliveryMap );
36- Assertions .assertEquals (0 , result .getSummary ().getErrorsCount ());
36+
37+ // The expected error count is 2, because there are two required files
38+ // missing in an empty delivery, gbfs.json, and system_information.json
39+ Assertions .assertEquals (2 , result .getSummary ().getErrorsCount ());
3740 }
3841
3942 @ Test
@@ -42,6 +45,7 @@ void testSuccessfulV1_0Validation() {
4245
4346 Map <String , InputStream > deliveryMap = new HashMap <>();
4447 deliveryMap .put ("gbfs" , getFixture ("fixtures/v1.0/gbfs.json" ));
48+ deliveryMap .put ("system_information" , getFixture ("fixtures/v1.0/system_information.json" ));
4549 deliveryMap .put ("system_hours" , getFixture ("fixtures/v1.0/system_hours.json" ));
4650
4751 ValidationResult result = validator .validate (deliveryMap );
@@ -59,6 +63,7 @@ void testSuccessfulV1_1Validation() {
5963 Map <String , InputStream > deliveryMap = new HashMap <>();
6064 deliveryMap .put ("gbfs" , getFixture ("fixtures/v1.1/gbfs.json" ));
6165 deliveryMap .put ("gbfs_versions" , getFixture ("fixtures/v1.1/gbfs_versions.json" ));
66+ deliveryMap .put ("system_information" , getFixture ("fixtures/v1.1/system_information.json" ));
6267 deliveryMap .put ("system_hours" , getFixture ("fixtures/v1.1/system_hours.json" ));
6368
6469 ValidationResult result = validator .validate (deliveryMap );
@@ -76,6 +81,7 @@ void testSuccessfulV2_0Validation() {
7681 Map <String , InputStream > deliveryMap = new HashMap <>();
7782 deliveryMap .put ("gbfs" , getFixture ("fixtures/v2.0/gbfs.json" ));
7883 deliveryMap .put ("gbfs_versions" , getFixture ("fixtures/v2.0/gbfs_versions.json" ));
84+ deliveryMap .put ("system_information" , getFixture ("fixtures/v2.0/system_information.json" ));
7985 deliveryMap .put ("system_hours" , getFixture ("fixtures/v2.0/system_hours.json" ));
8086
8187 ValidationResult result = validator .validate (deliveryMap );
@@ -214,6 +220,8 @@ void testMissingRequiredFile() {
214220
215221 Assertions .assertTrue (result .getFiles ().get ("system_information" ).isRequired ());
216222 Assertions .assertFalse (result .getFiles ().get ("system_information" ).isExists ());
223+
224+ Assertions .assertEquals (1 , result .getSummary ().getErrorsCount ());
217225 }
218226
219227 @ Test
@@ -235,11 +243,14 @@ void testMissingNotRequiredFile() {
235243
236244 Map <String , InputStream > deliveryMap = new HashMap <>();
237245 deliveryMap .put ("gbfs" , getFixture ("fixtures/v2.2/gbfs.json" ));
246+ deliveryMap .put ("system_information" , getFixture ("fixtures/v2.2/system_information.json" ));
238247
239248 ValidationResult result = validator .validate (deliveryMap );
240249
241250 Assertions .assertFalse (result .getFiles ().get ("vehicle_types" ).isRequired ());
242251 Assertions .assertFalse (result .getFiles ().get ("vehicle_types" ).isExists ());
252+
253+ Assertions .assertEquals (0 , result .getSummary ().getErrorsCount ());
243254 }
244255
245256 @ Test
0 commit comments