diff --git a/src/tests/EdFi.DataManagementService.Tests.E2E/Features/Entities/AbstractEntityValidation.feature b/src/tests/EdFi.DataManagementService.Tests.E2E/Features/Entities/AbstractEntityValidation.feature index d15562590..00309b851 100644 --- a/src/tests/EdFi.DataManagementService.Tests.E2E/Features/Entities/AbstractEntityValidation.feature +++ b/src/tests/EdFi.DataManagementService.Tests.E2E/Features/Entities/AbstractEntityValidation.feature @@ -2,24 +2,24 @@ Feature: Reject client requests for abstract entities #@ignore Scenario: 01 Ensure that clients cannot POST an abstract entity (Education Organizations) - When a POST request is made to "/ed-fi/educationOrganizations" with + When a POST request is made to "ed-fi/educationOrganizations" with """ """ Then it should respond with 404 #@ignore Scenario: 02 Ensure that clients cannot POST an abstract entity (General Student Program Association) - When a POST request is made to "/ed-fi/generalStudentProgramAssociations" with + When a POST request is made to "ed-fi/generalStudentProgramAssociations" with """ """ Then it should respond with 404 #@ignore Scenario: 03 Ensure that clients cannot GET an abstract entity (Education Organizations) - When a GET request is made to "/ed-fi/educationOrganizations" + When a GET request is made to "ed-fi/educationOrganizations" Then it should respond with 404 #@ignore Scenario: 04 Ensure that clients cannot GET an abstract entity (Student Program Association) - When a GET request is made to "/ed-fi/generalStudentProgramAssociations" + When a GET request is made to "ed-fi/generalStudentProgramAssociations" Then it should respond with 404 diff --git a/src/tests/EdFi.DataManagementService.Tests.E2E/Features/Entities/SchoolYearReferenceValidation.feature b/src/tests/EdFi.DataManagementService.Tests.E2E/Features/Entities/SchoolYearReferenceValidation.feature index f61d68795..e323bde7a 100644 --- a/src/tests/EdFi.DataManagementService.Tests.E2E/Features/Entities/SchoolYearReferenceValidation.feature +++ b/src/tests/EdFi.DataManagementService.Tests.E2E/Features/Entities/SchoolYearReferenceValidation.feature @@ -20,7 +20,7 @@ Feature: School Year Reference Validation | "451" | { "schoolId": 535 } | { "schoolYear": 2029 } | uri://ed-fi.org/CalendarTypeDescriptor#Student Specific | [] | Scenario: 01 Try creating a resource using a valid school year - When a POST request is made to "/ed-fi/calendars" with + When a POST request is made to "ed-fi/calendars" with """ { "calendarCode": "321", @@ -37,7 +37,7 @@ Feature: School Year Reference Validation Then it should respond with 200 or 201 Scenario: 02 Try creating a resource using an invalid school year - When a POST request is made to "/ed-fi/calendars" with + When a POST request is made to "ed-fi/calendars" with """ { "calendarCode": "325", @@ -64,7 +64,7 @@ Feature: School Year Reference Validation """ Scenario: 03 Try creating a CalendarDate using a valid Calendar reference - When a POST request is made to "/ed-fi/calendarDates" with + When a POST request is made to "ed-fi/calendarDates" with """ { "calendarReference": { @@ -83,7 +83,7 @@ Feature: School Year Reference Validation Then it should respond with 201 Scenario: 04 Try creating a CalendarDate using an invalid Calendar reference with an invalid School year - When a POST request is made to "/ed-fi/calendarDates" with + When a POST request is made to "ed-fi/calendarDates" with """ { "calendarReference": { diff --git a/src/tests/EdFi.DataManagementService.Tests.E2E/Features/References/DeleteReferenceValidation.feature b/src/tests/EdFi.DataManagementService.Tests.E2E/Features/References/DeleteReferenceValidation.feature index 24de8dbaa..680e9e034 100644 --- a/src/tests/EdFi.DataManagementService.Tests.E2E/Features/References/DeleteReferenceValidation.feature +++ b/src/tests/EdFi.DataManagementService.Tests.E2E/Features/References/DeleteReferenceValidation.feature @@ -126,7 +126,7 @@ Feature: Validation of DELETE requests that would cause a foreign key violation } """ - #@ignore + @ignore Scenario: 05 Ensure clients cannot delete a resource that is used by another items Given a POST request is made to "ed-fi/programs" with """ diff --git a/src/tests/EdFi.DataManagementService.Tests.E2E/Features/ResourceQueries/PagingQueryString.feature b/src/tests/EdFi.DataManagementService.Tests.E2E/Features/ResourceQueries/PagingQueryString.feature index 712a82288..6cb1628e6 100644 --- a/src/tests/EdFi.DataManagementService.Tests.E2E/Features/ResourceQueries/PagingQueryString.feature +++ b/src/tests/EdFi.DataManagementService.Tests.E2E/Features/ResourceQueries/PagingQueryString.feature @@ -10,7 +10,7 @@ Feature: Paging Support for GET requests for Ed-Fi Resources | 5 | School 5 | [ {"gradeLevelDescriptor": "uri://ed-fi.org/GradeLevelDescriptor#Postsecondary"} ] | [ {"educationOrganizationCategoryDescriptor": "uri://tpdm.ed-fi.org/EducationOrganizationCategoryDescriptor#Educator Preparation Provider"} ] | Scenario: 01 Ensure clients can get information when filtering by limit and and a valid offset - When a GET request is made to "/ed-fi/schools?offset=3&limit=5" + When a GET request is made to "ed-fi/schools?offset=3&limit=5" Then it should respond with 200 And the response body is """ @@ -49,7 +49,7 @@ Feature: Paging Support for GET requests for Ed-Fi Resources """ Scenario: 02 Ensure clients can get information when filtering by limit and offset greater than the total - When a GET request is made to "/ed-fi/schools?offset=6&limit=5" + When a GET request is made to "ed-fi/schools?offset=6&limit=5" Then it should respond with 200 And the response body is """ @@ -57,7 +57,7 @@ Feature: Paging Support for GET requests for Ed-Fi Resources """ Scenario: 03 Ensure clients can GET information when querying using an offset without providing any limit in the query string - When a GET request is made to "/ed-fi/schools?offset=4" + When a GET request is made to "ed-fi/schools?offset=4" Then it should respond with 200 And the response body is """ @@ -83,7 +83,7 @@ Feature: Paging Support for GET requests for Ed-Fi Resources # TODO GET by parameters @ignore Scenario: 04 Ensure clients can GET information when filtering with limits and properties - When a GET request is made to "/ed-fi/schools?nameOfInstitution=School+5&limit=2" + When a GET request is made to "ed-fi/schools?nameOfInstitution=School+5&limit=2" Then it should respond with 200 And the response body is """ diff --git a/src/tests/EdFi.DataManagementService.Tests.E2E/Features/ResourceQueries/TotalCountQueryString.feature b/src/tests/EdFi.DataManagementService.Tests.E2E/Features/ResourceQueries/TotalCountQueryString.feature index 521d4cc83..4976358c1 100644 --- a/src/tests/EdFi.DataManagementService.Tests.E2E/Features/ResourceQueries/TotalCountQueryString.feature +++ b/src/tests/EdFi.DataManagementService.Tests.E2E/Features/ResourceQueries/TotalCountQueryString.feature @@ -1,71 +1,71 @@ Feature: Query Strings handling for GET requests Rule: Testing without data - Background: - Given there are no schools + Background: + Given there are no schools Scenario: 01 Validate totalCount value when there are no existing schools in the Database - When a GET request is made to "/ed-fi/schools?totalCount=true" + When a GET request is made to "ed-fi/schools?totalCount=true" Then it should respond with 200 And the response headers includes total-count 0 Scenario: 02 Validate totalCount is not included when there are no existing schools in the Database and value equals to false - When a GET request is made to "/ed-fi/schools?totalCount=false" + When a GET request is made to "ed-fi/schools?totalCount=false" Then it should respond with 200 And the response headers does not include total-count Scenario: 03 Validate totalCount is not included when is not included in the URL - When a GET request is made to "/ed-fi/schools" + When a GET request is made to "ed-fi/schools" Then it should respond with 200 And the response headers does not include total-count - Rule: Thesting with data upload - Background: - Given the system has these "schools" - | schoolId | nameOfInstitution | gradeLevels | educationOrganizationCategories | - | 5 | School with max edorgId value | [ {"gradeLevelDescriptor": "uri://ed-fi.org/GradeLevelDescriptor#Tenth grade"} ] | [ {"educationOrganizationCategoryDescriptor": "uri://tpdm.ed-fi.org/EducationOrganizationCategoryDescriptor#School"} ] | - | 6 | UT Austin College of Education Under Graduate | [ {"gradeLevelDescriptor": "uri://ed-fi.org/GradeLevelDescriptor#Eleventh grade"} ] | [ {"educationOrganizationCategoryDescriptor": "uri://tpdm.ed-fi.org/EducationOrganizationCategoryDescriptor#School"} ] | - | 255901001 | Grand Bend High School | [ {"gradeLevelDescriptor": "uri://ed-fi.org/GradeLevelDescriptor#Tenth grade"} ] | [ {"educationOrganizationCategoryDescriptor": "uri://tpdm.ed-fi.org/EducationOrganizationCategoryDescriptor#School"} ] | - | 255901044 | Grand Bend Middle School | [ {"gradeLevelDescriptor": "uri://ed-fi.org/GradeLevelDescriptor#Ninth grade"} ] | [ {"educationOrganizationCategoryDescriptor": "uri://tpdm.ed-fi.org/EducationOrganizationCategoryDescriptor#School"} ] | - | 255901045 | UT Austin Extended Campus | [ {"gradeLevelDescriptor": "uri://ed-fi.org/GradeLevelDescriptor#Twelfth grade"} ] | [ {"educationOrganizationCategoryDescriptor": "uri://tpdm.ed-fi.org/EducationOrganizationCategoryDescriptor#School"} ] | - - Scenario: 04 Ensure that schools return the total count - When a GET request is made to "/ed-fi/schools?totalCount=true" + Rule: Testing with data upload + Background: + Given the system has these "schools" + | schoolId | nameOfInstitution | gradeLevels | educationOrganizationCategories | + | 5 | School with max edorgId value | [ {"gradeLevelDescriptor": "uri://ed-fi.org/GradeLevelDescriptor#Tenth grade"} ] | [ {"educationOrganizationCategoryDescriptor": "uri://tpdm.ed-fi.org/EducationOrganizationCategoryDescriptor#School"} ] | + | 6 | UT Austin College of Education Under Graduate | [ {"gradeLevelDescriptor": "uri://ed-fi.org/GradeLevelDescriptor#Eleventh grade"} ] | [ {"educationOrganizationCategoryDescriptor": "uri://tpdm.ed-fi.org/EducationOrganizationCategoryDescriptor#School"} ] | + | 255901001 | Grand Bend High School | [ {"gradeLevelDescriptor": "uri://ed-fi.org/GradeLevelDescriptor#Tenth grade"} ] | [ {"educationOrganizationCategoryDescriptor": "uri://tpdm.ed-fi.org/EducationOrganizationCategoryDescriptor#School"} ] | + | 255901044 | Grand Bend Middle School | [ {"gradeLevelDescriptor": "uri://ed-fi.org/GradeLevelDescriptor#Ninth grade"} ] | [ {"educationOrganizationCategoryDescriptor": "uri://tpdm.ed-fi.org/EducationOrganizationCategoryDescriptor#School"} ] | + | 255901045 | UT Austin Extended Campus | [ {"gradeLevelDescriptor": "uri://ed-fi.org/GradeLevelDescriptor#Twelfth grade"} ] | [ {"educationOrganizationCategoryDescriptor": "uri://tpdm.ed-fi.org/EducationOrganizationCategoryDescriptor#School"} ] | + + Scenario: 04 Ensure that schools return the total count + When a GET request is made to "ed-fi/schools?totalCount=true" Then it should respond with 200 And the response headers includes total-count 5 Scenario: 05 Validate totalCount Header is not included when equals to false - When a GET request is made to "/ed-fi/schools?totalCount=false" + When a GET request is made to "ed-fi/schools?totalCount=false" Then it should respond with 200 And the response headers does not include total-count Scenario: 06 Validate totalCount is not included when it is not present in the URL - When a GET request is made to "/ed-fi/schools" + When a GET request is made to "ed-fi/schools" Then it should respond with 200 And the response headers does not include total-count Scenario: 07 Ensure results can be limited and totalCount matches the actual number of existing records - When a GET request is made to "/ed-fi/schools?totalCount=true&limit=2" + When a GET request is made to "ed-fi/schools?totalCount=true&limit=2" Then getting less schools than the total-count And the response headers includes total-count 5 Scenario: 08 Ensure clients can get information when filtering by limit and and a valid offset - When a GET request is made to "/ed-fi/schools?offset=3&limit=5" + When a GET request is made to "ed-fi/schools?offset=3&limit=5" Then it should respond with 200 And schools returned - | schoolId | nameOfInstitution | - | 255901044 | Grand Bend Middle School | - | 255901045 | UT Austin Extended Campus | + | schoolId | nameOfInstitution | + | 255901044 | Grand Bend Middle School | + | 255901045 | UT Austin Extended Campus | Scenario: 09 Ensure clients can get information when filtering by limit and offset greater than the total - When a GET request is made to "/ed-fi/schools?offset=6&limit=5" + When a GET request is made to "ed-fi/schools?offset=6&limit=5" Then it should respond with 200 And the response body is """ [] """ Scenario: 10 Ensure clients can't GET information when filtering using invalid values - When a GET request is made to "/ed-fi/schools?limit=-1" using values as + When a GET request is made to "ed-fi/schools?limit=-1" using values as | Values | | -1 | | 'zero' | @@ -89,7 +89,7 @@ Feature: Query Strings handling for GET requests """ Scenario: 11 Ensure clients can not GET information when filtering by limit and offset using invalid values - When a GET request is made to "/ed-fi/schools?offset=-1" using values as + When a GET request is made to "ed-fi/schools?offset=-1" using values as | Values | | -1 | | 'zero' | @@ -120,7 +120,7 @@ Feature: Query Strings handling for GET requests Given the following schools exist | schoolId | nameOfInstitution | gradeLevels | educationOrganizationCategories | | 5 | School with max edorgId value | [ "Postsecondary" ] | [ "School" ] | - When a GET request is made to "/ed-fi/schools?nameOfInstitution=school+with+max+edorgid+value" + When a GET request is made to "ed-fi/schools?nameOfInstitution=school+with+max+edorgid+value" Then it should respond with 200 And the response body includes "nameOfInstitution: School with max edorgId value" @@ -129,7 +129,7 @@ Feature: Query Strings handling for GET requests Given the following schools exist | schoolId | nameOfInstitution | gradeLevels | educationOrganizationCategories | | 6 | UT Austin College of Education Under Graduate | [ "Postsecondary" ] | [ "Educator Preparation Provider" ] | - When a GET request is made to "/ed-fi/schools?nameOfInstitution=UT+AUSTIN+COLLEGE+OF+EDUCATION+UNDER+GRADUATE" + When a GET request is made to "ed-fi/schools?nameOfInstitution=UT+AUSTIN+COLLEGE+OF+EDUCATION+UNDER+GRADUATE" Then it should respond with 200 And the response body includes "nameOfInstitution: UT Austin College of Education Under Graduate" @@ -138,13 +138,13 @@ Feature: Query Strings handling for GET requests Given the following schools exist | schoolId | nameOfInstitution | gradeLevels | educationOrganizationCategories | | 6 | UT Austin College of Education Under Graduate | [ "Postsecondary" ] | [ "Educator Preparation Provider" ] | - When a GET request is made to "/ed-fi/schools?nameOfInstitution=nonExisting+school" + When a GET request is made to "ed-fi/schools?nameOfInstitution=nonExisting+school" Then it should respond with 200 And the response body is """ [] """ - + ##I need a few more details on this scenario @ignore Scenario: 15 Ensure clients can't GET information when querying with filter and offset using limit without offset @@ -152,7 +152,7 @@ Feature: Query Strings handling for GET requests | schoolId | nameOfInstitution | | 5 | School with max edorgId value | | 6 | UT Austin College of Education Under Graduate | - When a GET request is made to "/ed-fi/schools?limit=-6&offset=-1" + When a GET request is made to "ed-fi/schools?limit=-6&offset=-1" Then it should respond with 400 And the response body is """ diff --git a/src/tests/EdFi.DataManagementService.Tests.E2E/Features/Resources/CreateResourcesValidation.feature b/src/tests/EdFi.DataManagementService.Tests.E2E/Features/Resources/CreateResourcesValidation.feature index c263db958..131b27172 100644 --- a/src/tests/EdFi.DataManagementService.Tests.E2E/Features/Resources/CreateResourcesValidation.feature +++ b/src/tests/EdFi.DataManagementService.Tests.E2E/Features/Resources/CreateResourcesValidation.feature @@ -22,7 +22,7 @@ Feature: Resources "Create" Operation validations And the response headers includes """ { - "location": "/ed-fi/absenceEventCategoryDescriptors/{id}" + "location": "ed-fi/absenceEventCategoryDescriptors/{id}" } """ And the record can be retrieved with a GET request @@ -787,7 +787,7 @@ Feature: Resources "Create" Operation validations And the response headers includes """ { - "location": "/ed-fi/schools/{id}" + "location": "ed-fi/schools/{id}" } """ And the record can be retrieved with a GET request diff --git a/src/tests/EdFi.DataManagementService.Tests.E2E/Features/Resources/DeleteResourcesValidation.feature b/src/tests/EdFi.DataManagementService.Tests.E2E/Features/Resources/DeleteResourcesValidation.feature index 1efde6a5e..ce5ec2e23 100644 --- a/src/tests/EdFi.DataManagementService.Tests.E2E/Features/Resources/DeleteResourcesValidation.feature +++ b/src/tests/EdFi.DataManagementService.Tests.E2E/Features/Resources/DeleteResourcesValidation.feature @@ -5,7 +5,7 @@ Feature: Resources "Delete" Operation validations Background: Given the Data Management Service must receive a token issued by "http://localhost" And user is already authorized - When a POST request is made to "/ed-fi/absenceEventCategoryDescriptors" with + When a POST request is made to "ed-fi/absenceEventCategoryDescriptors" with """ { "codeValue": "Sick Leave", @@ -19,25 +19,25 @@ Feature: Resources "Delete" Operation validations Then it should respond with 201 or 200 Scenario: 01 Verify deleting a specific resource by ID - When a DELETE request is made to "/ed-fi/absenceEventCategoryDescriptors/{id}" + When a DELETE request is made to "ed-fi/absenceEventCategoryDescriptors/{id}" Then it should respond with 204 Scenario: 02 Verify error handling when deleting using a invalid id - When a DELETE request is made to "/ed-fi/absenceEventCategoryDescriptors/00112233445566" + When a DELETE request is made to "ed-fi/absenceEventCategoryDescriptors/00112233445566" Then it should respond with 404 Scenario: 03 Verify error handling when deleting a non existing resource # The id value should be replaced with the resource created in the Background section - When a DELETE request is made to "/ed-fi/absenceEventCategoryDescriptors/{id}" + When a DELETE request is made to "ed-fi/absenceEventCategoryDescriptors/{id}" Then it should respond with 204 - When a DELETE request is made to "/ed-fi/absenceEventCategoryDescriptors/{id}" + When a DELETE request is made to "ed-fi/absenceEventCategoryDescriptors/{id}" Then it should respond with 404 Scenario: 04 Verify response code when GET a deleted resource # The id value should be replaced with the resource created in the Background section - When a DELETE request is made to "/ed-fi/absenceEventCategoryDescriptors/{id}" + When a DELETE request is made to "ed-fi/absenceEventCategoryDescriptors/{id}" Then it should respond with 204 - When a GET request is made to "/ed-fi/absenceEventCategoryDescriptors/{id}" + When a GET request is made to "ed-fi/absenceEventCategoryDescriptors/{id}" Then it should respond with 404 @@ -54,7 +54,7 @@ Feature: Resources "Delete" Operation validations | schoolReference | schoolYearTypeReference | gradingPeriodDescriptor | gradingPeriodName | beginDate | endDate | periodSequence | totalInstructionalDays | | {"schoolId": 4003} | {"schoolYear": 2022} | uri://ed-fi.org/GradingPeriodDescriptor#First Six Weeks | 2021-2022 Fall Semester Exam 1 | 2021-08-23 | 2021-10-03 | 1 | 29 | - When a DELETE request is made to referenced resource "/ed-fi/schools/{id}" + When a DELETE request is made to referenced resource "ed-fi/schools/{id}" Then it should respond with 409 And the response body is """ @@ -82,7 +82,7 @@ Feature: Resources "Delete" Operation validations | schoolReference | schoolYearTypeReference | gradingPeriodDescriptor | gradingPeriodName | beginDate | endDate | periodSequence | totalInstructionalDays | | {"schoolId": 4003} | {"schoolYear": 2022} | uri://ed-fi.org/GradingPeriodDescriptor#First Six Weeks | 2021-2022 Fall Semester Exam 1 | 2021-08-23 | 2021-10-03 | 1 | 29 | - When a DELETE request is made to referenced resource "/ed-fi/schoolYearTypes/{id}" + When a DELETE request is made to referenced resource "ed-fi/schoolYearTypes/{id}" Then it should respond with 409 And the response body is """ @@ -110,7 +110,7 @@ Feature: Resources "Delete" Operation validations | entryDate | schoolReference | studentReference | entryGradeLevelDescriptor | | 2021-07-23 | {"schoolId": 4005} | {"studentUniqueId": "987"} | uri://ed-fi.org/GradeLevelDescriptor#First grade | - When a DELETE request is made to referenced resource "/ed-fi/students/{id}" + When a DELETE request is made to referenced resource "ed-fi/students/{id}" Then it should respond with 409 And the response body is """ @@ -147,7 +147,7 @@ Feature: Resources "Delete" Operation validations | {"contactUniqueId": "123"} | {"studentUniqueId": "987"} | - When a DELETE request is made to referenced resource "/ed-fi/students/{id}" + When a DELETE request is made to referenced resource "ed-fi/students/{id}" Then it should respond with 409 And the response body is """ diff --git a/src/tests/EdFi.DataManagementService.Tests.E2E/StepDefinitions/StepDefinitions.cs b/src/tests/EdFi.DataManagementService.Tests.E2E/StepDefinitions/StepDefinitions.cs index 1208d7657..014ef1649 100644 --- a/src/tests/EdFi.DataManagementService.Tests.E2E/StepDefinitions/StepDefinitions.cs +++ b/src/tests/EdFi.DataManagementService.Tests.E2E/StepDefinitions/StepDefinitions.cs @@ -418,7 +418,7 @@ public void ThenTheResponseHeadersIncludes(string headers) _apiResponse .Headers[header.Key] .Should() - .EndWith("data" + header.Value.ToString().Replace("{id}", _id)); + .EndWith(header.Value.ToString().Replace("{id}", _id)); } }