updated generic.resoscript with more sensible names for the keyfield and tests

This commit is contained in:
Joshua Darnell 2020-02-27 17:11:38 -08:00
parent 1de4748b12
commit 451ecf00bf
4 changed files with 15 additions and 16 deletions

Binary file not shown.

View File

@ -82,12 +82,11 @@
<!-- REQUIRED: OData $select list - adapt this for your system and then adjust the remaining queries accordingly -->
<Parameter Name="SelectList" Value="ListingKey,BedroomsTotal,StreetName,PropertyType,ModificationTimestamp" />
<!-- REQUIRED: Substitute key name from your EndpointMetadata here, either ListingKey or ListingKeyInteger,
which requires rewriting some of the queries that follow... -->
<Parameter Name="UniqueID" Value="ListingKey" />
<!-- REQUIRED: Substitute key name from your Resource here, either Key or KeyNumeric -->
<Parameter Name="KeyOrKeyNumericField" Value="ListingKey" />
<!-- REQUIRED: Provide a value for the UniqueID from your server -->
<Parameter Name="UniqueIDValue" Value="REQUIRED: YOUR UniqueIDValue GOES HERE" />
<!-- REQUIRED: Provide a value for the KeyOrKeyNumeric from your server -->
<Parameter Name="KeyOrKeyNumericValue" Value="REQUIRED: YOUR KeyOrKeyNumericValue GOES HERE" />
<!-- For Top, Skip, and Sort Testing -->
<Parameter Name="TopCount" Value="5" />
@ -200,13 +199,13 @@
/>
<Request
TestDescription="Search Parameters: Select UniqueID"
TestDescription="Search Parameters: Select KeyOrKeyNumeric Field"
RequirementId="REQ-WA103-QR1"
MetallicLevel="Core"
Capability="Query functions"
WebAPIReference="2.4.1"
OutputFile="REQ-WA103-QR1.json"
Url="*ClientSettings_WebAPIURI*/*Parameter_EndpointResource*(*Parameter_UniqueIDValue*)?$select=*Parameter_UniqueID*"
Url="*ClientSettings_WebAPIURI*/*Parameter_EndpointResource*(*Parameter_KeyOrKeyNumericValue*)?$select=*Parameter_KeyOrKeyNumericField*"
/>
<Request
@ -416,7 +415,7 @@
Capability="Query functions"
WebAPIReference="2.4.9"
OutputFile="REQ-WA103-QM7.json"
Url="*ClientSettings_WebAPIURI*/*Parameter_EndpointResource*?$top=*Parameter_TopCount*&amp;$select=*Parameter_UniqueID*,*Parameter_SingleValueLookupField*&amp;$filter=*Parameter_SingleValueLookupField* ne null and *Parameter_SingleValueLookupField* has *Parameter_SingleValueLookupValue**Parameter_RequiredParameters*"
Url="*ClientSettings_WebAPIURI*/*Parameter_EndpointResource*?$top=*Parameter_TopCount*&amp;$select=*Parameter_KeyOrKeyNumericField*,*Parameter_SingleValueLookupField*&amp;$filter=*Parameter_SingleValueLookupField* ne null and *Parameter_SingleValueLookupField* has *Parameter_SingleValueLookupValue**Parameter_RequiredParameters*"
/>
<Request
@ -426,7 +425,7 @@
Capability="Query functions"
WebAPIReference="2.4.10"
OutputFile="REQ-WA103-QM8.json"
Url="*ClientSettings_WebAPIURI*/*Parameter_EndpointResource*?$top=*Parameter_TopCount*&amp;$select=*Parameter_UniqueID*,*Parameter_MultipleValueLookupField*&amp;$filter=*Parameter_MultipleValueLookupField* ne null and *Parameter_MultipleValueLookupField* has *Parameter_MultipleValueLookupValue1**Parameter_RequiredParameters*"
Url="*ClientSettings_WebAPIURI*/*Parameter_EndpointResource*?$top=*Parameter_TopCount*&amp;$select=*Parameter_KeyOrKeyNumericField*,*Parameter_MultipleValueLookupField*&amp;$filter=*Parameter_MultipleValueLookupField* ne null and *Parameter_MultipleValueLookupField* has *Parameter_MultipleValueLookupValue1**Parameter_RequiredParameters*"
/>
<Request
@ -436,7 +435,7 @@
Capability="Query functions"
WebAPIReference="2.4.10"
OutputFile="REQ-WA103-QM8_Enum_MVL_Multi.json"
Url="*ClientSettings_WebAPIURI*/*Parameter_EndpointResource*?$top=*Parameter_TopCount*&amp;$select=*Parameter_UniqueID*,*Parameter_MultipleValueLookupField*&amp;$filter=*Parameter_MultipleValueLookupField* ne null and *Parameter_MultipleValueLookupField* has *Parameter_MultipleValueLookupValue1* and *Parameter_MultipleValueLookupField* has *Parameter_MultipleValueLookupValue2**Parameter_RequiredParameters*"
Url="*ClientSettings_WebAPIURI*/*Parameter_EndpointResource*?$top=*Parameter_TopCount*&amp;$select=*Parameter_KeyOrKeyNumericField*,*Parameter_MultipleValueLookupField*&amp;$filter=*Parameter_MultipleValueLookupField* ne null and *Parameter_MultipleValueLookupField* has *Parameter_MultipleValueLookupValue1* and *Parameter_MultipleValueLookupField* has *Parameter_MultipleValueLookupValue2**Parameter_RequiredParameters*"
/>
<Request

