@@ -1278,9 +1278,6 @@ protected void testGetFoisByID(int... foiNums) throws Exception
1278
1278
for (int i =0 ; i <nodes .getLength (); i ++)
1279
1279
{
1280
1280
var elt = (Element )nodes .item (i );
1281
- int id = Integer .parseInt (dom .getAttributeValue (elt , "id" ).replace ("F" , "" ));
1282
- assertTrue (Arrays .binarySearch (foiNums , id ) >= 0 );
1283
-
1284
1281
String uid = dom .getElementValue (elt , "identifier" );
1285
1282
assertTrue (req .getFoiIDs ().contains (uid ));
1286
1283
}
@@ -1308,22 +1305,15 @@ public void testGetFoisByBbox() throws Exception
1308
1305
}
1309
1306
1310
1307
1311
- protected void testGetFoisByBbox (Bbox bbox , int ... foiNums ) throws Exception
1308
+ protected void testGetFoisByBbox (Bbox bbox , int ... expectedFoiNums ) throws Exception
1312
1309
{
1313
1310
GetFeatureOfInterestRequest req = new GetFeatureOfInterestRequest ();
1314
1311
req .setGetServer (HTTP_ENDPOINT );
1315
1312
req .setVersion ("2.0" );
1316
1313
req .setBbox (bbox );
1317
1314
1318
- DOMHelper dom = sendRequest (req , false );
1319
- assertEquals ("Wrong number of features returned" , foiNums .length , dom .getElements ("*/*" ).getLength ());
1320
-
1321
- NodeList nodes = dom .getElements ("*/*" );
1322
- for (int i =0 ; i <nodes .getLength (); i ++)
1323
- {
1324
- String fid = dom .getAttributeValue ((Element )nodes .item (i ), "id" );
1325
- assertEquals ("F" + foiNums [i ], fid );
1326
- }
1315
+ DOMHelper dom = sendRequest (req , false );
1316
+ checkReturnedFois (dom , expectedFoiNums );
1327
1317
}
1328
1318
1329
1319
@@ -1347,22 +1337,15 @@ public void testGetFoisByProcedure() throws Exception
1347
1337
}
1348
1338
1349
1339
1350
- protected void testGetFoisByProcedure (List <String > sysIDs , int ... foiNums ) throws Exception
1340
+ protected void testGetFoisByProcedure (List <String > sysIDs , int ... expectedFoiNums ) throws Exception
1351
1341
{
1352
1342
GetFeatureOfInterestRequest req = new GetFeatureOfInterestRequest ();
1353
1343
req .setGetServer (HTTP_ENDPOINT );
1354
1344
req .setVersion ("2.0" );
1355
1345
req .getProcedures ().addAll (sysIDs );
1356
1346
1357
- DOMHelper dom = sendRequest (req , false );
1358
- assertEquals ("Wrong number of features returned" , foiNums .length , dom .getElements ("*/*" ).getLength ());
1359
-
1360
- NodeList nodes = dom .getElements ("*/*" );
1361
- for (int i =0 ; i <nodes .getLength (); i ++)
1362
- {
1363
- String fid = dom .getAttributeValue ((Element )nodes .item (i ), "id" );
1364
- assertEquals ("F" + foiNums [i ], fid );
1365
- }
1347
+ DOMHelper dom = sendRequest (req , false );
1348
+ checkReturnedFois (dom , expectedFoiNums );
1366
1349
}
1367
1350
1368
1351
@@ -1388,21 +1371,28 @@ public void testGetFoisByObservables() throws Exception
1388
1371
}
1389
1372
1390
1373
1391
- protected void testGetFoisByObservables (List <String > obsIDs , int ... foiNums ) throws Exception
1374
+ protected void testGetFoisByObservables (List <String > obsIDs , int ... expectedFoiNums ) throws Exception
1392
1375
{
1393
1376
GetFeatureOfInterestRequest req = new GetFeatureOfInterestRequest ();
1394
1377
req .setGetServer (HTTP_ENDPOINT );
1395
1378
req .setVersion ("2.0" );
1396
1379
req .getObservables ().addAll (obsIDs );
1397
1380
1398
1381
DOMHelper dom = sendRequest (req , false );
1399
- assertEquals ("Wrong number of features returned" , foiNums .length , dom .getElements ("*/*" ).getLength ());
1382
+ checkReturnedFois (dom , expectedFoiNums );
1383
+ }
1384
+
1385
+
1386
+ protected void checkReturnedFois (DOMHelper dom , int ... expectedFoiNums )
1387
+ {
1388
+ assertEquals ("Wrong number of features returned" , expectedFoiNums .length , dom .getElements ("*/*" ).getLength ());
1400
1389
1401
1390
NodeList nodes = dom .getElements ("*/*" );
1402
1391
for (int i =0 ; i <nodes .getLength (); i ++)
1403
1392
{
1404
- String fid = dom .getAttributeValue ((Element )nodes .item (i ), "id" );
1405
- assertEquals ("F" + foiNums [i ], fid );
1393
+ var uid = dom .getElementValue ((Element )nodes .item (i ), "identifier" );
1394
+ var expectedUid = getFoiUID (expectedFoiNums [i ]);
1395
+ assertEquals (expectedUid , uid );
1406
1396
}
1407
1397
}
1408
1398
0 commit comments