Skip to content

Commit

Permalink
#8 - set limit parameter to 5 and 15 to avoid large responses and red…
Browse files Browse the repository at this point in the history
…uce the number of tests, added assert for number of features in the response
  • Loading branch information
lgoltz committed Jul 2, 2018
1 parent 3abce14 commit 17dbccd
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,11 @@ public Object[][] collectionItemUris( ITestContext testContext ) {
@DataProvider(name = "collectionItemUrisWithLimit")
public Object[][] collectionItemUrisWithLimits( ITestContext testContext ) {
// TODO: find values between min and max described in OpenApi document (per collection)
Object[][] collectionsData = new Object[collections.size() * 3][];
Object[][] collectionsData = new Object[collections.size() * 2][];
int i = 0;
for ( Map<String, Object> collection : collections ) {
collectionsData[i++] = new Object[] { collection, 5 };
collectionsData[i++] = new Object[] { collection, 100 };
collectionsData[i++] = new Object[] { collection, 1000 };
collectionsData[i++] = new Object[] { collection, 15 };
}
return collectionsData;
}
Expand Down Expand Up @@ -394,11 +393,13 @@ public void validateLimitParameter_requests( Map<String, Object> collection, int
Date timeStampAfterResponse = new Date();

JsonPath jsonPath = response.jsonPath();
int numberOfFeatures = jsonPath.getList( "features" ).size();
assertTrue( numberOfFeatures <= limit, "Number of features for collection with name " + collectionName
+ " is unexpected (was " + numberOfFeatures + "), expected are " + limit
+ " or less" );
assertTimeStamp( collectionName, jsonPath, timeStampBeforeResponse, timeStampAfterResponse );
assertNumberReturned( collectionName, jsonPath );
assertNumberMatched( collectionName, jsonPath );

// TODO: assert returned features
}

/**
Expand Down

0 comments on commit 17dbccd

Please sign in to comment.