diff --git a/src/main/java/org/opengis/cite/wfs30/collections/GetFeaturesOperation.java b/src/main/java/org/opengis/cite/wfs30/collections/GetFeaturesOperation.java index da96bd31..7a994d99 100644 --- a/src/main/java/org/opengis/cite/wfs30/collections/GetFeaturesOperation.java +++ b/src/main/java/org/opengis/cite/wfs30/collections/GetFeaturesOperation.java @@ -298,7 +298,7 @@ public void validateGetFeaturesOperationResponse_property_numberMatched( Map */ - @Test(description = "Implements A.4.4.11. Limit Parameter (Requirement 18, 19)", dependsOnMethods = "validateGetFeaturesOperation") + @Test(description = "Implements A.4.4.11. Limit Parameter (Requirement 18)", dependsOnMethods = "validateGetFeaturesOperation") public void validateLimitParameter() { Parameter limit = apiModel.getParameter( "limit" ); assertNotNull( limit, "Required limit parameter in OpenAPI document is missing" ); @@ -335,6 +335,59 @@ public void validateLimitParameter() { assertIntegerGreaterZero( schema.getDefault(), "schema -> default" ); } + /** + * .4.4.12. Bounding Box Parameter (Test method 1) + * + * a) Test Purpose:Validate the proper handling of the bbox parameter. + * + * b) Pre-conditions: Tests A.4.4.9 and A.4.4.10 have completed successfully. + * + * c) Test Method: + * + * Verify that the OpenAPI document correctly describes the bbox parameter for the Get Features operation. + * + * d) References: Requirement 20 + * + * Expected parameter: + * + *
+     * name: bbox
+     * in: query
+     * required: false
+     * schema:
+     *   type: array
+     *   minItems: 4
+     *   maxItems: 6
+     *   items:
+     *     type: number
+     * style: form
+     * explode: false
+     * 
+ */ + @Test(description = "Implements A.4.4.12. Bounding Box (Requirement 20)", dependsOnMethods = "validateGetFeaturesOperation") + public void validateBboxParameter() { + Parameter limit = apiModel.getParameter( "bbox" ); + assertNotNull( limit, "Required bbox parameter in OpenAPI document is missing" ); + + String msg = "Expected property '%s' with value '%s' but was '%s'"; + + assertEquals( limit.getName(), "bbox", String.format( msg, "name", "limit", limit.getName() ) ); + assertEquals( limit.getIn(), "query", String.format( msg, "in", "query", limit.getIn() ) ); + assertFalse( limit.getRequired(), String.format( msg, "required", "false", limit.getRequired() ) ); + assertEquals( limit.getStyle(), "form", String.format( msg, "style", "form", limit.getStyle() ) ); + assertFalse( limit.getExplode(), String.format( msg, "explode", "false", limit.getExplode() ) ); + + Schema schema = limit.getSchema(); + assertEquals( schema.getType(), "array", String.format( msg, "schema -> type", "array", schema.getType() ) ); + assertEquals( schema.getMinItems().intValue(), 4, + String.format( msg, "schema -> minItems", "4", schema.getMinItems() ) ); + assertEquals( schema.getMaxItems().intValue(), 6, + String.format( msg, "schema -> maxItems", "6", schema.getMaxItems() ) ); + + String itemsType = schema.getItemsSchema().getType(); + assertEquals( itemsType, "number", String.format( msg, "schema -> items -> type", "number", itemsType ) ); + } + private String findGetFeatureUrlForGeoJson( Map collection ) { List links = (List) collection.get( "links" ); for ( Object linkObject : links ) { diff --git a/src/test/java/org/opengis/cite/wfs30/collections/GetFeaturesOperationIT.java b/src/test/java/org/opengis/cite/wfs30/collections/GetFeaturesOperationIT.java index 436d82af..65c14904 100644 --- a/src/test/java/org/opengis/cite/wfs30/collections/GetFeaturesOperationIT.java +++ b/src/test/java/org/opengis/cite/wfs30/collections/GetFeaturesOperationIT.java @@ -63,11 +63,15 @@ public void testGetFeatureOperations() Map parameter = (Map) collection[0]; getFeaturesOperation.validateGetFeaturesOperation( parameter ); getFeaturesOperation.validateGetFeaturesOperationResponse_Links( parameter ); - //skipped: getFeaturesOperation.validateGetFeaturesOperationResponse_property_timeStamp( parameter ); - //getFeaturesOperation.validateGetFeaturesOperationResponse_property_numberReturned( parameter ); - //getFeaturesOperation.validateGetFeaturesOperationResponse_property_numberMatched( parameter ); + // skipped (parameter missing): + // getFeaturesOperation.validateGetFeaturesOperationResponse_property_timeStamp( parameter ); + // skipped (parameter missing): + // getFeaturesOperation.validateGetFeaturesOperationResponse_property_numberReturned( parameter ); + // skipped (parameter missing): + // getFeaturesOperation.validateGetFeaturesOperationResponse_property_numberMatched( parameter ); } getFeaturesOperation.validateLimitParameter(); + // fails (schema->items->type missing): getFeaturesOperation.validateBboxParameter(); } }