@@ -1346,27 +1346,21 @@ fn get_tad_with_limit_and_filter_test() {
1346
1346
1347
1347
#[ test]
1348
1348
fn schema_jsons_test ( ) {
1349
+ let endpoints = vec ! [
1350
+ ( "/shipment-footprint.json" , schema_for!( ShipmentFootprint ) ) ,
1351
+ ( "/toc.json" , schema_for!( Toc ) ) ,
1352
+ ( "/hoc.json" , schema_for!( Hoc ) ) ,
1353
+ ] ;
1354
+
1349
1355
let client = & Client :: tracked ( create_server ( TEST_KEYPAIR . clone ( ) ) ) . unwrap ( ) ;
1350
1356
1351
- fn test_schema ( client : & Client , schema_url : & str , schema : RootSchema ) {
1352
- let schema_resp = client. get ( schema_url ) . dispatch ( ) ;
1357
+ for ( endpoint , schema) in endpoints {
1358
+ let schema_resp = client. get ( endpoint ) . dispatch ( ) ;
1353
1359
1354
1360
assert_eq ! ( schema_resp. status( ) , rocket:: http:: Status :: Ok ) ;
1355
1361
1356
1362
let fetched_schema = schema_resp. into_json :: < RootSchema > ( ) ;
1357
1363
1358
1364
assert_eq ! ( fetched_schema. unwrap( ) , schema) ;
1359
1365
}
1360
-
1361
- let ship_foot_schema_url = "/shipment-footprint.json" ;
1362
- let ship_foot_schema = schema_for ! ( ShipmentFootprint ) ;
1363
- test_schema ( client, ship_foot_schema_url, ship_foot_schema) ;
1364
-
1365
- let toc_schema_url: & str = "/toc.json" ;
1366
- let toc_schema = schema_for ! ( Toc ) ;
1367
- test_schema ( client, toc_schema_url, toc_schema) ;
1368
-
1369
- let hoc_schema_url = "/hoc.json" ;
1370
- let hoc_schema = schema_for ! ( Hoc ) ;
1371
- test_schema ( client, hoc_schema_url, hoc_schema) ;
1372
1366
}
0 commit comments