@@ -1278,9 +1278,6 @@ protected void testGetFoisByID(int... foiNums) throws Exception
12781278 for (int i =0 ; i <nodes .getLength (); i ++)
12791279 {
12801280 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-
12841281 String uid = dom .getElementValue (elt , "identifier" );
12851282 assertTrue (req .getFoiIDs ().contains (uid ));
12861283 }
@@ -1308,22 +1305,15 @@ public void testGetFoisByBbox() throws Exception
13081305 }
13091306
13101307
1311- protected void testGetFoisByBbox (Bbox bbox , int ... foiNums ) throws Exception
1308+ protected void testGetFoisByBbox (Bbox bbox , int ... expectedFoiNums ) throws Exception
13121309 {
13131310 GetFeatureOfInterestRequest req = new GetFeatureOfInterestRequest ();
13141311 req .setGetServer (HTTP_ENDPOINT );
13151312 req .setVersion ("2.0" );
13161313 req .setBbox (bbox );
13171314
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 );
13271317 }
13281318
13291319
@@ -1347,22 +1337,15 @@ public void testGetFoisByProcedure() throws Exception
13471337 }
13481338
13491339
1350- protected void testGetFoisByProcedure (List <String > sysIDs , int ... foiNums ) throws Exception
1340+ protected void testGetFoisByProcedure (List <String > sysIDs , int ... expectedFoiNums ) throws Exception
13511341 {
13521342 GetFeatureOfInterestRequest req = new GetFeatureOfInterestRequest ();
13531343 req .setGetServer (HTTP_ENDPOINT );
13541344 req .setVersion ("2.0" );
13551345 req .getProcedures ().addAll (sysIDs );
13561346
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 );
13661349 }
13671350
13681351
@@ -1388,21 +1371,28 @@ public void testGetFoisByObservables() throws Exception
13881371 }
13891372
13901373
1391- protected void testGetFoisByObservables (List <String > obsIDs , int ... foiNums ) throws Exception
1374+ protected void testGetFoisByObservables (List <String > obsIDs , int ... expectedFoiNums ) throws Exception
13921375 {
13931376 GetFeatureOfInterestRequest req = new GetFeatureOfInterestRequest ();
13941377 req .setGetServer (HTTP_ENDPOINT );
13951378 req .setVersion ("2.0" );
13961379 req .getObservables ().addAll (obsIDs );
13971380
13981381 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 ());
14001389
14011390 NodeList nodes = dom .getElements ("*/*" );
14021391 for (int i =0 ; i <nodes .getLength (); i ++)
14031392 {
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 );
14061396 }
14071397 }
14081398
0 commit comments