Skip to content

Commit

Permalink
[ODS-6471] Add an test case for extension resource test profile (#1148)
Browse files Browse the repository at this point in the history
  • Loading branch information
axelmarquezh authored Sep 27, 2024
1 parent 57bda4c commit 1ecfb93
Show file tree
Hide file tree
Showing 2 changed files with 153 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Application/EdFi.Ods.Profiles.Test/Profiles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -909,6 +909,20 @@
</Resource>
</Profile>

<!-- Profile on a extension resource -->
<Profile name="Sample-StudentArtProgramAssociation-LogicalSchema-IncludeOnly">
<Resource name="StudentArtProgramAssociation" logicalSchema="Sample">
<ReadContentType memberSelection="IncludeOnly">
<Property name="BeginDate" />
<Property name="EducationOrganizationReference" />
<Property name="ProgramReference" />
<Property name="StudentReference" />
<Property name="PrivateArtProgram" />
<Collection name="StudentArtProgramAssociationStyles" memberSelection="IncludeAll" />
</ReadContentType>
</Resource>
</Profile>

<Profile name="Resource-with-excluded-required-reference">
<Resource name="CourseOffering">
<WriteContentType memberSelection="ExcludeOnly">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5703,6 +5703,51 @@
}
},
"response": []
},
{
"name": "Create StudentArtProgramAssociation",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test(\"Status code is 201\", () => {\r",
" pm.expect(pm.response.code).to.equal(201);\r",
"});\r",
"\r",
"pm.environment.set('known:studentArtProgramAssociation:id', pm.response.headers.one('Location').value.split(\"/\").pop());"
],
"type": "text/javascript",
"packages": {}
}
}
],
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\r\n \"educationOrganizationReference\": {\r\n \"educationOrganizationId\": 255901\r\n },\r\n \"programReference\": {\r\n \"educationOrganizationId\": 255901,\r\n \"programName\": \"Bilingual\",\r\n \"programTypeDescriptor\": \"uri://ed-fi.org/ProgramTypeDescriptor#Bilingual\"\r\n },\r\n \"studentReference\": {\r\n \"studentUniqueId\": \"605614\"\r\n },\r\n \"beginDate\": \"2018-08-20\",\r\n \"artPieces\": 15,\r\n \"exhibitDate\": \"2018-12-16\",\r\n \"hoursPerDay\": 1,\r\n \"identificationCode\": \"1234\",\r\n \"kilnReservation\": \"12:15:00\",\r\n \"kilnReservationLength\": \"60\",\r\n \"masteredMediums\": 2.5,\r\n \"numberOfDaysInAttendance\": 30,\r\n \"portfolioPieces\": 32,\r\n \"privateArtProgram\": false,\r\n \"programFees\": 40,\r\n \"programParticipationStatuses\": [],\r\n \"artMedia\": [\r\n {\r\n \"artMediumDescriptor\": \"uri://ed-fi.org/ArtMediumDescriptor#Art Medium\"\r\n }\r\n ],\r\n \"portfolioYears\": [\r\n {\r\n \"portfolioYears\": 2017\r\n },\r\n {\r\n \"portfolioYears\": 2018\r\n }\r\n ],\r\n \"services\": [\r\n {\r\n \"serviceDescriptor\": \"uri://ed-fi.org/ServiceDescriptor#Audiological services\",\r\n \"primaryIndicator\": true,\r\n \"serviceBeginDate\": \"2018-09-03\"\r\n }\r\n ],\r\n \"styles\": [\r\n {\r\n \"style\": \"Post Modern\"\r\n }\r\n ]\r\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{ApiBaseUrl}}/data/v3/sample/studentArtProgramAssociations",
"host": [
"{{ApiBaseUrl}}"
],
"path": [
"data",
"v3",
"sample",
"studentArtProgramAssociations"
]
}
},
"response": []
}
]
},
Expand Down Expand Up @@ -6569,6 +6614,64 @@
]
}
]
},
{
"name": "StudentArtProgramAssociation",
"item": [
{
"name": "Get StudentArtProgramAssociation",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test(\"Status code is 200\", () => {\r",
" pm.expect(pm.response.code).to.equal(200);\r",
"});\r",
"\r",
"const responseItem = pm.response.json();\r",
"\r",
"pm.test(\"Should only have the included fields\", () => {\r",
"\r",
" const respnseKeys = Object.keys(responseItem)\r",
" .filter(k => !k.startsWith(\"_\"))\r",
" .sort();\r",
"\r",
" pm.expect(respnseKeys).to.eql([\"id\", \"educationOrganizationReference\", \"programReference\", \"studentReference\", \"beginDate\", \"privateArtProgram\", \"styles\"].sort());\r",
"});"
],
"type": "text/javascript",
"packages": {}
}
}
],
"request": {
"method": "GET",
"header": [
{
"key": "Accept",
"value": "application/vnd.ed-fi.studentartprogramassociation.sample-studentartprogramassociation-logicalschema-includeonly.readable+json",
"description": "sample-school-multiple-extensions-includeonly",
"type": "text"
}
],
"url": {
"raw": "{{ApiBaseUrl}}/data/v3/sample/studentArtProgramAssociations/{{known:studentArtProgramAssociation:id}}",
"host": [
"{{ApiBaseUrl}}"
],
"path": [
"data",
"v3",
"sample",
"studentArtProgramAssociations",
"{{known:studentArtProgramAssociation:id}}"
]
}
},
"response": []
}
]
}
]
},
Expand Down Expand Up @@ -7670,6 +7773,42 @@
},
"response": []
},
{
"name": "Delete StudentArtProgramAssociation",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test(\"Status code is 204\", () => {\r",
" pm.expect(pm.response.code).to.equal(204);\r",
"});\r",
""
],
"type": "text/javascript",
"packages": {}
}
}
],
"request": {
"method": "DELETE",
"header": [],
"url": {
"raw": "{{ApiBaseUrl}}/data/v3/sample/studentArtProgramAssociations/{{known:studentArtProgramAssociation:id}}",
"host": [
"{{ApiBaseUrl}}"
],
"path": [
"data",
"v3",
"sample",
"studentArtProgramAssociations",
"{{known:studentArtProgramAssociation:id}}"
]
}
},
"response": []
},
{
"name": "Clean up Environment Variables",
"event": [
Expand Down

0 comments on commit 1ecfb93

Please sign in to comment.