View File

@ -23,12 +23,12 @@ Feature: Web API Server 1.0.2 Certification
And the results match the expected DataSystem JSON schema
@REQ-WA103-QR1 @core @2.4.1 @query-functions-endorsement
Scenario: Search Parameters: Select UniqueID
Scenario: Search Parameters: Select KeyOrKeyNumeric Field
When a GET request is made to the resolved Url in "REQ-WA103-QR1"
Then the server responds with a status code of 200
And the response is valid JSON
And the response has singleton results in the "Parameter_UniqueID" field
And the provided "Parameter_UniqueIDValue" is returned in the "Parameter_UniqueID" field
And the response has singleton results in "Parameter_KeyOrKeyNumericField"
And the provided "Parameter_KeyOrKeyNumericValue" is returned in "Parameter_KeyOrKeyNumericField"
@REQ-WA103-QR3 @core @2.4.2 @query-functions-endorsement
Scenario: Query Support: $select
@ -56,7 +56,7 @@ Feature: Web API Server 1.0.2 Certification
Then the server responds with a status code of 200
And the response is valid JSON
And the response has results
And data in the "Parameter_UniqueId" fields are different in the second request than in the first
And data in the "Parameter_KeyOrKeyNumeric" fields are different in the second request than in the first
@REQ-WA103-QO1.1 @REQ-WA103-QO1.select @core @2.4.4 @core-endorsement @OData-4.0
Scenario: Query Support: $select case-sensitivity for OData 4.0

View File

@ -195,7 +195,7 @@ public class WebAPIServer_1_0_2 implements En {
/*
* REQ-WA103-QR1
*/
And("^the provided \"([^\"]*)\" is returned in the \"([^\"]*)\" field$", (String parameterUniqueIdValue, String parameterUniqueId) -> {
And("^the provided \"([^\"]*)\" is returned in \"([^\"]*)\"$", (String parameterUniqueIdValue, String parameterUniqueId) -> {
String expectedValueAsString = Utils.resolveValue(parameterUniqueIdValue, settings), resolvedValueAsString = null;
Object resolvedValue = from(responseData.get()).get(Utils.resolveValue(parameterUniqueId, settings));
@ -391,7 +391,7 @@ public class WebAPIServer_1_0_2 implements En {
/*
* True if data are present in the response
*/
And("^the response has singleton results in the \"([^\"]*)\" field$", (String parameterFieldName) -> {
And("^the response has singleton results in \"([^\"]*)\"", (String parameterFieldName) -> {
String value = Utils.resolveValue(parameterFieldName, settings);
boolean isPresent = from(responseData.get()).get() != null && value != null;
LOG.info("Response value is: " + value);