From 764c448dae63a0f2bcd2f5bb6956571559ea5a77 Mon Sep 17 00:00:00 2001 From: Matthew Jackson <123390480+mjaksn@users.noreply.github.com> Date: Tue, 8 Aug 2023 18:28:53 -0500 Subject: [PATCH] [ODS-5921] Postman test coverage for Contacts (after renamed from Parent in the standard) (#802) * Update postman tests to use new env variables * Update Postman colections to use contact/parent variables in requests * Remove 'Parent' from names in the postman collection * Remove more 'Parent' occurances from postman collections * Update postman collection to use new parent/contact variables * Fix tests in postman collection * Update change-query Postman collection * Update authorization tests Postman collection * Postman test fixes * More changes to postman collections * Remove unneeded changes * Refactor to only require a single new value in environment.json --- ...Deletes Test Suite.postman_collection.json | 72 ++-- ...te Base Test Suite.postman_collection.json | 32 +- ...ltiple Key-Secrets.postman_collection.json | 407 +++++++++--------- ...AuthorizationTests.postman_collection.json | 172 ++++---- ...GetByExample Tests.postman_collection.json | 134 +++--- ...gration Test Suite.postman_collection.json | 112 ++--- 6 files changed, 500 insertions(+), 429 deletions(-) diff --git a/Postman Test Suite/Ed-Fi ODS-API ChangeQueries Key Changes and Deletes Test Suite.postman_collection.json b/Postman Test Suite/Ed-Fi ODS-API ChangeQueries Key Changes and Deletes Test Suite.postman_collection.json index f7f01d5a71..823961854c 100644 --- a/Postman Test Suite/Ed-Fi ODS-API ChangeQueries Key Changes and Deletes Test Suite.postman_collection.json +++ b/Postman Test Suite/Ed-Fi ODS-API ChangeQueries Key Changes and Deletes Test Suite.postman_collection.json @@ -9925,7 +9925,7 @@ ] }, { - "name": "Students and Parents", + "name": "Students and Contacts", "item": [ { "name": "Initialization", @@ -10101,7 +10101,7 @@ "response": [] }, { - "name": "Create Parent", + "name": "Create Parent or Contact", "event": [ { "listen": "prerequest", @@ -10117,7 +10117,7 @@ "script": { "exec": [ "pm.test(\"Response is 201 or 404\", () => {\r", - " pm.expect(pm.response.code).to.be.oneOf([201, 404]) \r", + " pm.expect(pm.response.code).to.equal(201) \r", " });\r", "\r", "if (pm.response.code === 201 ) {\r", @@ -10133,7 +10133,7 @@ "header": [], "body": { "mode": "raw", - "raw": "{\r\n \"parentUniqueId\": \"{{supplied:parentUniqueId}}\",\r\n \"birthDate\": \"1988-09-13\",\r\n \"firstName\": \"John\",\r\n \"lastSurname\": \"Doe\",\r\n \"_ext\": {\r\n \"Sample\": {\r\n \"teacherConference\": {\r\n \"dayOfWeek\": \"Monday\",\r\n \"endTime\": \"12:00:00\",\r\n \"startTime\": \"12:00:00\"\r\n },\r\n \"authors\": [],\r\n \"favoriteBookTitles\": [\r\n {\r\n \"favoriteBookTitle\": \"Green Eggs and Ham\"\r\n }\r\n ],\r\n \"isSportsFan\": false\r\n }\r\n }\r\n}", + "raw": "{\r\n \"{{ParentOrContactUniqueIdName}}\": \"{{supplied:parentUniqueId}}\",\r\n \"birthDate\": \"1988-09-13\",\r\n \"firstName\": \"John\",\r\n \"lastSurname\": \"Doe\",\r\n \"_ext\": {\r\n \"Sample\": {\r\n \"teacherConference\": {\r\n \"dayOfWeek\": \"Monday\",\r\n \"endTime\": \"12:00:00\",\r\n \"startTime\": \"12:00:00\"\r\n },\r\n \"authors\": [],\r\n \"favoriteBookTitles\": [\r\n {\r\n \"favoriteBookTitle\": \"Green Eggs and Ham\"\r\n }\r\n ],\r\n \"isSportsFan\": false\r\n }\r\n }\r\n}", "options": { "raw": { "language": "json" @@ -10141,7 +10141,7 @@ } }, "url": { - "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/parents", + "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/{{ParentOrContactCollectionName}}", "host": [ "{{ApiBaseUrl}}" ], @@ -10149,7 +10149,7 @@ "data", "v3", "ed-fi", - "parents" + "{{ParentOrContactCollectionName}}" ] } }, @@ -10210,7 +10210,7 @@ "response": [] }, { - "name": "Create Student Parent Association", + "name": "Create Student Parent or Contact Association", "event": [ { "listen": "prerequest", @@ -10226,7 +10226,7 @@ "script": { "exec": [ "pm.test(\"Response is 201 or 404\", () => {\r", - " pm.expect(pm.response.code).to.be.oneOf([201, 404]) \r", + " pm.expect(pm.response.code).to.equal(201) \r", " });\r", "\r", "if (pm.response.code === 201 ) {\r", @@ -10242,7 +10242,7 @@ "header": [], "body": { "mode": "raw", - "raw": "{\r\n \"parentReference\": {\r\n \"parentUniqueId\": \"{{supplied:parentUniqueId}}\"\r\n },\r\n \"studentReference\": {\r\n \"studentUniqueId\": \"{{supplied:studentUniqueId}}\"\r\n },\r\n \"_ext\": {\r\n \"Sample\": {\r\n \"bedtimeReader\": true,\r\n \"favoriteBookTitles\": [\r\n {\r\n \"favoriteBookTitle\": \"Green Eggs and Ham\"\r\n }\r\n ],\r\n \"telephone\": {\r\n \"telephoneNumber\": \"12345\",\r\n \"telephoneNumberTypeDescriptor\": \"uri://ed-fi.org/TelephoneNumberTypeDescriptor#Other\"\r\n }\r\n }\r\n }\r\n}", + "raw": "{\r\n \"{{ParentOrContactName}}Reference\": {\r\n \"{{ParentOrContactUniqueIdName}}\": \"{{supplied:parentUniqueId}}\"\r\n },\r\n \"studentReference\": {\r\n \"studentUniqueId\": \"{{supplied:studentUniqueId}}\"\r\n },\r\n \"_ext\": {\r\n \"Sample\": {\r\n \"bedtimeReader\": true,\r\n \"favoriteBookTitles\": [\r\n {\r\n \"favoriteBookTitle\": \"Green Eggs and Ham\"\r\n }\r\n ],\r\n \"telephone\": {\r\n \"telephoneNumber\": \"12345\",\r\n \"telephoneNumberTypeDescriptor\": \"uri://ed-fi.org/TelephoneNumberTypeDescriptor#Other\"\r\n }\r\n }\r\n }\r\n}", "options": { "raw": { "language": "json" @@ -10250,7 +10250,7 @@ } }, "url": { - "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/studentParentAssociations", + "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/{{StudentParentOrContactAssociationCollectionName}}", "host": [ "{{ApiBaseUrl}}" ], @@ -10258,7 +10258,7 @@ "data", "v3", "ed-fi", - "studentParentAssociations" + "{{StudentParentOrContactAssociationCollectionName}}" ] } }, @@ -10328,10 +10328,10 @@ ] }, { - "name": "Parents", + "name": "Contacts", "item": [ { - "name": "Change Parent First Name", + "name": "Change Parent or Contact First Name", "event": [ { "listen": "prerequest", @@ -10346,12 +10346,12 @@ "listen": "test", "script": { "exec": [ - "pm.test(\"Response is 400 or 404\", () => {\r", - " pm.expect(pm.response.code).to.be.oneOf([400, 404])\r", + "pm.test(\"Response is 400\", () => {\r", + " pm.expect(pm.response.code).to.equal(400)\r", "});\r", "\r", "if (pm.response.code == 400) {\r", - " pm.test(\"Should indicate that Parent keys cannot be changed.\", () => {\r", + " pm.test(\"Should indicate that Contact keys cannot be changed.\", () => {\r", " pm.expect(pm.response.json().message).to.include(\"Key values for this resource cannot be changed.\");\r", " });\r", "}" @@ -10365,7 +10365,7 @@ "header": [], "body": { "mode": "raw", - "raw": "{\r\n \"parentUniqueId\": \"{{supplied:parentUniqueId}}-Changed\",\r\n \"birthDate\": \"1988-09-13\",\r\n \"firstName\": \"Jonathon\",\r\n \"lastSurname\": \"Doe\",\r\n \"_ext\": {\r\n \"Sample\": {\r\n \"teacherConference\": {\r\n \"dayOfWeek\": \"Monday\",\r\n \"endTime\": \"12:00:00\",\r\n \"startTime\": \"12:00:00\"\r\n },\r\n \"authors\": [],\r\n \"favoriteBookTitles\": [\r\n {\r\n \"favoriteBookTitle\": \"Green Eggs and Ham\"\r\n }\r\n ],\r\n \"isSportsFan\": false\r\n }\r\n }\r\n}", + "raw": "{\r\n \"{{ParentOrContactUniqueIdName}}\": \"{{supplied:parentUniqueId}}-Changed\",\r\n \"birthDate\": \"1988-09-13\",\r\n \"firstName\": \"Jonathon\",\r\n \"lastSurname\": \"Doe\",\r\n \"_ext\": {\r\n \"Sample\": {\r\n \"teacherConference\": {\r\n \"dayOfWeek\": \"Monday\",\r\n \"endTime\": \"12:00:00\",\r\n \"startTime\": \"12:00:00\"\r\n },\r\n \"authors\": [],\r\n \"favoriteBookTitles\": [\r\n {\r\n \"favoriteBookTitle\": \"Green Eggs and Ham\"\r\n }\r\n ],\r\n \"isSportsFan\": false\r\n }\r\n }\r\n}", "options": { "raw": { "language": "json" @@ -10373,7 +10373,7 @@ } }, "url": { - "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/parents/{{known:parent:id}}", + "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/{{ParentOrContactCollectionName}}/{{known:parent:id}}", "host": [ "{{ApiBaseUrl}}" ], @@ -10381,7 +10381,7 @@ "data", "v3", "ed-fi", - "parents", + "{{ParentOrContactCollectionName}}", "{{known:parent:id}}" ] } @@ -10394,7 +10394,7 @@ "name": "Teardown", "item": [ { - "name": "Delete Student Parent Association", + "name": "Delete Student Parent or Contact Association", "event": [ { "listen": "prerequest", @@ -10409,8 +10409,8 @@ "listen": "test", "script": { "exec": [ - "pm.test(\"Response is 204 or 404\", () => {\r", - " pm.expect(pm.response.code).to.be.oneOf([204, 404]) \r", + "pm.test(\"Response is 204\", () => {\r", + " pm.expect(pm.response.code).to.equal(204) \r", " });\r", "" ], @@ -10431,7 +10431,7 @@ } }, "url": { - "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/studentParentAssociations/{{known:studentParentAssociation:id}}", + "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/{{StudentParentOrContactAssociationCollectionName}}/{{known:studentParentAssociation:id}}", "host": [ "{{ApiBaseUrl}}" ], @@ -10439,7 +10439,7 @@ "data", "v3", "ed-fi", - "studentParentAssociations", + "{{StudentParentOrContactAssociationCollectionName}}", "{{known:studentParentAssociation:id}}" ] } @@ -10447,7 +10447,7 @@ "response": [] }, { - "name": "Delete Parent", + "name": "Delete Parent or Contact", "event": [ { "listen": "prerequest", @@ -10462,8 +10462,8 @@ "listen": "test", "script": { "exec": [ - "pm.test(\"Response is 204 or 404\", () => {\r", - " pm.expect(pm.response.code).to.be.oneOf([204, 404]) \r", + "pm.test(\"Response is 204\", () => {\r", + " pm.expect(pm.response.code).to.equals(204) \r", " });" ], "type": "text/javascript" @@ -10483,7 +10483,7 @@ } }, "url": { - "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/parents/{{known:parent:id}}", + "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/{{ParentOrContactCollectionName}}/{{known:parent:id}}", "host": [ "{{ApiBaseUrl}}" ], @@ -10491,7 +10491,7 @@ "data", "v3", "ed-fi", - "parents", + "{{ParentOrContactCollectionName}}", "{{known:parent:id}}" ] } @@ -10975,6 +10975,20 @@ "", "CreateAccessToken(\"TokenExpiry_255901044\",\"AccessToken_255901044\",\"ApiKey_255901044\",\"ApiSecret_255901044\")", "", + "// Set variables related to data standard specific contact/parent variablility ", + "let ParentOrContactProperName = pm.environment.get(\"ParentOrContactProperName\");", + "let StudentParentOrContactAssociationCollectionName = \"Student\" + ParentOrContactProperName + \"Associations\";", + "let ParentOrContactUniqueIdName = ParentOrContactProperName + \"UniqueId\";", + "let ParentOrContactName = ParentOrContactProperName.toLowerCase();", + "let ParentOrContactCollectionName = ParentOrContactName + \"s\";", + "", + "pm.environment.set(\"StudentParentOrContactAssociationCollectionName\", StudentParentOrContactAssociationCollectionName);", + "pm.environment.set(\"ParentOrContactUniqueIdName\", ParentOrContactUniqueIdName);", + "pm.environment.set(\"ParentOrContactName\", ParentOrContactName);", + "pm.environment.set(\"ParentOrContactCollectionName\", ParentOrContactCollectionName);", + "", + "", + "", "// Adapted from: https://marcin-chwedczuk.github.io/automatically-generate-new-oauth2-tokens-when-using-postman", "// Assumes Environment with Environment Variables: ApiBaseUrl, ApiKey, ApiSecret", "// See https://gist.github.com/blmeyers/21138bbe6f80b8c35701a8754bfe59d5 for an environment sample for Local (NOTE: environment variable names have been changed from the gist -- you must adjust accordingly)", diff --git a/Postman Test Suite/Ed-Fi ODS-API Composite Base Test Suite.postman_collection.json b/Postman Test Suite/Ed-Fi ODS-API Composite Base Test Suite.postman_collection.json index 82616d9661..b5dada0c5e 100644 --- a/Postman Test Suite/Ed-Fi ODS-API Composite Base Test Suite.postman_collection.json +++ b/Postman Test Suite/Ed-Fi ODS-API Composite Base Test Suite.postman_collection.json @@ -6264,14 +6264,14 @@ "name": "Initialize Known", "item": [ { - "name": "Initialize Known parents Data for Get Requests", + "name": "Initialize Known Contact Data for Get Requests", "event": [ { "listen": "test", "script": { "exec": [ - "pm.test(\"Response is 200 or 404\", () => {\r", - " pm.expect(pm.response.code).to.be.oneOf([200, 404]) \r", + "pm.test(\"Response is 200\", () => {\r", + " pm.expect(pm.response.code).to.equal(200) \r", " });\r", "\r", "if (pm.response.code === 200 ) {\r", @@ -6289,10 +6289,10 @@ " \r", " pm.environment.set('known:testSubject', JSON.stringify(testSubject));\r", " \r", - " // Build request to update the Parent with address periods\r", + " // Build request to update the Contact with address periods\r", " let postRequest = {\r", " method: 'POST',\r", - " url: pm.environment.get('ApiBaseUrl') + '/data/v3/ed-fi/parents',\r", + " url: pm.environment.get('ApiBaseUrl') + '/data/v3/ed-fi/{{ParentOrContactCollectionName}}',\r", " header: {\r", " 'Content-Type': 'application/json',\r", " 'Authorization': 'Bearer ' + pm.environment.get('AccessToken')\r", @@ -6302,7 +6302,7 @@ " raw: JSON.stringify(testSubject)\r", " }\r", " };\r", - " // Update parent to assign address periods for the scenario\r", + " // Update parent/contact to assign address periods for the scenario\r", " pm.sendRequest(postRequest, (err, response) => {\r", " if (err) {\r", " console.log(JSON.stringify(err));\r", @@ -6320,7 +6320,7 @@ "method": "GET", "header": [], "url": { - "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/parents", + "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/{{ParentOrContactCollectionName}}", "host": [ "{{ApiBaseUrl}}" ], @@ -6328,7 +6328,7 @@ "data", "v3", "ed-fi", - "parents" + "{{ParentOrContactCollectionName}}" ] } }, @@ -7531,7 +7531,7 @@ "script": { "exec": [ "const __ = require('lodash');\r", - "pm.test(\"Response is 200 or 404\", () => {\r", + "pm.test(\"Response is 200 or 400\", () => {\r", " pm.expect(pm.response.code).to.be.oneOf([200, 404]) \r", " });\r", "\r", @@ -7595,7 +7595,7 @@ "{{supplied:parentId}}" ] }, - "description": "# Collection -> Collection\r\nScenario: Composite includes collection with collection\r\n Given the subject of the request is a StudentAssessment with ObjectAssessmentScoreResults\r\n When a GET (by id) request is submitted to the \"StudentCollectionWithCollection\" composite\r\n Then the response model should have only collection studentAssessmentStudentObjectiveAssessments with collection studentAssessmentStudentObjectiveAssessmentScoreResults\r\n And the queries generated should all match previously approved values\r\n \r\n \r\n ++++++++++++++++++++++++++++\r\n\tI would recommend changing this composite to go after Parent, ParentAddress, and ParentAddressPeriod.\r\n\t\r\n\t \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\t+++++++++++++++++++++++++++++++++" + "description": "# Collection -> Collection\r\nScenario: Composite includes collection with collection\r\n Given the subject of the request is a StudentAssessment with ObjectAssessmentScoreResults\r\n When a GET (by id) request is submitted to the \"StudentCollectionWithCollection\" composite\r\n Then the response model should have only collection studentAssessmentStudentObjectiveAssessments with collection studentAssessmentStudentObjectiveAssessmentScoreResults\r\n And the queries generated should all match previously approved values\r\n \r\n \r\n ++++++++++++++++++++++++++++\r\n\tI would recommend changing this composite to go after Contact, ContactAddress, and ContactAddressPeriod.\r\n\t\r\n\t \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\t+++++++++++++++++++++++++++++++++" }, "response": [] } @@ -8875,6 +8875,18 @@ "script": { "type": "text/javascript", "exec": [ + "// Set variables related to data standard specific contact/parent variablility ", + "let ParentOrContactProperName = pm.environment.get(\"ParentOrContactProperName\");", + "let StudentParentOrContactAssociationCollectionName = \"Student\" + ParentOrContactProperName + \"Associations\";", + "let ParentOrContactUniqueIdName = ParentOrContactProperName + \"UniqueId\";", + "let ParentOrContactName = ParentOrContactProperName.toLowerCase();", + "let ParentOrContactCollectionName = ParentOrContactName + \"s\";", + "", + "pm.environment.set(\"StudentParentOrContactAssociationCollectionName\", StudentParentOrContactAssociationCollectionName);", + "pm.environment.set(\"ParentOrContactUniqueIdName\", ParentOrContactUniqueIdName);", + "pm.environment.set(\"ParentOrContactName\", ParentOrContactName);", + "pm.environment.set(\"ParentOrContactCollectionName\", ParentOrContactCollectionName);", + "", "// Adapted from: https://marcin-chwedczuk.github.io/automatically-generate-new-oauth2-tokens-when-using-postman", "// Assumes Environment with Environment Variables: ApiBaseUrl, ApiKey, ApiSecret", "// See https://gist.github.com/blmeyers/21138bbe6f80b8c35701a8754bfe59d5 for an environment sample for Local (NOTE: environment variable names have been changed from the gist -- you must adjust accordingly)", diff --git a/Postman Test Suite/Ed-Fi ODS-API Integration Test Suite AuthorizationTests Multiple Key-Secrets.postman_collection.json b/Postman Test Suite/Ed-Fi ODS-API Integration Test Suite AuthorizationTests Multiple Key-Secrets.postman_collection.json index 174de89945..0283f04f78 100644 --- a/Postman Test Suite/Ed-Fi ODS-API Integration Test Suite AuthorizationTests Multiple Key-Secrets.postman_collection.json +++ b/Postman Test Suite/Ed-Fi ODS-API Integration Test Suite AuthorizationTests Multiple Key-Secrets.postman_collection.json @@ -2479,10 +2479,10 @@ ] }, { - "name": "ParentAuthorizationTests", + "name": "ContactAuthorizationTests", "item": [ { - "name": "When_updating_an_unassociated_parent_should_fail_with_403_forbidden", + "name": "When_updating_an_unassociated_contact_should_fail_with_403_forbidden", "item": [ { "name": "Initialize Student Data for Post Request", @@ -2646,14 +2646,14 @@ "response": [] }, { - "name": "Initialize Parent Data for Post Request", + "name": "Initialize Contact Data for Post Request", "event": [ { "listen": "test", "script": { "exec": [ - "pm.test(\"Response is 201 or 404\", () => {", - " pm.expect(pm.response.code).to.be.oneOf([201, 404]) ", + "pm.test(\"Response is 201\", () => {", + " pm.expect(pm.response.code).to.equal(201) ", " });", "", "if (pm.response.code === 201 ) {", @@ -2707,10 +2707,10 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"parentUniqueId\": \"{{supplied:{{scenarioId}}:parentUniqueId}}\",\r\n \"firstName\": \"{{supplied:{{scenarioId}}:firstName}}\",\r\n \"lastSurname\": \"{{supplied:{{scenarioId}}:lastSurname}}\",\r\n \"sexDescriptor\": \"{{supplied:{{scenarioId}}:sexDescriptor}}\",\r\n \"_ext\": {\r\n \"Sample\": {\r\n \"teacherConference\": {\r\n \"dayOfWeek\": \"Monday\",\r\n \"endTime\": \"12:00:00\",\r\n \"startTime\": \"12:00:00\"\r\n },\r\n \"authors\": [],\r\n \"favoriteBookTitles\": [\r\n {\r\n \"favoriteBookTitle\": \"Green Eggs and Ham\"\r\n }\r\n ],\r\n \"isSportsFan\": false\r\n }\r\n }\r\n}" + "raw": "{\r\n \"{{ParentOrContactUniqueIdName}}\": \"{{supplied:{{scenarioId}}:parentUniqueId}}\",\r\n \"firstName\": \"{{supplied:{{scenarioId}}:firstName}}\",\r\n \"lastSurname\": \"{{supplied:{{scenarioId}}:lastSurname}}\",\r\n \"sexDescriptor\": \"{{supplied:{{scenarioId}}:sexDescriptor}}\",\r\n \"_ext\": {\r\n \"Sample\": {\r\n \"teacherConference\": {\r\n \"dayOfWeek\": \"Monday\",\r\n \"endTime\": \"12:00:00\",\r\n \"startTime\": \"12:00:00\"\r\n },\r\n \"authors\": [],\r\n \"favoriteBookTitles\": [\r\n {\r\n \"favoriteBookTitle\": \"Green Eggs and Ham\"\r\n }\r\n ],\r\n \"isSportsFan\": false\r\n }\r\n }\r\n}" }, "url": { - "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/parents", + "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/{{ParentOrContactCollectionName}}", "host": [ "{{ApiBaseUrl}}" ], @@ -2718,21 +2718,21 @@ "data", "v3", "ed-fi", - "parents" + "{{ParentOrContactCollectionName}}" ] } }, "response": [] }, { - "name": "Initialize StudentParentAssociations Data for Post Request", + "name": "Initialize StudentContactAssociations Data for Post Request", "event": [ { "listen": "test", "script": { "exec": [ - "pm.test(\"Response is 201 or 404\", () => {", - " pm.expect(pm.response.code).to.be.oneOf([201, 404]) ", + "pm.test(\"Response is 201\", () => {", + " pm.expect(pm.response.code).to.equal(201) ", " });" ], "type": "text/javascript" @@ -2770,10 +2770,10 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"parentReference\": {\r\n \"parentUniqueId\": \"{{known:{{scenarioId}}:parentUniqueId}}\"\r\n },\r\n \"studentReference\": {\r\n \"studentUniqueId\": \"{{known:{{scenarioId}}:studentUniqueId}}\"\r\n },\r\n \"_ext\": {\r\n \"Sample\": {\r\n \"bedtimeReader\": true,\r\n \"favoriteBookTitles\": [\r\n {\r\n \"favoriteBookTitle\": \"Green Eggs and Ham\"\r\n }\r\n ]\r\n }\r\n }\r\n}" + "raw": "{\r\n \"{{ParentOrContactName}}Reference\": {\r\n \"{{ParentOrContactUniqueIdName}}\": \"{{known:{{scenarioId}}:parentUniqueId}}\"\r\n },\r\n \"studentReference\": {\r\n \"studentUniqueId\": \"{{known:{{scenarioId}}:studentUniqueId}}\"\r\n },\r\n \"_ext\": {\r\n \"Sample\": {\r\n \"bedtimeReader\": true,\r\n \"favoriteBookTitles\": [\r\n {\r\n \"favoriteBookTitle\": \"Green Eggs and Ham\"\r\n }\r\n ]\r\n }\r\n }\r\n}" }, "url": { - "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/StudentParentAssociations", + "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/{{StudentParentOrContactAssociationCollectionName}}", "host": [ "{{ApiBaseUrl}}" ], @@ -2781,21 +2781,21 @@ "data", "v3", "ed-fi", - "StudentParentAssociations" + "{{StudentParentOrContactAssociationCollectionName}}" ] } }, "response": [] }, { - "name": "When_updating_an_unassociated_parent_should_fail_with_403_forbidden", + "name": "When_updating_an_unassociated_contact_should_fail_with_403_forbidden", "event": [ { "listen": "test", "script": { "exec": [ - "pm.test(\"Response is 403 or 404\", () => {", - " pm.expect(pm.response.code).to.be.oneOf([403, 404]) ", + "pm.test(\"Response is 403\", () => {", + " pm.expect(pm.response.code).to.equal(403) ", " });", "" ], @@ -2836,10 +2836,10 @@ ], "body": { "mode": "raw", - "raw": "{ \r\n \"firstName\":\"{{supplied:{{scenarioId}}:firstName}}\",\r\n \"lastSurname\":\"{{supplied:{{scenarioId}}:lastSurname}}\",\r\n \"parentUniqueId\":\"{{known:{{scenarioId}}:parentUniqueId}}\"\r\n }\r\n" + "raw": "{ \r\n \"firstName\":\"{{supplied:{{scenarioId}}:firstName}}\",\r\n \"lastSurname\":\"{{supplied:{{scenarioId}}:lastSurname}}\",\r\n \"{{ParentOrContactUniqueIdName}}\":\"{{known:{{scenarioId}}:parentUniqueId}}\"\r\n }\r\n" }, "url": { - "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/parents/{{known:{{scenarioId}}:parentGuid}}", + "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/{{ParentOrContactCollectionName}}/{{known:{{scenarioId}}:parentGuid}}", "host": [ "{{ApiBaseUrl}}" ], @@ -2847,7 +2847,7 @@ "data", "v3", "ed-fi", - "parents", + "{{ParentOrContactCollectionName}}", "{{known:{{scenarioId}}:parentGuid}}" ] } @@ -2857,47 +2857,47 @@ ] }, { - "name": "When_getting_all_parents_should_return_only_authorized_parents", + "name": "When_getting_all_contacts_should_return_only_authorized_contacts", "item": [ { - "name": "Clean up Existing StudentParentAssociations records", + "name": "Clean up Existing StudentContactAssociations records", "event": [ { "listen": "test", "script": { "exec": [ - "pm.test(\"Response is 200 or 404\", () => {\r", - " pm.expect(pm.response.code).to.be.oneOf([200, 404]) \r", + "pm.test(\"Response is 200\", () => {\r", + " pm.expect(pm.response.code).to.equal(200) \r", " });\r", "\r", "if (pm.response.code === 200 ) {\r", - " let StudentParentAssociationsGetRequest = {\r", - " url: pm.environment.get(\"ApiBaseUrl\") + \"/data/v3/ed-fi/StudentParentAssociations\",\r", + " let StudentContactAssociationsGetRequest = {\r", + " url: pm.environment.get(\"ApiBaseUrl\") + \"/data/v3/ed-fi/\" + pm.environment.get(\"StudentParentOrContactAssociationCollectionName\"),\r", " method: 'GET',\r", " header: 'Authorization:bearer ' + pm.environment.get(\"AccessToken_2001_2002_2003\"),\r", " body: {}\r", " };\r", "\r", "\r", - " pm.test('Delete all StudentParentAssociations', () => {\r", + " pm.test('Delete all StudentContactAssociations', () => {\r", "\r", - " pm.sendRequest(StudentParentAssociationsGetRequest, function (err, StudentParentAssociations) {\r", + " pm.sendRequest(StudentContactAssociationsGetRequest, function (err, StudentContactAssociations) {\r", " if (err) {\r", " console.log(err);\r", " } else {\r", - "\r", - " StudentParentAssociations.json().forEach(responseItem => {\r", + " var Assosciations = pm.environment.get(\"StudentParentOrContactAssociationCollectionName\") == \"parent\" ? StudentParentAssociations : StudentContactAssociations\r", + " Assosciations.json().forEach(responseItem => {\r", "\r", " console.log(responseItem.id);\r", "\r", - " let StudentParentAssociationsDeleteRequest = {\r", - " url: pm.environment.get(\"ApiBaseUrl\") + \"/data/v3/ed-fi/StudentParentAssociations/\" + responseItem.id,\r", + " let StudentContactAssociationsDeleteRequest = {\r", + " url: pm.environment.get(\"ApiBaseUrl\") + \"/data/v3/ed-fi/\" + pm.environment.get(\"StudentParentOrContactAssociationCollectionName\") + \"/\" + responseItem.id,\r", " method: 'DELETE',\r", " header: 'Authorization:bearer ' + pm.environment.get(\"AccessToken_2001_2002_2003\"),\r", " body: {}\r", " };\r", "\r", - " pm.sendRequest(StudentParentAssociationsDeleteRequest, function (err, StudentParentAssociations) {\r", + " pm.sendRequest(StudentContactAssociationsDeleteRequest, function (err, StudentContactAssociations) {\r", " if (err) {\r", " console.log(err);\r", " } else {}\r", @@ -2935,7 +2935,7 @@ "method": "GET", "header": [], "url": { - "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/StudentParentAssociations", + "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/{{StudentParentOrContactAssociationCollectionName}}", "host": [ "{{ApiBaseUrl}}" ], @@ -2943,7 +2943,7 @@ "data", "v3", "ed-fi", - "StudentParentAssociations" + "{{StudentParentOrContactAssociationCollectionName}}" ] } }, @@ -3110,14 +3110,14 @@ "response": [] }, { - "name": "Initialize Parent Data for Post Request", + "name": "Initialize Contact Data for Post Request", "event": [ { "listen": "test", "script": { "exec": [ - "pm.test(\"Response is 201 or 404\", () => {", - " pm.expect(pm.response.code).to.be.oneOf([201, 404]) ", + "pm.test(\"Response is 201\", () => {", + " pm.expect(pm.response.code).to.equal(201) ", " });", "", "if (pm.response.code === 201 ) {", @@ -3175,10 +3175,10 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"parentUniqueId\": \"{{supplied:{{scenarioId}}:parentUniqueId}}\",\r\n \"firstName\": \"{{supplied:{{scenarioId}}:firstName}}\",\r\n \"lastSurname\": \"{{supplied:{{scenarioId}}:lastSurname}}\",\r\n \"sexDescriptor\": \"{{supplied:{{scenarioId}}:sexDescriptor}}\",\r\n \"_ext\": {\r\n \"Sample\": {\r\n \"teacherConference\": {\r\n \"dayOfWeek\": \"Monday\",\r\n \"endTime\": \"12:00:00\",\r\n \"startTime\": \"12:00:00\"\r\n },\r\n \"authors\": [],\r\n \"favoriteBookTitles\": [\r\n {\r\n \"favoriteBookTitle\": \"Green Eggs and Ham\"\r\n }\r\n ],\r\n \"isSportsFan\": false\r\n }\r\n }\r\n}" + "raw": "{\r\n \"{{ParentOrContactUniqueIdName}}\": \"{{supplied:{{scenarioId}}:parentUniqueId}}\",\r\n \"firstName\": \"{{supplied:{{scenarioId}}:firstName}}\",\r\n \"lastSurname\": \"{{supplied:{{scenarioId}}:lastSurname}}\",\r\n \"sexDescriptor\": \"{{supplied:{{scenarioId}}:sexDescriptor}}\",\r\n \"_ext\": {\r\n \"Sample\": {\r\n \"teacherConference\": {\r\n \"dayOfWeek\": \"Monday\",\r\n \"endTime\": \"12:00:00\",\r\n \"startTime\": \"12:00:00\"\r\n },\r\n \"authors\": [],\r\n \"favoriteBookTitles\": [\r\n {\r\n \"favoriteBookTitle\": \"Green Eggs and Ham\"\r\n }\r\n ],\r\n \"isSportsFan\": false\r\n }\r\n }\r\n}" }, "url": { - "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/parents", + "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/{{ParentOrContactCollectionName}}", "host": [ "{{ApiBaseUrl}}" ], @@ -3186,21 +3186,21 @@ "data", "v3", "ed-fi", - "parents" + "{{ParentOrContactCollectionName}}" ] } }, "response": [] }, { - "name": "Initialize StudentParentAssociations Data for Post Request", + "name": "Initialize StudentContactAssociations Data for Post Request", "event": [ { "listen": "test", "script": { "exec": [ - "pm.test(\"Response is 201 or 404\", () => {", - " pm.expect(pm.response.code).to.be.oneOf([201, 404]) ", + "pm.test(\"Response is 201\", () => {", + " pm.expect(pm.response.code).to.equal(201) ", " });" ], "type": "text/javascript" @@ -3238,10 +3238,10 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"parentReference\": {\r\n \"parentUniqueId\": \"{{known:{{scenarioId}}:parentUniqueId}}\"\r\n },\r\n \"studentReference\": {\r\n \"studentUniqueId\": \"{{known:{{scenarioId}}:studentUniqueId}}\"\r\n },\r\n \"_ext\": {\r\n \"Sample\": {\r\n \"bedtimeReader\": true,\r\n \"favoriteBookTitles\": [\r\n {\r\n \"favoriteBookTitle\": \"Green Eggs and Ham\"\r\n }\r\n ]\r\n }\r\n }\r\n}" + "raw": "{\r\n \"{{ParentOrContactName}}Reference\": {\r\n \"{{ParentOrContactUniqueIdName}}\": \"{{known:{{scenarioId}}:parentUniqueId}}\"\r\n },\r\n \"studentReference\": {\r\n \"studentUniqueId\": \"{{known:{{scenarioId}}:studentUniqueId}}\"\r\n },\r\n \"_ext\": {\r\n \"Sample\": {\r\n \"bedtimeReader\": true,\r\n \"favoriteBookTitles\": [\r\n {\r\n \"favoriteBookTitle\": \"Green Eggs and Ham\"\r\n }\r\n ]\r\n }\r\n }\r\n}" }, "url": { - "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/StudentParentAssociations", + "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/{{StudentParentOrContactAssociationCollectionName}}", "host": [ "{{ApiBaseUrl}}" ], @@ -3249,7 +3249,7 @@ "data", "v3", "ed-fi", - "StudentParentAssociations" + "{{StudentParentOrContactAssociationCollectionName}}" ] } }, @@ -3262,8 +3262,8 @@ "listen": "test", "script": { "exec": [ - "pm.test(\"Response is 201 or 404\", () => {", - " pm.expect(pm.response.code).to.be.oneOf([201, 404]) ", + "pm.test(\"Response is 201\", () => {", + " pm.expect(pm.response.code).to.equal(201) ", " });", "", "if (pm.response.code === 201 ) {", @@ -3413,14 +3413,14 @@ "response": [] }, { - "name": "Initialize Parent Data for Post Request -Second one", + "name": "Initialize Contact Data for Post Request -Second one", "event": [ { "listen": "test", "script": { "exec": [ - "pm.test(\"Response is 201 or 404\", () => {", - " pm.expect(pm.response.code).to.be.oneOf([201, 404]) ", + "pm.test(\"Response is 201\", () => {", + " pm.expect(pm.response.code).to.equal(201) ", " });", "", "", @@ -3478,10 +3478,10 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"parentUniqueId\": \"{{supplied:{{scenarioId}}:secondParentUniqueId}}\",\r\n \"firstName\": \"{{supplied:{{scenarioId}}:secondParentFirstName}}\",\r\n \"lastSurname\": \"{{supplied:{{scenarioId}}:secondParentLastSurname}}\",\r\n \"sexDescriptor\": \"{{supplied:{{scenarioId}}:secondParentsexDescriptor}}\",\r\n \"_ext\": {\r\n \"Sample\": {\r\n \"teacherConference\": {\r\n \"dayOfWeek\": \"Monday\",\r\n \"endTime\": \"12:00:00\",\r\n \"startTime\": \"12:00:00\"\r\n },\r\n \"authors\": [],\r\n \"favoriteBookTitles\": [\r\n {\r\n \"favoriteBookTitle\": \"Green Eggs and Ham\"\r\n }\r\n ],\r\n \"isSportsFan\": false\r\n }\r\n }\r\n}" + "raw": "{\r\n \"{{ParentOrContactUniqueIdName}}\": \"{{supplied:{{scenarioId}}:secondParentUniqueId}}\",\r\n \"firstName\": \"{{supplied:{{scenarioId}}:secondParentFirstName}}\",\r\n \"lastSurname\": \"{{supplied:{{scenarioId}}:secondParentLastSurname}}\",\r\n \"sexDescriptor\": \"{{supplied:{{scenarioId}}:secondParentsexDescriptor}}\",\r\n \"_ext\": {\r\n \"Sample\": {\r\n \"teacherConference\": {\r\n \"dayOfWeek\": \"Monday\",\r\n \"endTime\": \"12:00:00\",\r\n \"startTime\": \"12:00:00\"\r\n },\r\n \"authors\": [],\r\n \"favoriteBookTitles\": [\r\n {\r\n \"favoriteBookTitle\": \"Green Eggs and Ham\"\r\n }\r\n ],\r\n \"isSportsFan\": false\r\n }\r\n }\r\n}" }, "url": { - "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/parents", + "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/{{ParentOrContactCollectionName}}", "host": [ "{{ApiBaseUrl}}" ], @@ -3489,21 +3489,21 @@ "data", "v3", "ed-fi", - "parents" + "{{ParentOrContactCollectionName}}" ] } }, "response": [] }, { - "name": "Initialize StudentParentAssociations Data for Second one", + "name": "Initialize StudentContactAssociations Data for Second one", "event": [ { "listen": "test", "script": { "exec": [ - "pm.test(\"Response is 201 or 404\", () => {", - " pm.expect(pm.response.code).to.be.oneOf([201, 404]) ", + "pm.test(\"Response is 201\", () => {", + " pm.expect(pm.response.code).to.equal(201) ", " });" ], "type": "text/javascript" @@ -3541,10 +3541,10 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"parentReference\": {\r\n \"parentUniqueId\": \"{{known:{{scenarioId}}:secondParentUniqueId}}\"\r\n },\r\n \"studentReference\": {\r\n \"studentUniqueId\": \"{{known:{{scenarioId}}:secondStudentUniqueId}}\"\r\n },\r\n \"_ext\": {\r\n \"Sample\": {\r\n \"bedtimeReader\": true,\r\n \"favoriteBookTitles\": [\r\n {\r\n \"favoriteBookTitle\": \"Green Eggs and Ham\"\r\n }\r\n ]\r\n }\r\n }\r\n}" + "raw": "{\r\n \"{{ParentOrContactName}}Reference\": {\r\n \"{{ParentOrContactUniqueIdName}}\": \"{{known:{{scenarioId}}:secondParentUniqueId}}\"\r\n },\r\n \"studentReference\": {\r\n \"studentUniqueId\": \"{{known:{{scenarioId}}:secondStudentUniqueId}}\"\r\n },\r\n \"_ext\": {\r\n \"Sample\": {\r\n \"bedtimeReader\": true,\r\n \"favoriteBookTitles\": [\r\n {\r\n \"favoriteBookTitle\": \"Green Eggs and Ham\"\r\n }\r\n ]\r\n }\r\n }\r\n}" }, "url": { - "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/StudentParentAssociations", + "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/{{StudentParentOrContactAssociationCollectionName}}", "host": [ "{{ApiBaseUrl}}" ], @@ -3552,7 +3552,7 @@ "data", "v3", "ed-fi", - "StudentParentAssociations" + "{{StudentParentOrContactAssociationCollectionName}}" ] } }, @@ -3717,14 +3717,14 @@ "response": [] }, { - "name": "Initialize Parent Data for Post Request -Third one", + "name": "Initialize Contact Data for Post Request -Third one", "event": [ { "listen": "test", "script": { "exec": [ - "pm.test(\"Response is 201 or 404\", () => {", - " pm.expect(pm.response.code).to.be.oneOf([201, 404]) ", + "pm.test(\"Response is 201\", () => {", + " pm.expect(pm.response.code).to.equal(201) ", " });", "", "if (pm.response.code === 201 ) {", @@ -3778,10 +3778,10 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"parentUniqueId\": \"{{supplied:{{scenarioId}}:thirdParentUniqueId}}\",\r\n \"firstName\": \"{{supplied:{{scenarioId}}:thirdParentFirstName}}\",\r\n \"lastSurname\": \"{{supplied:{{scenarioId}}:thirdParentLastSurname}}\",\r\n \"sexDescriptor\": \"{{supplied:{{scenarioId}}:thirdParentSexDescriptor}}\",\r\n \"_ext\": {\r\n \"Sample\": {\r\n \"teacherConference\": {\r\n \"dayOfWeek\": \"Monday\",\r\n \"endTime\": \"12:00:00\",\r\n \"startTime\": \"12:00:00\"\r\n },\r\n \"authors\": [],\r\n \"favoriteBookTitles\": [\r\n {\r\n \"favoriteBookTitle\": \"Green Eggs and Ham\"\r\n }\r\n ],\r\n \"isSportsFan\": false\r\n }\r\n }\r\n}" + "raw": "{\r\n \"{{ParentOrContactUniqueIdName}}\": \"{{supplied:{{scenarioId}}:thirdParentUniqueId}}\",\r\n \"firstName\": \"{{supplied:{{scenarioId}}:thirdParentFirstName}}\",\r\n \"lastSurname\": \"{{supplied:{{scenarioId}}:thirdParentLastSurname}}\",\r\n \"sexDescriptor\": \"{{supplied:{{scenarioId}}:thirdParentSexDescriptor}}\",\r\n \"_ext\": {\r\n \"Sample\": {\r\n \"teacherConference\": {\r\n \"dayOfWeek\": \"Monday\",\r\n \"endTime\": \"12:00:00\",\r\n \"startTime\": \"12:00:00\"\r\n },\r\n \"authors\": [],\r\n \"favoriteBookTitles\": [\r\n {\r\n \"favoriteBookTitle\": \"Green Eggs and Ham\"\r\n }\r\n ],\r\n \"isSportsFan\": false\r\n }\r\n }\r\n}" }, "url": { - "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/parents", + "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/{{ParentOrContactCollectionName}}", "host": [ "{{ApiBaseUrl}}" ], @@ -3789,21 +3789,21 @@ "data", "v3", "ed-fi", - "parents" + "{{ParentOrContactCollectionName}}" ] } }, "response": [] }, { - "name": "Initialize StudentParentAssociations Data for Third one", + "name": "Initialize StudentContactAssociations Data for Third one", "event": [ { "listen": "test", "script": { "exec": [ - "pm.test(\"Response is 201 or 404\", () => {", - " pm.expect(pm.response.code).to.be.oneOf([201, 404]) ", + "pm.test(\"Response is 201\", () => {", + " pm.expect(pm.response.code).to.equal(201) ", " });" ], "type": "text/javascript" @@ -3841,10 +3841,10 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"parentReference\": {\r\n \"parentUniqueId\": \"{{known:{{scenarioId}}:thirdParentUniqueId}}\"\r\n },\r\n \"studentReference\": {\r\n \"studentUniqueId\": \"{{known:{{scenarioId}}:thirdStudentUniqueId}}\"\r\n },\r\n \"_ext\": {\r\n \"Sample\": {\r\n \"bedtimeReader\": true,\r\n \"favoriteBookTitles\": [\r\n {\r\n \"favoriteBookTitle\": \"Green Eggs and Ham\"\r\n }\r\n ]\r\n }\r\n }\r\n}" + "raw": "{\r\n \"{{ParentOrContactName}}Reference\": {\r\n \"{{ParentOrContactUniqueIdName}}\": \"{{known:{{scenarioId}}:thirdParentUniqueId}}\"\r\n },\r\n \"studentReference\": {\r\n \"studentUniqueId\": \"{{known:{{scenarioId}}:thirdStudentUniqueId}}\"\r\n },\r\n \"_ext\": {\r\n \"Sample\": {\r\n \"bedtimeReader\": true,\r\n \"favoriteBookTitles\": [\r\n {\r\n \"favoriteBookTitle\": \"Green Eggs and Ham\"\r\n }\r\n ]\r\n }\r\n }\r\n}" }, "url": { - "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/StudentParentAssociations", + "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/{{StudentParentOrContactAssociationCollectionName}}", "host": [ "{{ApiBaseUrl}}" ], @@ -3852,21 +3852,21 @@ "data", "v3", "ed-fi", - "StudentParentAssociations" + "{{StudentParentOrContactAssociationCollectionName}}" ] } }, "response": [] }, { - "name": "When_getting_all_parents_should_return_only_authorized_parents", + "name": "When_getting_all_contacts_should_return_only_authorized_contacts", "event": [ { "listen": "test", "script": { "exec": [ - "pm.test(\"Response is 200 or 404\", () => {", - " pm.expect(pm.response.code).to.be.oneOf([200, 404]) ", + "pm.test(\"Response is 200\", () => {", + " pm.expect(pm.response.code).to.equal(200) ", " });", "", "if (pm.response.code === 201 ) {", @@ -3924,7 +3924,7 @@ } ], "url": { - "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/parents/", + "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/{{StudentParentOrContactAssociationCollectionName}}", "host": [ "{{ApiBaseUrl}}" ], @@ -3932,8 +3932,7 @@ "data", "v3", "ed-fi", - "parents", - "" + "{{StudentParentOrContactAssociationCollectionName}}" ] } }, @@ -3942,30 +3941,30 @@ ] }, { - "name": "When_getting_parent_by_id_should_return_200_when_authorized", + "name": "When_getting_contact_by_id_should_return_200_when_authorized", "item": [ { - "name": "Clean up Existing StudentParentAssociations records", + "name": "Clean up Existing StudentContactAssociations records", "event": [ { "listen": "test", "script": { "exec": [ - "pm.test(\"Response is 200 or 404\", () => {\r", - " pm.expect(pm.response.code).to.be.oneOf([200, 404]) \r", + "pm.test(\"Response is 200\", () => {\r", + " pm.expect(pm.response.code).to.equal(200) \r", " });\r", "\r", "if (pm.response.code === 200 ) {\r", - " let StudentParentAssociationsGetRequest = {\r", - " url: pm.environment.get(\"ApiBaseUrl\") + \"/data/v3/ed-fi/StudentParentAssociations\",\r", + " let StudentContatAssociationsGetRequest = {\r", + " url: pm.environment.get(\"ApiBaseUrl\") + \"/data/v3/ed-fi/\" + pm.environment.get(\"StudentParentOrContactAssociationCollectionName\"),\r", " method: 'GET',\r", " header: 'Authorization:bearer ' + pm.environment.get(\"AccessToken_2001_2002_2003\"),\r", " body: {}\r", " };\r", "\r", - " pm.test('Delete all StudentParentAssociations', () => {\r", + " pm.test('Delete all StudentContactAssociations', () => {\r", "\r", - " pm.sendRequest(StudentParentAssociationsGetRequest, function (err, StudentParentAssociations) {\r", + " pm.sendRequest(StudentContatAssociationsGetRequest, function (err, StudentParentAssociations) {\r", " if (err) {\r", " console.log(err);\r", " } else {\r", @@ -3975,7 +3974,7 @@ " console.log(responseItem.id);\r", "\r", " let StudentParentAssociationsDeleteRequest = {\r", - " url: pm.environment.get(\"ApiBaseUrl\") + \"/data/v3/ed-fi/StudentParentAssociations/\" + responseItem.id,\r", + " url: pm.environment.get(\"ApiBaseUrl\") + \"/data/v3/ed-fi/\" + pm.environment.get(\"StudentParentOrContactAssociationCollectionName\") + \"/\" + responseItem.id,\r", " method: 'DELETE',\r", " header: 'Authorization:bearer ' + pm.environment.get(\"AccessToken_2001_2002_2003\"),\r", " body: {}\r", @@ -4019,7 +4018,7 @@ "method": "GET", "header": [], "url": { - "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/StudentParentAssociations", + "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/{{StudentParentOrContactAssociationCollectionName}}", "host": [ "{{ApiBaseUrl}}" ], @@ -4027,7 +4026,7 @@ "data", "v3", "ed-fi", - "StudentParentAssociations" + "{{StudentParentOrContactAssociationCollectionName}}" ] } }, @@ -4194,14 +4193,14 @@ "response": [] }, { - "name": "Initialize Parent Data for Post Request", + "name": "Initialize Contact Data for Post Request", "event": [ { "listen": "test", "script": { "exec": [ - "pm.test(\"Response is 201 or 404\", () => {", - " pm.expect(pm.response.code).to.be.oneOf([201, 404]) ", + "pm.test(\"Response is 201\", () => {", + " pm.expect(pm.response.code).to.equal(201) ", " });", "", "if (pm.response.code === 201 ) {", @@ -4256,10 +4255,10 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"parentUniqueId\": \"{{supplied:{{scenarioId}}:parentUniqueId}}\",\r\n \"firstName\": \"{{supplied:{{scenarioId}}:firstName}}\",\r\n \"lastSurname\": \"{{supplied:{{scenarioId}}:lastSurname}}\",\r\n \"sexDescriptor\": \"{{supplied:{{scenarioId}}:sexDescriptor}}\",\r\n \"_ext\": {\r\n \"Sample\": {\r\n \"teacherConference\": {\r\n \"dayOfWeek\": \"Monday\",\r\n \"endTime\": \"12:00:00\",\r\n \"startTime\": \"12:00:00\"\r\n },\r\n \"authors\": [],\r\n \"favoriteBookTitles\": [\r\n {\r\n \"favoriteBookTitle\": \"Green Eggs and Ham\"\r\n }\r\n ],\r\n \"isSportsFan\": false\r\n }\r\n }\r\n}" + "raw": "{\r\n \"{{ParentOrContactUniqueIdName}}\": \"{{supplied:{{scenarioId}}:parentUniqueId}}\",\r\n \"firstName\": \"{{supplied:{{scenarioId}}:firstName}}\",\r\n \"lastSurname\": \"{{supplied:{{scenarioId}}:lastSurname}}\",\r\n \"sexDescriptor\": \"{{supplied:{{scenarioId}}:sexDescriptor}}\",\r\n \"_ext\": {\r\n \"Sample\": {\r\n \"teacherConference\": {\r\n \"dayOfWeek\": \"Monday\",\r\n \"endTime\": \"12:00:00\",\r\n \"startTime\": \"12:00:00\"\r\n },\r\n \"authors\": [],\r\n \"favoriteBookTitles\": [\r\n {\r\n \"favoriteBookTitle\": \"Green Eggs and Ham\"\r\n }\r\n ],\r\n \"isSportsFan\": false\r\n }\r\n }\r\n}" }, "url": { - "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/parents", + "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/{{ParentOrContactCollectionName}}", "host": [ "{{ApiBaseUrl}}" ], @@ -4267,21 +4266,21 @@ "data", "v3", "ed-fi", - "parents" + "{{ParentOrContactCollectionName}}" ] } }, "response": [] }, { - "name": "Initialize StudentParentAssociations Data for Post Request", + "name": "Initialize StudentContactAssociations Data for Post Request", "event": [ { "listen": "test", "script": { "exec": [ - "pm.test(\"Response is 201 or 404\", () => {", - " pm.expect(pm.response.code).to.be.oneOf([201, 404]) ", + "pm.test(\"Response is 201\", () => {", + " pm.expect(pm.response.code).to.equal(201) ", " });" ], "type": "text/javascript" @@ -4319,10 +4318,10 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"parentReference\": {\r\n \"parentUniqueId\": \"{{known:{{scenarioId}}:parentUniqueId}}\"\r\n },\r\n \"studentReference\": {\r\n \"studentUniqueId\": \"{{known:{{scenarioId}}:studentUniqueId}}\"\r\n },\r\n \"_ext\": {\r\n \"Sample\": {\r\n \"bedtimeReader\": true,\r\n \"favoriteBookTitles\": [\r\n {\r\n \"favoriteBookTitle\": \"Green Eggs and Ham\"\r\n }\r\n ]\r\n }\r\n }\r\n}" + "raw": "{\r\n \"{{ParentOrContactName}}Reference\": {\r\n \"{{ParentOrContactUniqueIdName}}\": \"{{known:{{scenarioId}}:parentUniqueId}}\"\r\n },\r\n \"studentReference\": {\r\n \"studentUniqueId\": \"{{known:{{scenarioId}}:studentUniqueId}}\"\r\n },\r\n \"_ext\": {\r\n \"Sample\": {\r\n \"bedtimeReader\": true,\r\n \"favoriteBookTitles\": [\r\n {\r\n \"favoriteBookTitle\": \"Green Eggs and Ham\"\r\n }\r\n ]\r\n }\r\n }\r\n}" }, "url": { - "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/StudentParentAssociations", + "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/{{StudentParentOrContactAssociationCollectionName}}", "host": [ "{{ApiBaseUrl}}" ], @@ -4330,7 +4329,7 @@ "data", "v3", "ed-fi", - "StudentParentAssociations" + "{{StudentParentOrContactAssociationCollectionName}}" ] } }, @@ -4494,14 +4493,14 @@ "response": [] }, { - "name": "Initialize Parent Data for Post Request -Second one", + "name": "Initialize Contact Data for Post Request -Second one", "event": [ { "listen": "test", "script": { "exec": [ - "pm.test(\"Response is 201 or 404\", () => {", - " pm.expect(pm.response.code).to.be.oneOf([201, 404]) ", + "pm.test(\"Response is 201\", () => {", + " pm.expect(pm.response.code).to.equal(201) ", " });", "", "if (pm.response.code === 201 ) {", @@ -4556,10 +4555,10 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"parentUniqueId\": \"{{supplied:{{scenarioId}}:secondParentUniqueId}}\",\r\n \"firstName\": \"{{supplied:{{scenarioId}}:secondParentFirstName}}\",\r\n \"lastSurname\": \"{{supplied:{{scenarioId}}:secondParentLastSurname}}\",\r\n \"sexDescriptor\": \"{{supplied:{{scenarioId}}:secondParentsexDescriptor}}\",\r\n \"_ext\": {\r\n \"Sample\": {\r\n \"teacherConference\": {\r\n \"dayOfWeek\": \"Monday\",\r\n \"endTime\": \"12:00:00\",\r\n \"startTime\": \"12:00:00\"\r\n },\r\n \"authors\": [],\r\n \"favoriteBookTitles\": [\r\n {\r\n \"favoriteBookTitle\": \"Green Eggs and Ham\"\r\n }\r\n ],\r\n \"isSportsFan\": false\r\n }\r\n }\r\n}" + "raw": "{\r\n \"{{ParentOrContactUniqueIdName}}\": \"{{supplied:{{scenarioId}}:secondParentUniqueId}}\",\r\n \"firstName\": \"{{supplied:{{scenarioId}}:secondParentFirstName}}\",\r\n \"lastSurname\": \"{{supplied:{{scenarioId}}:secondParentLastSurname}}\",\r\n \"sexDescriptor\": \"{{supplied:{{scenarioId}}:secondParentsexDescriptor}}\",\r\n \"_ext\": {\r\n \"Sample\": {\r\n \"teacherConference\": {\r\n \"dayOfWeek\": \"Monday\",\r\n \"endTime\": \"12:00:00\",\r\n \"startTime\": \"12:00:00\"\r\n },\r\n \"authors\": [],\r\n \"favoriteBookTitles\": [\r\n {\r\n \"favoriteBookTitle\": \"Green Eggs and Ham\"\r\n }\r\n ],\r\n \"isSportsFan\": false\r\n }\r\n }\r\n}" }, "url": { - "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/parents", + "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/{{ParentOrContactCollectionName}}", "host": [ "{{ApiBaseUrl}}" ], @@ -4567,21 +4566,21 @@ "data", "v3", "ed-fi", - "parents" + "{{ParentOrContactCollectionName}}" ] } }, "response": [] }, { - "name": "Initialize StudentParentAssociations Data for Second one", + "name": "Initialize StudentContactAssociations Data for Second one", "event": [ { "listen": "test", "script": { "exec": [ - "pm.test(\"Response is 201 or 404\", () => {", - " pm.expect(pm.response.code).to.be.oneOf([201, 404]) ", + "pm.test(\"Response is 201\", () => {", + " pm.expect(pm.response.code).to.equal(201) ", " });" ], "type": "text/javascript" @@ -4619,10 +4618,10 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"parentReference\": {\r\n \"parentUniqueId\": \"{{known:{{scenarioId}}:secondParentUniqueId}}\"\r\n },\r\n \"studentReference\": {\r\n \"studentUniqueId\": \"{{known:{{scenarioId}}:secondStudentUniqueId}}\"\r\n },\r\n \"_ext\": {\r\n \"Sample\": {\r\n \"bedtimeReader\": true,\r\n \"favoriteBookTitles\": [\r\n {\r\n \"favoriteBookTitle\": \"Green Eggs and Ham\"\r\n }\r\n ]\r\n }\r\n }\r\n}" + "raw": "{\r\n \"{{ParentOrContactName}}Reference\": {\r\n \"{{ParentOrContactUniqueIdName}}\": \"{{known:{{scenarioId}}:secondParentUniqueId}}\"\r\n },\r\n \"studentReference\": {\r\n \"studentUniqueId\": \"{{known:{{scenarioId}}:secondStudentUniqueId}}\"\r\n },\r\n \"_ext\": {\r\n \"Sample\": {\r\n \"bedtimeReader\": true,\r\n \"favoriteBookTitles\": [\r\n {\r\n \"favoriteBookTitle\": \"Green Eggs and Ham\"\r\n }\r\n ]\r\n }\r\n }\r\n}" }, "url": { - "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/StudentParentAssociations", + "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/{{StudentParentOrContactAssociationCollectionName}}", "host": [ "{{ApiBaseUrl}}" ], @@ -4630,21 +4629,21 @@ "data", "v3", "ed-fi", - "StudentParentAssociations" + "{{StudentParentOrContactAssociationCollectionName}}" ] } }, "response": [] }, { - "name": "When_getting_parent_by_id_should_return_200_when_authorized", + "name": "When_getting_contact_by_id_should_return_200_when_authorized", "event": [ { "listen": "test", "script": { "exec": [ - "pm.test(\"Response is 200 or 404\", () => {", - " pm.expect(pm.response.code).to.be.oneOf([200, 404]) ", + "pm.test(\"Response is 200\", () => {", + " pm.expect(pm.response.code).to.equal(200) ", " });" ], "type": "text/javascript" @@ -4681,7 +4680,7 @@ } ], "url": { - "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/parents/{{known:{{scenarioId}}:authorizedParentGuid}}", + "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/{{ParentOrContactCollectionName}}/{{known:{{scenarioId}}:authorizedParentGuid}}", "host": [ "{{ApiBaseUrl}}" ], @@ -4689,7 +4688,7 @@ "data", "v3", "ed-fi", - "parents", + "{{ParentOrContactCollectionName}}", "{{known:{{scenarioId}}:authorizedParentGuid}}" ] } @@ -4697,14 +4696,14 @@ "response": [] }, { - "name": "When_getting_parent_by_id_should_return_403_when_unauthorized", + "name": "When_getting_contact_by_id_should_return_403_when_unauthorized", "event": [ { "listen": "test", "script": { "exec": [ - "pm.test(\"Response is 403 or 404\", () => {", - " pm.expect(pm.response.code).to.be.oneOf([403, 404]) ", + "pm.test(\"Response is 403\", () => {", + " pm.expect(pm.response.code).to.equal(403) ", " });" ], "type": "text/javascript" @@ -4741,7 +4740,7 @@ } ], "url": { - "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/parents/{{known:{{scenarioId}}:unauthorizedParentGuid}}", + "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/{{ParentOrContactCollectionName}}/{{known:{{scenarioId}}:unauthorizedParentGuid}}", "host": [ "{{ApiBaseUrl}}" ], @@ -4749,7 +4748,7 @@ "data", "v3", "ed-fi", - "parents", + "{{ParentOrContactCollectionName}}", "{{known:{{scenarioId}}:unauthorizedParentGuid}}" ] } @@ -4759,22 +4758,22 @@ ] }, { - "name": "When_getting_parent_by_example_should_return_200_and_parent_when_authorized", + "name": "When_getting_contact_by_example_should_return_200_and_contact_when_authorized", "item": [ { - "name": "Clean up Existing StudentParentAssociations records", + "name": "Clean up Existing StudentContactAssociations records", "event": [ { "listen": "test", "script": { "exec": [ - "pm.test(\"Response is 200 or 404\", () => {\r", - " pm.expect(pm.response.code).to.be.oneOf([200, 404]) \r", + "pm.test(\"Response is 200\", () => {\r", + " pm.expect(pm.response.code).to.equal(200) \r", " });\r", "\r", "if (pm.response.code === 200 ) {\r", " let StudentParentAssociationsGetRequest = {\r", - " url: pm.environment.get(\"ApiBaseUrl\") + \"/data/v3/ed-fi/StudentParentAssociations\",\r", + " url: pm.environment.get(\"ApiBaseUrl\") + \"/data/v3/ed-fi/\" + pm.environment.get(\"StudentParentOrContactAssociationCollectionName\"),\r", " method: 'GET',\r", " header: 'Authorization:bearer ' + pm.environment.get(\"AccessToken_2001_2002_2003\"),\r", " body: {}\r", @@ -4835,7 +4834,7 @@ "method": "GET", "header": [], "url": { - "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/StudentParentAssociations", + "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/{{StudentParentOrContactAssociationCollectionName}}", "host": [ "{{ApiBaseUrl}}" ], @@ -4843,7 +4842,7 @@ "data", "v3", "ed-fi", - "StudentParentAssociations" + "{{StudentParentOrContactAssociationCollectionName}}" ] } }, @@ -4856,8 +4855,8 @@ "listen": "test", "script": { "exec": [ - "pm.test(\"Response is 201 or 404\", () => {", - " pm.expect(pm.response.code).to.be.oneOf([201, 404]) ", + "pm.test(\"Response is 201\", () => {", + " pm.expect(pm.response.code).to.equal(201) ", " });", "", "if (pm.response.code === 201 ) {", @@ -4962,8 +4961,8 @@ "listen": "test", "script": { "exec": [ - "pm.test(\"Response is 201 or 404\", () => {", - " pm.expect(pm.response.code).to.be.oneOf([201, 404]) ", + "pm.test(\"Response is 201\", () => {", + " pm.expect(pm.response.code).to.equal(201) ", " });", "", "" @@ -5013,14 +5012,14 @@ "response": [] }, { - "name": "Initialize Parent Data for Post Request", + "name": "Initialize Contact Data for Post Request", "event": [ { "listen": "test", "script": { "exec": [ - "pm.test(\"Response is 201 or 404\", () => {", - " pm.expect(pm.response.code).to.be.oneOf([201, 404]) ", + "pm.test(\"Response is 201\", () => {", + " pm.expect(pm.response.code).to.equal(201) ", " });", "", "if (pm.response.code === 201 ) {", @@ -5074,10 +5073,10 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"parentUniqueId\": \"{{supplied:{{scenarioId}}:parentUniqueId}}\",\r\n \"firstName\": \"{{supplied:{{scenarioId}}:parentFirstName}}\",\r\n \"lastSurname\": \"{{supplied:{{scenarioId}}:parentLastSurname}}\",\r\n \"sexDescriptor\": \"{{supplied:{{scenarioId}}:parentSexDescriptor}}\",\r\n \"_ext\": {\r\n \"Sample\": {\r\n \"teacherConference\": {\r\n \"dayOfWeek\": \"Monday\",\r\n \"endTime\": \"12:00:00\",\r\n \"startTime\": \"12:00:00\"\r\n },\r\n \"authors\": [],\r\n \"favoriteBookTitles\": [\r\n {\r\n \"favoriteBookTitle\": \"Green Eggs and Ham\"\r\n }\r\n ],\r\n \"isSportsFan\": false\r\n }\r\n }\r\n}" + "raw": "{\r\n \"{{ParentOrContactUniqueIdName}}\": \"{{supplied:{{scenarioId}}:parentUniqueId}}\",\r\n \"firstName\": \"{{supplied:{{scenarioId}}:parentFirstName}}\",\r\n \"lastSurname\": \"{{supplied:{{scenarioId}}:parentLastSurname}}\",\r\n \"sexDescriptor\": \"{{supplied:{{scenarioId}}:parentSexDescriptor}}\",\r\n \"_ext\": {\r\n \"Sample\": {\r\n \"teacherConference\": {\r\n \"dayOfWeek\": \"Monday\",\r\n \"endTime\": \"12:00:00\",\r\n \"startTime\": \"12:00:00\"\r\n },\r\n \"authors\": [],\r\n \"favoriteBookTitles\": [\r\n {\r\n \"favoriteBookTitle\": \"Green Eggs and Ham\"\r\n }\r\n ],\r\n \"isSportsFan\": false\r\n }\r\n }\r\n}" }, "url": { - "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/parents", + "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/{{ParentOrContactCollectionName}}", "host": [ "{{ApiBaseUrl}}" ], @@ -5085,21 +5084,21 @@ "data", "v3", "ed-fi", - "parents" + "{{ParentOrContactCollectionName}}" ] } }, "response": [] }, { - "name": "Initialize StudentParentAssociations Data for Post Request", + "name": "Initialize StudentContactAssociations Data for Post Request", "event": [ { "listen": "test", "script": { "exec": [ - "pm.test(\"Response is 201 or 404\", () => {", - " pm.expect(pm.response.code).to.be.oneOf([201, 404]) ", + "pm.test(\"Response is 201\", () => {", + " pm.expect(pm.response.code).to.equal(201) ", " });", "" ], @@ -5138,10 +5137,10 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"parentReference\": {\r\n \"parentUniqueId\": \"{{known:{{scenarioId}}:parentUniqueId}}\"\r\n },\r\n \"studentReference\": {\r\n \"studentUniqueId\": \"{{known:{{scenarioId}}:studentUniqueId}}\"\r\n },\r\n \"_ext\": {\r\n \"Sample\": {\r\n \"bedtimeReader\": true,\r\n \"favoriteBookTitles\": [\r\n {\r\n \"favoriteBookTitle\": \"Green Eggs and Ham\"\r\n }\r\n ]\r\n }\r\n }\r\n}" + "raw": "{\r\n \"{{ParentOrContactName}}Reference\": {\r\n \"{{ParentOrContactUniqueIdName}}\": \"{{known:{{scenarioId}}:parentUniqueId}}\"\r\n },\r\n \"studentReference\": {\r\n \"studentUniqueId\": \"{{known:{{scenarioId}}:studentUniqueId}}\"\r\n },\r\n \"_ext\": {\r\n \"Sample\": {\r\n \"bedtimeReader\": true,\r\n \"favoriteBookTitles\": [\r\n {\r\n \"favoriteBookTitle\": \"Green Eggs and Ham\"\r\n }\r\n ]\r\n }\r\n }\r\n}" }, "url": { - "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/StudentParentAssociations", + "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/{{StudentParentOrContactAssociationCollectionName}}", "host": [ "{{ApiBaseUrl}}" ], @@ -5149,7 +5148,7 @@ "data", "v3", "ed-fi", - "StudentParentAssociations" + "{{StudentParentOrContactAssociationCollectionName}}" ] } }, @@ -5162,8 +5161,8 @@ "listen": "test", "script": { "exec": [ - "pm.test(\"Response is 201 or 404\", () => {", - " pm.expect(pm.response.code).to.be.oneOf([201, 404]) ", + "pm.test(\"Response is 201\", () => {", + " pm.expect(pm.response.code).to.equal(201) ", " });", "", "if (pm.response.code === 201 ) {", @@ -5314,14 +5313,14 @@ "response": [] }, { - "name": "Initialize Parent Data for Post Request -Second one", + "name": "Initialize Contact Data for Post Request -Second one", "event": [ { "listen": "test", "script": { "exec": [ - "pm.test(\"Response is 201 or 404\", () => {", - " pm.expect(pm.response.code).to.be.oneOf([201, 404]) ", + "pm.test(\"Response is 201\", () => {", + " pm.expect(pm.response.code).to.equal(201) ", " });", "", "if (pm.response.code === 201 ) {", @@ -5374,10 +5373,10 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"parentUniqueId\": \"{{supplied:{{scenarioId}}:secondParentUniqueId}}\",\r\n \"firstName\": \"{{supplied:{{scenarioId}}:secondParentFirstName}}\",\r\n \"lastSurname\": \"{{supplied:{{scenarioId}}:secondParentLastSurname}}\",\r\n \"sexDescriptor\": \"{{supplied:{{scenarioId}}:secondParentsexDescriptor}}\",\r\n \"_ext\": {\r\n \"Sample\": {\r\n \"teacherConference\": {\r\n \"dayOfWeek\": \"Monday\",\r\n \"endTime\": \"12:00:00\",\r\n \"startTime\": \"12:00:00\"\r\n },\r\n \"authors\": [],\r\n \"favoriteBookTitles\": [\r\n {\r\n \"favoriteBookTitle\": \"Green Eggs and Ham\"\r\n }\r\n ],\r\n \"isSportsFan\": false\r\n }\r\n }\r\n}" + "raw": "{\r\n \"{{ParentOrContactUniqueIdName}}\": \"{{supplied:{{scenarioId}}:secondParentUniqueId}}\",\r\n \"firstName\": \"{{supplied:{{scenarioId}}:secondParentFirstName}}\",\r\n \"lastSurname\": \"{{supplied:{{scenarioId}}:secondParentLastSurname}}\",\r\n \"sexDescriptor\": \"{{supplied:{{scenarioId}}:secondParentsexDescriptor}}\",\r\n \"_ext\": {\r\n \"Sample\": {\r\n \"teacherConference\": {\r\n \"dayOfWeek\": \"Monday\",\r\n \"endTime\": \"12:00:00\",\r\n \"startTime\": \"12:00:00\"\r\n },\r\n \"authors\": [],\r\n \"favoriteBookTitles\": [\r\n {\r\n \"favoriteBookTitle\": \"Green Eggs and Ham\"\r\n }\r\n ],\r\n \"isSportsFan\": false\r\n }\r\n }\r\n}" }, "url": { - "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/parents", + "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/{{ParentOrContactCollectionName}}", "host": [ "{{ApiBaseUrl}}" ], @@ -5385,21 +5384,21 @@ "data", "v3", "ed-fi", - "parents" + "{{ParentOrContactCollectionName}}" ] } }, "response": [] }, { - "name": "Initialize StudentParentAssociations Data for Second one", + "name": "Initialize StudentContactAssociations Data for Second one", "event": [ { "listen": "test", "script": { "exec": [ - "pm.test(\"Response is 201 or 404\", () => {", - " pm.expect(pm.response.code).to.be.oneOf([201, 404]) ", + "pm.test(\"Response is 201\", () => {", + " pm.expect(pm.response.code).to.equal(201) ", " });" ], "type": "text/javascript" @@ -5437,10 +5436,10 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"parentReference\": {\r\n \"parentUniqueId\": \"{{known:{{scenarioId}}:secondParentUniqueId}}\"\r\n },\r\n \"studentReference\": {\r\n \"studentUniqueId\": \"{{known:{{scenarioId}}:secondStudentUniqueId}}\"\r\n },\r\n \"_ext\": {\r\n \"Sample\": {\r\n \"bedtimeReader\": true,\r\n \"favoriteBookTitles\": [\r\n {\r\n \"favoriteBookTitle\": \"Green Eggs and Ham\"\r\n }\r\n ]\r\n }\r\n }\r\n}" + "raw": "{\r\n \"{{ParentOrContactName}}Reference\": {\r\n \"{{ParentOrContactUniqueIdName}}\": \"{{known:{{scenarioId}}:secondParentUniqueId}}\"\r\n },\r\n \"studentReference\": {\r\n \"studentUniqueId\": \"{{known:{{scenarioId}}:secondStudentUniqueId}}\"\r\n },\r\n \"_ext\": {\r\n \"Sample\": {\r\n \"bedtimeReader\": true,\r\n \"favoriteBookTitles\": [\r\n {\r\n \"favoriteBookTitle\": \"Green Eggs and Ham\"\r\n }\r\n ]\r\n }\r\n }\r\n}" }, "url": { - "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/StudentParentAssociations", + "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/{{StudentParentOrContactAssociationCollectionName}}", "host": [ "{{ApiBaseUrl}}" ], @@ -5448,7 +5447,7 @@ "data", "v3", "ed-fi", - "StudentParentAssociations" + "{{StudentParentOrContactAssociationCollectionName}}" ] } }, @@ -5461,8 +5460,8 @@ "listen": "test", "script": { "exec": [ - "pm.test(\"Response is 200 or 404\", () => {", - " pm.expect(pm.response.code).to.be.oneOf([200, 404]) ", + "pm.test(\"Response is 200\", () => {", + " pm.expect(pm.response.code).to.equal(200) ", " });", "if (pm.response.code === 200 ) {", " pm.test(\"Should return the authorized item\", () => {", @@ -5506,7 +5505,7 @@ } ], "url": { - "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/parents?LastSurname=LastName2001", + "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/{{ParentOrContactCollectionName}}?LastSurname=LastName2001", "host": [ "{{ApiBaseUrl}}" ], @@ -5514,7 +5513,7 @@ "data", "v3", "ed-fi", - "parents" + "{{ParentOrContactCollectionName}}" ], "query": [ { @@ -5533,8 +5532,8 @@ "listen": "test", "script": { "exec": [ - "pm.test(\"Response is 200 or 404\", () => {", - " pm.expect(pm.response.code).to.be.oneOf([200, 404]) ", + "pm.test(\"Response is 200\", () => {", + " pm.expect(pm.response.code).to.equal(200) ", "});", "", "if (pm.response.code === 200 ) {", @@ -5579,7 +5578,7 @@ } ], "url": { - "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/parents?LastSurname=LastName2002", + "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/{{ParentOrContactCollectionName}}?LastSurname=LastName2002", "host": [ "{{ApiBaseUrl}}" ], @@ -5587,7 +5586,7 @@ "data", "v3", "ed-fi", - "parents" + "{{ParentOrContactCollectionName}}" ], "query": [ { @@ -5602,7 +5601,7 @@ ] }, { - "name": "When_deleting_data_for_unrelated_parent_should_fail_with_409_Conflict", + "name": "When_deleting_data_for_unrelated_contact_should_fail_with_409_Conflict", "item": [ { "name": "Initialize Student Data for Post Request", @@ -5761,14 +5760,14 @@ "response": [] }, { - "name": "Initialize Parent Data for Post Request", + "name": "Initialize Contact Data for Post Request", "event": [ { "listen": "test", "script": { "exec": [ - "pm.test(\"Response is 201 or 404\", () => {", - " pm.expect(pm.response.code).to.be.oneOf([201, 404]) ", + "pm.test(\"Response is 201\", () => {", + " pm.expect(pm.response.code).to.equal(201) ", " });", "", "if (pm.response.code === 201 ) {", @@ -5823,10 +5822,10 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"parentUniqueId\": \"{{supplied:{{scenarioId}}:parentUniqueId}}\",\r\n \"firstName\": \"{{supplied:{{scenarioId}}:parentFirstName}}\",\r\n \"lastSurname\": \"{{supplied:{{scenarioId}}:parentLastSurname}}\",\r\n \"sexDescriptor\": \"{{supplied:{{scenarioId}}:parentSexDescriptor}}\",\r\n \"_ext\": {\r\n \"Sample\": {\r\n \"teacherConference\": {\r\n \"dayOfWeek\": \"Monday\",\r\n \"endTime\": \"12:00:00\",\r\n \"startTime\": \"12:00:00\"\r\n },\r\n \"authors\": [],\r\n \"favoriteBookTitles\": [\r\n {\r\n \"favoriteBookTitle\": \"Green Eggs and Ham\"\r\n }\r\n ],\r\n \"isSportsFan\": false\r\n }\r\n }\r\n}" + "raw": "{\r\n \"{{ParentOrContactUniqueIdName}}\": \"{{supplied:{{scenarioId}}:parentUniqueId}}\",\r\n \"firstName\": \"{{supplied:{{scenarioId}}:parentFirstName}}\",\r\n \"lastSurname\": \"{{supplied:{{scenarioId}}:parentLastSurname}}\",\r\n \"sexDescriptor\": \"{{supplied:{{scenarioId}}:parentSexDescriptor}}\",\r\n \"_ext\": {\r\n \"Sample\": {\r\n \"teacherConference\": {\r\n \"dayOfWeek\": \"Monday\",\r\n \"endTime\": \"12:00:00\",\r\n \"startTime\": \"12:00:00\"\r\n },\r\n \"authors\": [],\r\n \"favoriteBookTitles\": [\r\n {\r\n \"favoriteBookTitle\": \"Green Eggs and Ham\"\r\n }\r\n ],\r\n \"isSportsFan\": false\r\n }\r\n }\r\n}" }, "url": { - "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/parents", + "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/{{ParentOrContactCollectionName}}", "host": [ "{{ApiBaseUrl}}" ], @@ -5834,21 +5833,21 @@ "data", "v3", "ed-fi", - "parents" + "{{ParentOrContactCollectionName}}" ] } }, "response": [] }, { - "name": "Initialize StudentParentAssociations Data for Post Request", + "name": "Initialize StudentContactAssociations Data for Post Request", "event": [ { "listen": "test", "script": { "exec": [ - "pm.test(\"Response is 201 or 404\", () => {", - " pm.expect(pm.response.code).to.be.oneOf([201, 404]) ", + "pm.test(\"Response is 201\", () => {", + " pm.expect(pm.response.code).to.equal(201) ", " });", "" ], @@ -5887,10 +5886,10 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"parentReference\": {\r\n \"parentUniqueId\": \"{{known:{{scenarioId}}:parentUniqueId}}\"\r\n },\r\n \"studentReference\": {\r\n \"studentUniqueId\": \"{{known:{{scenarioId}}:studentUniqueId}}\"\r\n },\r\n \"_ext\": {\r\n \"Sample\": {\r\n \"bedtimeReader\": true,\r\n \"favoriteBookTitles\": [\r\n {\r\n \"favoriteBookTitle\": \"Green Eggs and Ham\"\r\n }\r\n ]\r\n }\r\n }\r\n}" + "raw": "{\r\n \"{{ParentOrContactName}}Reference\": {\r\n \"{{ParentOrContactUniqueIdName}}\": \"{{known:{{scenarioId}}:parentUniqueId}}\"\r\n },\r\n \"studentReference\": {\r\n \"studentUniqueId\": \"{{known:{{scenarioId}}:studentUniqueId}}\"\r\n },\r\n \"_ext\": {\r\n \"Sample\": {\r\n \"bedtimeReader\": true,\r\n \"favoriteBookTitles\": [\r\n {\r\n \"favoriteBookTitle\": \"Green Eggs and Ham\"\r\n }\r\n ]\r\n }\r\n }\r\n}" }, "url": { - "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/StudentParentAssociations", + "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/{{StudentParentOrContactAssociationCollectionName}}", "host": [ "{{ApiBaseUrl}}" ], @@ -5898,14 +5897,14 @@ "data", "v3", "ed-fi", - "StudentParentAssociations" + "{{StudentParentOrContactAssociationCollectionName}}" ] } }, "response": [] }, { - "name": "When_deleting_an_unassociated_parent_should_fail_with_403_forbidden", + "name": "When_deleting_an_unassociated_contact_should_fail_with_403_forbidden", "event": [ { "listen": "test", @@ -5950,7 +5949,7 @@ } ], "url": { - "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/parents/{{known:{{scenarioId}}:parentGuid}}", + "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/{{ParentOrContactCollectionName}}/{{known:{{scenarioId}}:parentGuid}}", "host": [ "{{ApiBaseUrl}}" ], @@ -5958,7 +5957,7 @@ "data", "v3", "ed-fi", - "parents", + "{{ParentOrContactCollectionName}}", "{{known:{{scenarioId}}:parentGuid}}" ] } @@ -5968,7 +5967,7 @@ ] }, { - "name": "When_associating_a_parent_not_related_to_vendors_leas_should_fail_with_403_forbidden", + "name": "When_associating_a_contact_not_related_to_vendors_leas_should_fail_with_403_forbidden", "item": [ { "name": "Initialize Student Data for Post Request", @@ -6130,14 +6129,14 @@ "response": [] }, { - "name": "Initialize Parent Data for Post Request", + "name": "Initialize Contact Data for Post Request", "event": [ { "listen": "test", "script": { "exec": [ - "pm.test(\"Response is 201 or 404\", () => {", - " pm.expect(pm.response.code).to.be.oneOf([201, 404]) ", + "pm.test(\"Response is 201\", () => {", + " pm.expect(pm.response.code).to.equal(201) ", " });", "", "if (pm.response.code === 201 ) {", @@ -6193,10 +6192,10 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"parentUniqueId\": \"{{supplied:{{scenarioId}}:parentUniqueId}}\",\r\n \"firstName\": \"{{supplied:{{scenarioId}}:parentFirstName}}\",\r\n \"lastSurname\": \"{{supplied:{{scenarioId}}:parentLastSurname}}\",\r\n \"sexDescriptor\": \"{{supplied:{{scenarioId}}:parentSexDescriptor}}\",\r\n \"_ext\": {\r\n \"Sample\": {\r\n \"teacherConference\": {\r\n \"dayOfWeek\": \"Monday\",\r\n \"endTime\": \"12:00:00\",\r\n \"startTime\": \"12:00:00\"\r\n },\r\n \"authors\": [],\r\n \"favoriteBookTitles\": [\r\n {\r\n \"favoriteBookTitle\": \"Green Eggs and Ham\"\r\n }\r\n ],\r\n \"isSportsFan\": false\r\n }\r\n }\r\n}" + "raw": "{\r\n \"{{ParentOrContactUniqueIdName}}\": \"{{supplied:{{scenarioId}}:parentUniqueId}}\",\r\n \"firstName\": \"{{supplied:{{scenarioId}}:parentFirstName}}\",\r\n \"lastSurname\": \"{{supplied:{{scenarioId}}:parentLastSurname}}\",\r\n \"sexDescriptor\": \"{{supplied:{{scenarioId}}:parentSexDescriptor}}\",\r\n \"_ext\": {\r\n \"Sample\": {\r\n \"teacherConference\": {\r\n \"dayOfWeek\": \"Monday\",\r\n \"endTime\": \"12:00:00\",\r\n \"startTime\": \"12:00:00\"\r\n },\r\n \"authors\": [],\r\n \"favoriteBookTitles\": [\r\n {\r\n \"favoriteBookTitle\": \"Green Eggs and Ham\"\r\n }\r\n ],\r\n \"isSportsFan\": false\r\n }\r\n }\r\n}" }, "url": { - "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/parents", + "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/{{ParentOrContactCollectionName}}", "host": [ "{{ApiBaseUrl}}" ], @@ -6204,21 +6203,21 @@ "data", "v3", "ed-fi", - "parents" + "{{ParentOrContactCollectionName}}" ] } }, "response": [] }, { - "name": "When_associating_a_parent_not_related_to_vendors_leas_should_fail_with_403_forbidden", + "name": "When_associating_a_contact_not_related_to_vendors_leas_should_fail_with_403_forbidden", "event": [ { "listen": "test", "script": { "exec": [ - "pm.test(\"Response is 201 or 403 or 404\", () => {", - " pm.expect(pm.response.code).to.be.oneOf([201, 403, 404]) ", + "pm.test(\"Response is 201 or 403\", () => {", + " pm.expect(pm.response.code).to.be.oneOf([201, 403]) ", " });" ], "type": "text/javascript" @@ -6256,10 +6255,10 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"parentReference\": {\r\n \"parentUniqueId\": \"{{known:{{scenarioId}}:parentUniqueId}}\"\r\n },\r\n \"studentReference\": {\r\n \"studentUniqueId\": \"{{known:{{scenarioId}}:studentUniqueId}}\"\r\n },\r\n \"_ext\": {\r\n \"Sample\": {\r\n \"bedtimeReader\": true\r\n }\r\n }\r\n}" + "raw": "{\r\n \"{{ParentOrContactName}}Reference\": {\r\n \"{{ParentOrContactUniqueIdName}}\": \"{{known:{{scenarioId}}:parentUniqueId}}\"\r\n },\r\n \"studentReference\": {\r\n \"studentUniqueId\": \"{{known:{{scenarioId}}:studentUniqueId}}\"\r\n },\r\n \"_ext\": {\r\n \"Sample\": {\r\n \"bedtimeReader\": true\r\n }\r\n }\r\n}" }, "url": { - "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/StudentParentAssociations", + "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/{{StudentParentOrContactAssociationCollectionName}}", "host": [ "{{ApiBaseUrl}}" ], @@ -6267,7 +6266,7 @@ "data", "v3", "ed-fi", - "StudentParentAssociations" + "{{StudentParentOrContactAssociationCollectionName}}" ] } }, @@ -12187,6 +12186,18 @@ " \"ApiSecret_2001_2002\")", "", "", + "// Set variables related to data standard specific contact/parent variablility ", + "let ParentOrContactProperName = pm.environment.get(\"ParentOrContactProperName\");", + "let StudentParentOrContactAssociationCollectionName = \"Student\" + ParentOrContactProperName + \"Associations\";", + "let ParentOrContactUniqueIdName = ParentOrContactProperName + \"UniqueId\";", + "let ParentOrContactName = ParentOrContactProperName.toLowerCase();", + "let ParentOrContactCollectionName = ParentOrContactName + \"s\";", + "", + "pm.environment.set(\"StudentParentOrContactAssociationCollectionName\", StudentParentOrContactAssociationCollectionName);", + "pm.environment.set(\"ParentOrContactUniqueIdName\", ParentOrContactUniqueIdName);", + "pm.environment.set(\"ParentOrContactName\", ParentOrContactName);", + "pm.environment.set(\"ParentOrContactCollectionName\", ParentOrContactCollectionName);", + "", "// Adapted from: https://marcin-chwedczuk.github.io/automatically-generate-new-oauth2-tokens-when-using-postman", "// Assumes Environment with Environment Variables: ApiBaseUrl, ApiKey, ApiSecret", "// See https://gist.github.com/blmeyers/21138bbe6f80b8c35701a8754bfe59d5 for an environment sample for Local (NOTE: environment variable names have been changed from the gist -- you must adjust accordingly)", diff --git a/Postman Test Suite/Ed-Fi ODS-API Integration Test Suite AuthorizationTests.postman_collection.json b/Postman Test Suite/Ed-Fi ODS-API Integration Test Suite AuthorizationTests.postman_collection.json index d2aadad057..c1d0ac08aa 100644 --- a/Postman Test Suite/Ed-Fi ODS-API Integration Test Suite AuthorizationTests.postman_collection.json +++ b/Postman Test Suite/Ed-Fi ODS-API Integration Test Suite AuthorizationTests.postman_collection.json @@ -2884,10 +2884,10 @@ ] }, { - "name": "ParentAuthorizationTests", + "name": "ContactAuthorizationTests", "item": [ { - "name": "When_updating_an_associated_parent_should_succeed", + "name": "When_updating_an_associated_contact_should_succeed", "item": [ { "name": "Initialize Student Data for Post Request", @@ -3034,14 +3034,14 @@ "response": [] }, { - "name": "Initialize Parent Data for Post Request", + "name": "Initialize Contact Data for Post Request", "event": [ { "listen": "test", "script": { "exec": [ - "pm.test(\"Response is 201 or 404\", () => {", - " pm.expect(pm.response.code).to.be.oneOf([201, 404]) ", + "pm.test(\"Response is 201\", () => {", + " pm.expect(pm.response.code).to.equal(201) ", " });", "", "if (pm.response.code === 201 ) {", @@ -3086,7 +3086,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"parentUniqueId\": \"{{supplied:{{scenarioId}}:parentUniqueId}}\",\r\n \"firstName\": \"{{supplied:{{scenarioId}}:firstName}}\",\r\n \"lastSurname\": \"{{supplied:{{scenarioId}}:lastSurname}}\",\r\n \"sexDescriptor\": \"{{supplied:{{scenarioId}}:sexDescriptor}}\",\r\n \"_ext\": {\r\n \"Sample\": {\r\n \"teacherConference\": {\r\n \"dayOfWeek\": \"Monday\",\r\n \"endTime\": \"12:00:00\",\r\n \"startTime\": \"12:00:00\"\r\n },\r\n \"authors\": [],\r\n \"favoriteBookTitles\": [\r\n {\r\n \"favoriteBookTitle\": \"Green Eggs and Ham\"\r\n }\r\n ],\r\n \"isSportsFan\": false\r\n }\r\n }\r\n}", + "raw": "{\r\n \"{{ParentOrContactUniqueIdName}}\": \"{{supplied:{{scenarioId}}:parentUniqueId}}\",\r\n \"firstName\": \"{{supplied:{{scenarioId}}:firstName}}\",\r\n \"lastSurname\": \"{{supplied:{{scenarioId}}:lastSurname}}\",\r\n \"sexDescriptor\": \"{{supplied:{{scenarioId}}:sexDescriptor}}\",\r\n \"_ext\": {\r\n \"Sample\": {\r\n \"teacherConference\": {\r\n \"dayOfWeek\": \"Monday\",\r\n \"endTime\": \"12:00:00\",\r\n \"startTime\": \"12:00:00\"\r\n },\r\n \"authors\": [],\r\n \"favoriteBookTitles\": [\r\n {\r\n \"favoriteBookTitle\": \"Green Eggs and Ham\"\r\n }\r\n ],\r\n \"isSportsFan\": false\r\n }\r\n }\r\n}", "options": { "raw": { "language": "json" @@ -3094,7 +3094,7 @@ } }, "url": { - "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/parents", + "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/{{ParentOrContactCollectionName}}", "host": [ "{{ApiBaseUrl}}" ], @@ -3102,21 +3102,21 @@ "data", "v3", "ed-fi", - "parents" + "{{ParentOrContactCollectionName}}" ] } }, "response": [] }, { - "name": "Initialize StudentParentAssociations Data for Post Request", + "name": "Initialize StudentContactAssociations Data for Post Request", "event": [ { "listen": "test", "script": { "exec": [ - "pm.test(\"Response is 201 or 404\", () => {", - " pm.expect(pm.response.code).to.be.oneOf([201, 404]) ", + "pm.test(\"Response is 201\", () => {", + " pm.expect(pm.response.code).to.equal(201) ", " });" ], "type": "text/javascript" @@ -3144,7 +3144,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"parentReference\": {\r\n \"parentUniqueId\": \"{{known:{{scenarioId}}:parentUniqueId}}\"\r\n },\r\n \"studentReference\": {\r\n \"studentUniqueId\": \"{{known:{{scenarioId}}:studentUniqueId}}\"\r\n },\r\n \"_ext\": {\r\n \"Sample\": {\r\n \"bedtimeReader\": true,\r\n \"favoriteBookTitles\": [\r\n {\r\n \"favoriteBookTitle\": \"Green Eggs and Ham\"\r\n }\r\n ]\r\n }\r\n }\r\n}", + "raw": "{\r\n \"{{ParentOrContactName}}Reference\": {\r\n \"{{ParentOrContactUniqueIdName}}\": \"{{known:{{scenarioId}}:parentUniqueId}}\"\r\n },\r\n \"studentReference\": {\r\n \"studentUniqueId\": \"{{known:{{scenarioId}}:studentUniqueId}}\"\r\n },\r\n \"_ext\": {\r\n \"Sample\": {\r\n \"bedtimeReader\": true,\r\n \"favoriteBookTitles\": [\r\n {\r\n \"favoriteBookTitle\": \"Green Eggs and Ham\"\r\n }\r\n ]\r\n }\r\n }\r\n}", "options": { "raw": { "language": "json" @@ -3152,7 +3152,7 @@ } }, "url": { - "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/StudentParentAssociations", + "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/{{StudentParentOrContactAssociationCollectionName}}", "host": [ "{{ApiBaseUrl}}" ], @@ -3160,21 +3160,21 @@ "data", "v3", "ed-fi", - "StudentParentAssociations" + "{{StudentParentOrContactAssociationCollectionName}}" ] } }, "response": [] }, { - "name": "When_updating_an_associated_parent_should_succeed", + "name": "When_updating_an_associated_contact_should_succeed", "event": [ { "listen": "test", "script": { "exec": [ - "pm.test(\"Response is 204 or 404\", () => {", - " pm.expect(pm.response.code).to.be.oneOf([204, 404]) ", + "pm.test(\"Response is 204\", () => {", + " pm.expect(pm.response.code).to.equal(204) ", " });" ], "type": "text/javascript" @@ -3206,7 +3206,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"firstName\": \"{{supplied:{{scenarioId}}:firstName}}\",\r\n \"lastSurname\": \"{{supplied:{{scenarioId}}:lastSurname}}\",\r\n \"parentUniqueId\": \"{{supplied:{{scenarioId}}:parentUniqueId}}\",\r\n \"_ext\": {\r\n \"Sample\": {\r\n \"teacherConference\": {\r\n \"dayOfWeek\": \"Monday\",\r\n \"endTime\": \"12:00:00\",\r\n \"startTime\": \"12:00:00\"\r\n },\r\n \"authors\": [],\r\n \"favoriteBookTitles\": [\r\n {\r\n \"favoriteBookTitle\": \"Green Eggs and Ham\"\r\n }\r\n ],\r\n \"isSportsFan\": false\r\n }\r\n }\r\n}", + "raw": "{\r\n \"firstName\": \"{{supplied:{{scenarioId}}:firstName}}\",\r\n \"lastSurname\": \"{{supplied:{{scenarioId}}:lastSurname}}\",\r\n \"{{ParentOrContactUniqueIdName}}\": \"{{supplied:{{scenarioId}}:parentUniqueId}}\",\r\n \"_ext\": {\r\n \"Sample\": {\r\n \"teacherConference\": {\r\n \"dayOfWeek\": \"Monday\",\r\n \"endTime\": \"12:00:00\",\r\n \"startTime\": \"12:00:00\"\r\n },\r\n \"authors\": [],\r\n \"favoriteBookTitles\": [\r\n {\r\n \"favoriteBookTitle\": \"Green Eggs and Ham\"\r\n }\r\n ],\r\n \"isSportsFan\": false\r\n }\r\n }\r\n}", "options": { "raw": { "language": "json" @@ -3214,7 +3214,7 @@ } }, "url": { - "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/parents/{{known:{{scenarioId}}:parentGuid}}", + "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/{{ParentOrContactCollectionName}}/{{known:{{scenarioId}}:parentGuid}}", "host": [ "{{ApiBaseUrl}}" ], @@ -3222,7 +3222,7 @@ "data", "v3", "ed-fi", - "parents", + "{{ParentOrContactCollectionName}}", "{{known:{{scenarioId}}:parentGuid}}" ] } @@ -3232,7 +3232,7 @@ ] }, { - "name": "When_associating_a_parent_related_to_vendors_leas_should_return_201_created", + "name": "When_associating_a_contact_related_to_vendors_leas_should_return_201_created", "item": [ { "name": "Initialize Student Data for Post Request", @@ -3379,14 +3379,14 @@ "response": [] }, { - "name": "Initialize Parent Data for Post Request", + "name": "Initialize Contact Data for Post Request", "event": [ { "listen": "test", "script": { "exec": [ - "pm.test(\"Response is 201 or 404\", () => {", - " pm.expect(pm.response.code).to.be.oneOf([201, 404]) ", + "pm.test(\"Response is 201\", () => {", + " pm.expect(pm.response.code).to.equal(201) ", " });", "", "if (pm.response.code === 201 ) {", @@ -3432,7 +3432,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"parentUniqueId\": \"{{supplied:{{scenarioId}}:parentUniqueId}}\",\r\n \"firstName\": \"{{supplied:{{scenarioId}}:firstName}}\",\r\n \"lastSurname\": \"{{supplied:{{scenarioId}}:lastSurname}}\",\r\n \"sexDescriptor\": \"{{supplied:{{scenarioId}}:sexDescriptor}}\",\r\n \"_ext\": {\r\n \"Sample\": {\r\n \"teacherConference\": {\r\n \"dayOfWeek\": \"Monday\",\r\n \"endTime\": \"12:00:00\",\r\n \"startTime\": \"12:00:00\"\r\n },\r\n \"authors\": [],\r\n \"favoriteBookTitles\": [\r\n {\r\n \"favoriteBookTitle\": \"Green Eggs and Ham\"\r\n }\r\n ],\r\n \"isSportsFan\": false\r\n }\r\n }\r\n}", + "raw": "{\r\n \"{{ParentOrContactUniqueIdName}}\": \"{{supplied:{{scenarioId}}:parentUniqueId}}\",\r\n \"firstName\": \"{{supplied:{{scenarioId}}:firstName}}\",\r\n \"lastSurname\": \"{{supplied:{{scenarioId}}:lastSurname}}\",\r\n \"sexDescriptor\": \"{{supplied:{{scenarioId}}:sexDescriptor}}\",\r\n \"_ext\": {\r\n \"Sample\": {\r\n \"teacherConference\": {\r\n \"dayOfWeek\": \"Monday\",\r\n \"endTime\": \"12:00:00\",\r\n \"startTime\": \"12:00:00\"\r\n },\r\n \"authors\": [],\r\n \"favoriteBookTitles\": [\r\n {\r\n \"favoriteBookTitle\": \"Green Eggs and Ham\"\r\n }\r\n ],\r\n \"isSportsFan\": false\r\n }\r\n }\r\n}", "options": { "raw": { "language": "json" @@ -3440,7 +3440,7 @@ } }, "url": { - "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/parents", + "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/{{ParentOrContactCollectionName}}", "host": [ "{{ApiBaseUrl}}" ], @@ -3448,21 +3448,21 @@ "data", "v3", "ed-fi", - "parents" + "{{ParentOrContactCollectionName}}" ] } }, "response": [] }, { - "name": "When_associating_a_parent_related_to_vendors_leas_should_return_201_created", + "name": "When_associating_a_contact_related_to_vendors_leas_should_return_201_created", "event": [ { "listen": "test", "script": { "exec": [ - "pm.test(\"Response is 201 or 404\", () => {", - " pm.expect(pm.response.code).to.be.oneOf([201, 404]) ", + "pm.test(\"Response is 201\", () => {", + " pm.expect(pm.response.code).to.equal(201) ", " });" ], "type": "text/javascript" @@ -3490,7 +3490,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"parentReference\": {\r\n \"parentUniqueId\": \"{{known:{{scenarioId}}:parentUniqueId}}\"\r\n },\r\n \"studentReference\": {\r\n \"studentUniqueId\": \"{{known:{{scenarioId}}:studentUniqueId}}\"\r\n },\r\n \"_ext\": {\r\n \"Sample\": {\r\n \"bedtimeReader\": true,\r\n \"favoriteBookTitles\": [\r\n {\r\n \"favoriteBookTitle\": \"Green Eggs and Ham\"\r\n }\r\n ]\r\n }\r\n }\r\n}", + "raw": "{\r\n \"{{ParentOrContactName}}Reference\": {\r\n \"{{ParentOrContactUniqueIdName}}\": \"{{known:{{scenarioId}}:parentUniqueId}}\"\r\n },\r\n \"studentReference\": {\r\n \"studentUniqueId\": \"{{known:{{scenarioId}}:studentUniqueId}}\"\r\n },\r\n \"_ext\": {\r\n \"Sample\": {\r\n \"bedtimeReader\": true,\r\n \"favoriteBookTitles\": [\r\n {\r\n \"favoriteBookTitle\": \"Green Eggs and Ham\"\r\n }\r\n ]\r\n }\r\n }\r\n}", "options": { "raw": { "language": "json" @@ -3498,7 +3498,7 @@ } }, "url": { - "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/StudentParentAssociations", + "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/{{StudentParentOrContactAssociationCollectionName}}", "host": [ "{{ApiBaseUrl}}" ], @@ -3506,21 +3506,21 @@ "data", "v3", "ed-fi", - "StudentParentAssociations" + "{{StudentParentOrContactAssociationCollectionName}}" ] } }, "response": [] }, { - "name": "When_updating_an_associated_parent_should_succeed", + "name": "When_updating_an_associated_contact_should_succeed", "event": [ { "listen": "test", "script": { "exec": [ - "pm.test(\"Response is 204 or 404\", () => {", - " pm.expect(pm.response.code).to.be.oneOf([204, 404]) ", + "pm.test(\"Response is 204\", () => {", + " pm.expect(pm.response.code).to.equal(204) ", " });" ], "type": "text/javascript" @@ -3552,7 +3552,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"firstName\": \"{{supplied:{{scenarioId}}:firstName}}\",\r\n \"lastSurname\": \"{{supplied:{{scenarioId}}:lastSurname}}\",\r\n \"parentUniqueId\": \"{{supplied:{{scenarioId}}:parentUniqueId}}\",\r\n \"_ext\": {\r\n \"Sample\": {\r\n \"teacherConference\": {\r\n \"dayOfWeek\": \"Monday\",\r\n \"endTime\": \"12:00:00\",\r\n \"startTime\": \"12:00:00\"\r\n },\r\n \"authors\": [],\r\n \"favoriteBookTitles\": [\r\n {\r\n \"favoriteBookTitle\": \"Green Eggs and Ham\"\r\n }\r\n ],\r\n \"isSportsFan\": false\r\n }\r\n }\r\n}", + "raw": "{\r\n \"firstName\": \"{{supplied:{{scenarioId}}:firstName}}\",\r\n \"lastSurname\": \"{{supplied:{{scenarioId}}:lastSurname}}\",\r\n \"{{ParentOrContactUniqueIdName}}\": \"{{supplied:{{scenarioId}}:parentUniqueId}}\",\r\n \"_ext\": {\r\n \"Sample\": {\r\n \"teacherConference\": {\r\n \"dayOfWeek\": \"Monday\",\r\n \"endTime\": \"12:00:00\",\r\n \"startTime\": \"12:00:00\"\r\n },\r\n \"authors\": [],\r\n \"favoriteBookTitles\": [\r\n {\r\n \"favoriteBookTitle\": \"Green Eggs and Ham\"\r\n }\r\n ],\r\n \"isSportsFan\": false\r\n }\r\n }\r\n}", "options": { "raw": { "language": "json" @@ -3560,7 +3560,7 @@ } }, "url": { - "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/parents/{{known:{{scenarioId}}:parentGuid}}", + "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/{{ParentOrContactCollectionName}}/{{known:{{scenarioId}}:parentGuid}}", "host": [ "{{ApiBaseUrl}}" ], @@ -3568,7 +3568,7 @@ "data", "v3", "ed-fi", - "parents", + "{{ParentOrContactCollectionName}}", "{{known:{{scenarioId}}:parentGuid}}" ] } @@ -3578,7 +3578,7 @@ ] }, { - "name": "When_deleting_a_parent_in_use_should_return_409_conflict", + "name": "When_deleting_a_contact_in_use_should_return_409_conflict", "item": [ { "name": "Initialize Student Data for Post Request", @@ -3725,14 +3725,14 @@ "response": [] }, { - "name": "Initialize Parent Data for Post Request", + "name": "Initialize Contact Data for Post Request", "event": [ { "listen": "test", "script": { "exec": [ - "pm.test(\"Response is 201 or 404\", () => {", - " pm.expect(pm.response.code).to.be.oneOf([201, 404]) ", + "pm.test(\"Response is 201\", () => {", + " pm.expect(pm.response.code).to.equal(201) ", " });", "", "if (pm.response.code === 201 ) {", @@ -3778,7 +3778,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"parentUniqueId\": \"{{supplied:{{scenarioId}}:parentUniqueId}}\",\r\n \"firstName\": \"{{supplied:{{scenarioId}}:firstName}}\",\r\n \"lastSurname\": \"{{supplied:{{scenarioId}}:lastSurname}}\",\r\n \"sexDescriptor\": \"{{supplied:{{scenarioId}}:sexDescriptor}}\",\r\n \"_ext\": {\r\n \"Sample\": {\r\n \"teacherConference\": {\r\n \"dayOfWeek\": \"Monday\",\r\n \"endTime\": \"12:00:00\",\r\n \"startTime\": \"12:00:00\"\r\n },\r\n \"authors\": [],\r\n \"favoriteBookTitles\": [\r\n {\r\n \"favoriteBookTitle\": \"Green Eggs and Ham\"\r\n }\r\n ],\r\n \"isSportsFan\": false\r\n }\r\n }\r\n}", + "raw": "{\r\n \"{{ParentOrContactUniqueIdName}}\": \"{{supplied:{{scenarioId}}:parentUniqueId}}\",\r\n \"firstName\": \"{{supplied:{{scenarioId}}:firstName}}\",\r\n \"lastSurname\": \"{{supplied:{{scenarioId}}:lastSurname}}\",\r\n \"sexDescriptor\": \"{{supplied:{{scenarioId}}:sexDescriptor}}\",\r\n \"_ext\": {\r\n \"Sample\": {\r\n \"teacherConference\": {\r\n \"dayOfWeek\": \"Monday\",\r\n \"endTime\": \"12:00:00\",\r\n \"startTime\": \"12:00:00\"\r\n },\r\n \"authors\": [],\r\n \"favoriteBookTitles\": [\r\n {\r\n \"favoriteBookTitle\": \"Green Eggs and Ham\"\r\n }\r\n ],\r\n \"isSportsFan\": false\r\n }\r\n }\r\n}", "options": { "raw": { "language": "json" @@ -3786,7 +3786,7 @@ } }, "url": { - "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/parents", + "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/{{ParentOrContactCollectionName}}", "host": [ "{{ApiBaseUrl}}" ], @@ -3794,21 +3794,21 @@ "data", "v3", "ed-fi", - "parents" + "{{ParentOrContactCollectionName}}" ] } }, "response": [] }, { - "name": "Initialize StudentParentAssociations Data for Post Request", + "name": "Initialize StudentContactAssociations Data for Post Request", "event": [ { "listen": "test", "script": { "exec": [ - "pm.test(\"Response is 201 or 404\", () => {", - " pm.expect(pm.response.code).to.be.oneOf([201, 404]) ", + "pm.test(\"Response is 201\", () => {", + " pm.expect(pm.response.code).to.equal(201) ", " });" ], "type": "text/javascript" @@ -3836,7 +3836,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"parentReference\": {\r\n \"parentUniqueId\": \"{{known:{{scenarioId}}:parentUniqueId}}\"\r\n },\r\n \"studentReference\": {\r\n \"studentUniqueId\": \"{{known:{{scenarioId}}:studentUniqueId}}\"\r\n },\r\n \"_ext\": {\r\n \"Sample\": {\r\n \"bedtimeReader\": true,\r\n \"favoriteBookTitles\": [\r\n {\r\n \"favoriteBookTitle\": \"Green Eggs and Ham\"\r\n }\r\n ]\r\n }\r\n }\r\n}", + "raw": "{\r\n \"{{ParentOrContactName}}Reference\": {\r\n \"{{ParentOrContactUniqueIdName}}\": \"{{known:{{scenarioId}}:parentUniqueId}}\"\r\n },\r\n \"studentReference\": {\r\n \"studentUniqueId\": \"{{known:{{scenarioId}}:studentUniqueId}}\"\r\n },\r\n \"_ext\": {\r\n \"Sample\": {\r\n \"bedtimeReader\": true,\r\n \"favoriteBookTitles\": [\r\n {\r\n \"favoriteBookTitle\": \"Green Eggs and Ham\"\r\n }\r\n ]\r\n }\r\n }\r\n}", "options": { "raw": { "language": "json" @@ -3844,7 +3844,7 @@ } }, "url": { - "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/StudentParentAssociations", + "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/{{StudentParentOrContactAssociationCollectionName}}", "host": [ "{{ApiBaseUrl}}" ], @@ -3852,21 +3852,21 @@ "data", "v3", "ed-fi", - "StudentParentAssociations" + "{{StudentParentOrContactAssociationCollectionName}}" ] } }, "response": [] }, { - "name": "When_deleting_an_associated_parent_should_return_409_conflict", + "name": "When_deleting_an_associated_contact_should_return_409_conflict", "event": [ { "listen": "test", "script": { "exec": [ - "pm.test(\"Response is 409 or 404\", () => {", - " pm.expect(pm.response.code).to.be.oneOf([409, 404]) ", + "pm.test(\"Response is 409\", () => {", + " pm.expect(pm.response.code).to.equal(409) ", " });", "" ], @@ -3887,7 +3887,7 @@ "method": "DELETE", "header": [], "url": { - "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/parents/{{known:{{scenarioId}}:parentGuid}}", + "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/{{ParentOrContactCollectionName}}/{{known:{{scenarioId}}:parentGuid}}", "host": [ "{{ApiBaseUrl}}" ], @@ -3895,7 +3895,7 @@ "data", "v3", "ed-fi", - "parents", + "{{ParentOrContactCollectionName}}", "{{known:{{scenarioId}}:parentGuid}}" ] } @@ -3905,17 +3905,17 @@ ] }, { - "name": "When_deleting_an_unused_parent_should_return_204_nocontent", + "name": "When_deleting_an_unused_contact_should_return_204_nocontent", "item": [ { - "name": "Initialize Parent Data for Post Request", + "name": "Initialize Contact Data for Post Request", "event": [ { "listen": "test", "script": { "exec": [ - "pm.test(\"Response is 201 or 404\", () => {", - " pm.expect(pm.response.code).to.be.oneOf([201, 404]) ", + "pm.test(\"Response is 201\", () => {", + " pm.expect(pm.response.code).to.equal(201) ", " });", "", "if (pm.response.code === 201 ) {", @@ -3961,7 +3961,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"parentUniqueId\": \"{{supplied:{{scenarioId}}:parentUniqueId}}\",\r\n \"firstName\": \"{{supplied:{{scenarioId}}:firstName}}\",\r\n \"lastSurname\": \"{{supplied:{{scenarioId}}:lastSurname}}\",\r\n \"sexDescriptor\": \"{{supplied:{{scenarioId}}:sexDescriptor}}\",\r\n \"_ext\": {\r\n \"Sample\": {\r\n \"teacherConference\": {\r\n \"dayOfWeek\": \"Monday\",\r\n \"endTime\": \"12:00:00\",\r\n \"startTime\": \"12:00:00\"\r\n },\r\n \"authors\": [],\r\n \"favoriteBookTitles\": [\r\n {\r\n \"favoriteBookTitle\": \"Green Eggs and Ham\"\r\n }\r\n ],\r\n \"isSportsFan\": false\r\n }\r\n }\r\n}", + "raw": "{\r\n \"{{ParentOrContactUniqueIdName}}\": \"{{supplied:{{scenarioId}}:parentUniqueId}}\",\r\n \"firstName\": \"{{supplied:{{scenarioId}}:firstName}}\",\r\n \"lastSurname\": \"{{supplied:{{scenarioId}}:lastSurname}}\",\r\n \"sexDescriptor\": \"{{supplied:{{scenarioId}}:sexDescriptor}}\",\r\n \"_ext\": {\r\n \"Sample\": {\r\n \"teacherConference\": {\r\n \"dayOfWeek\": \"Monday\",\r\n \"endTime\": \"12:00:00\",\r\n \"startTime\": \"12:00:00\"\r\n },\r\n \"authors\": [],\r\n \"favoriteBookTitles\": [\r\n {\r\n \"favoriteBookTitle\": \"Green Eggs and Ham\"\r\n }\r\n ],\r\n \"isSportsFan\": false\r\n }\r\n }\r\n}", "options": { "raw": { "language": "json" @@ -3969,7 +3969,7 @@ } }, "url": { - "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/parents", + "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/{{ParentOrContactCollectionName}}", "host": [ "{{ApiBaseUrl}}" ], @@ -3977,21 +3977,21 @@ "data", "v3", "ed-fi", - "parents" + "{{ParentOrContactCollectionName}}" ] } }, "response": [] }, { - "name": "When_deleting_an_unused_parent_should_return_204_nocontent", + "name": "When_deleting_an_unused_contact_should_return_204_nocontent", "event": [ { "listen": "test", "script": { "exec": [ - "pm.test(\"Response is 204 or 404\", () => {", - " pm.expect(pm.response.code).to.be.oneOf([204, 404]) ", + "pm.test(\"Response is 204\", () => {", + " pm.expect(pm.response.code).to.equal(204) ", " });", "" ], @@ -4012,7 +4012,7 @@ "method": "DELETE", "header": [], "url": { - "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/parents/{{known:{{scenarioId}}:parentGuid}}", + "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/{{ParentOrContactCollectionName}}/{{known:{{scenarioId}}:parentGuid}}", "host": [ "{{ApiBaseUrl}}" ], @@ -4020,7 +4020,7 @@ "data", "v3", "ed-fi", - "parents", + "{{ParentOrContactCollectionName}}", "{{known:{{scenarioId}}:parentGuid}}" ] } @@ -4030,17 +4030,17 @@ ] }, { - "name": "When_creating_a_parent_Should_return_201_created", + "name": "When_creating_a_contact_Should_return_201_created", "item": [ { - "name": "When_creating_a_parent_Should_return_201_created", + "name": "When_creating_a_contact_Should_return_201_created", "event": [ { "listen": "test", "script": { "exec": [ - "pm.test(\"Response is 201 or 404\", () => {", - " pm.expect(pm.response.code).to.be.oneOf([201, 404]) ", + "pm.test(\"Response is 201\", () => {", + " pm.expect(pm.response.code).to.equal(201) ", " });", " " ], @@ -4079,7 +4079,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"parentUniqueId\": \"{{supplied:{{scenarioId}}:parentUniqueId}}\",\r\n \"firstName\": \"{{supplied:{{scenarioId}}:firstName}}\",\r\n \"lastSurname\": \"{{supplied:{{scenarioId}}:lastSurname}}\",\r\n \"sexDescriptor\": \"{{supplied:{{scenarioId}}:sexDescriptor}}\",\r\n \"_ext\": {\r\n \"Sample\": {\r\n \"teacherConference\": {\r\n \"dayOfWeek\": \"Monday\",\r\n \"endTime\": \"12:00:00\",\r\n \"startTime\": \"12:00:00\"\r\n },\r\n \"authors\": [],\r\n \"favoriteBookTitles\": [\r\n {\r\n \"favoriteBookTitle\": \"Green Eggs and Ham\"\r\n }\r\n ],\r\n \"isSportsFan\": false\r\n }\r\n }\r\n}", + "raw": "{\r\n \"{{ParentOrContactUniqueIdName}}\": \"{{supplied:{{scenarioId}}:parentUniqueId}}\",\r\n \"firstName\": \"{{supplied:{{scenarioId}}:firstName}}\",\r\n \"lastSurname\": \"{{supplied:{{scenarioId}}:lastSurname}}\",\r\n \"sexDescriptor\": \"{{supplied:{{scenarioId}}:sexDescriptor}}\",\r\n \"_ext\": {\r\n \"Sample\": {\r\n \"teacherConference\": {\r\n \"dayOfWeek\": \"Monday\",\r\n \"endTime\": \"12:00:00\",\r\n \"startTime\": \"12:00:00\"\r\n },\r\n \"authors\": [],\r\n \"favoriteBookTitles\": [\r\n {\r\n \"favoriteBookTitle\": \"Green Eggs and Ham\"\r\n }\r\n ],\r\n \"isSportsFan\": false\r\n }\r\n }\r\n}", "options": { "raw": { "language": "json" @@ -4087,7 +4087,7 @@ } }, "url": { - "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/parents", + "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/{{ParentOrContactCollectionName}}", "host": [ "{{ApiBaseUrl}}" ], @@ -4095,7 +4095,7 @@ "data", "v3", "ed-fi", - "parents" + "{{ParentOrContactCollectionName}}" ] } }, @@ -5416,7 +5416,7 @@ "script": { "exec": [ "pm.test(\"Response is 201 or 404\", () => {\r", - " pm.expect(pm.response.code).to.be.oneOf([201, 404]) \r", + " pm.expect(pm.response.code).to.be.oneOf([201,404])\r", " });\r", "\r", "if (pm.response.code === 201) {\r", @@ -5526,7 +5526,7 @@ "script": { "exec": [ "pm.test(\"Response is 201 or 404\", () => {\r", - " pm.expect(pm.response.code).to.be.oneOf([201, 404]) \r", + " pm.expect(pm.response.code).to.be.oneOf([201,404])\r", " });\r", "\r", "if (pm.response.code === 201) {\r", @@ -8073,7 +8073,7 @@ "script": { "exec": [ "pm.test(\"Response is 201 or 404\", () => {\r", - " pm.expect(pm.response.code).to.be.oneOf([201, 404]) \r", + " pm.expect(pm.response.code).to.be.oneOf([201,404])\r", " });\r", "\r", "if (pm.response.code === 201) {\r", @@ -8144,7 +8144,7 @@ "script": { "exec": [ "pm.test(\"Response is 201 or 404\", () => {\r", - " pm.expect(pm.response.code).to.be.oneOf([201, 404]) \r", + " pm.expect(pm.response.code).to.be.oneOf([201,404])\r", " });\r", "\r", "if (pm.response.code === 201) {\r", @@ -11063,6 +11063,18 @@ "", "CreateAccessToken(\"TokenExpiry_NoEdorg\", \"AccessToken_NoEdorg\", \"ApiKey_NoEdorg\", \"ApiSecret_NoEdorg\")", "", + "// Set variables related to data standard specific contact/parent variablility ", + "let ParentOrContactProperName = pm.environment.get(\"ParentOrContactProperName\");", + "let StudentParentOrContactAssociationCollectionName = \"Student\" + ParentOrContactProperName + \"Associations\";", + "let ParentOrContactUniqueIdName = ParentOrContactProperName + \"UniqueId\";", + "let ParentOrContactName = ParentOrContactProperName.toLowerCase();", + "let ParentOrContactCollectionName = ParentOrContactName + \"s\";", + "", + "pm.environment.set(\"StudentParentOrContactAssociationCollectionName\", StudentParentOrContactAssociationCollectionName);", + "pm.environment.set(\"ParentOrContactUniqueIdName\", ParentOrContactUniqueIdName);", + "pm.environment.set(\"ParentOrContactName\", ParentOrContactName);", + "pm.environment.set(\"ParentOrContactCollectionName\", ParentOrContactCollectionName);", + "", "// Adapted from: https://marcin-chwedczuk.github.io/automatically-generate-new-oauth2-tokens-when-using-postman", "// Assumes Environment with Environment Variables: ApiBaseUrl, ApiKey, ApiSecret", "// See https://gist.github.com/blmeyers/21138bbe6f80b8c35701a8754bfe59d5 for an environment sample for Local (NOTE: environment variable names have been changed from the gist -- you must adjust accordingly)", diff --git a/Postman Test Suite/Ed-Fi ODS-API Integration Test Suite GetByExample Tests.postman_collection.json b/Postman Test Suite/Ed-Fi ODS-API Integration Test Suite GetByExample Tests.postman_collection.json index 4e3ca2a0e4..5c7e60ef87 100644 --- a/Postman Test Suite/Ed-Fi ODS-API Integration Test Suite GetByExample Tests.postman_collection.json +++ b/Postman Test Suite/Ed-Fi ODS-API Integration Test Suite GetByExample Tests.postman_collection.json @@ -54,7 +54,7 @@ ] }, { - "name": "StudentParentAssociation Tests", + "name": "StudentContactAssociation Tests", "item": [ { "name": "Initialize Student Data", @@ -185,14 +185,14 @@ "response": [] }, { - "name": "Initialize First Parent Data", + "name": "Initialize First Contact Data", "event": [ { "listen": "test", "script": { "exec": [ - "pm.test(\"Response is 201 or 404\", () => {", - " pm.expect(pm.response.code).to.be.oneOf([201, 404]) ", + "pm.test(\"Response is 201\", () => {", + " pm.expect(pm.response.code).to.equal(201) ", " });", "", " if (pm.response.code === 201 ) {", @@ -232,7 +232,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"parentUniqueId\": \"{{supplied:{{scenarioId}}:parentUniqueId}}\",\r\n \"firstName\": \"{{supplied:{{scenarioId}}:FirstName}}\",\r\n \"lastSurname\": \"{{supplied:{{scenarioId}}:LastSurname}}\",\r\n \"_ext\": {\r\n \"Sample\": {\r\n \"teacherConference\": {\r\n \"dayOfWeek\": \"Monday\",\r\n \"endTime\": \"12:00:00\",\r\n \"startTime\": \"12:00:00\"\r\n },\r\n \"authors\": [],\r\n \"favoriteBookTitles\": [\r\n {\r\n \"favoriteBookTitle\": \"Green Eggs and Ham\"\r\n }\r\n ],\r\n \"isSportsFan\": false\r\n }\r\n }\r\n}", + "raw": "{\r\n \"{{ParentOrContactUniqueIdName}}\": \"{{supplied:{{scenarioId}}:parentUniqueId}}\",\r\n \"firstName\": \"{{supplied:{{scenarioId}}:FirstName}}\",\r\n \"lastSurname\": \"{{supplied:{{scenarioId}}:LastSurname}}\",\r\n \"_ext\": {\r\n \"Sample\": {\r\n \"teacherConference\": {\r\n \"dayOfWeek\": \"Monday\",\r\n \"endTime\": \"12:00:00\",\r\n \"startTime\": \"12:00:00\"\r\n },\r\n \"authors\": [],\r\n \"favoriteBookTitles\": [\r\n {\r\n \"favoriteBookTitle\": \"Green Eggs and Ham\"\r\n }\r\n ],\r\n \"isSportsFan\": false\r\n }\r\n }\r\n}", "options": { "raw": { "language": "json" @@ -240,7 +240,7 @@ } }, "url": { - "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/parents", + "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/{{ParentOrContactCollectionName}}", "host": [ "{{ApiBaseUrl}}" ], @@ -248,21 +248,21 @@ "data", "v3", "ed-fi", - "parents" + "{{ParentOrContactCollectionName}}" ] } }, "response": [] }, { - "name": "Initialize Second Parent Data", + "name": "Initialize Second Contact Data", "event": [ { "listen": "test", "script": { "exec": [ - "pm.test(\"Response is 201 or 404\", () => {", - " pm.expect(pm.response.code).to.be.oneOf([201, 404]) ", + "pm.test(\"Response is 201\", () => {", + " pm.expect(pm.response.code).to.equal(201) ", " });", "", "if (pm.response.code === 201 ) {", @@ -303,7 +303,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"parentUniqueId\": \"{{supplied:{{scenarioId}}:parentUniqueId}}\",\r\n \"firstName\": \"{{supplied:{{scenarioId}}:FirstName}}\",\r\n \"lastSurname\": \"{{supplied:{{scenarioId}}:LastSurname}}\",\r\n \"_ext\": {\r\n \"Sample\": {\r\n \"teacherConference\": {\r\n \"dayOfWeek\": \"Monday\",\r\n \"endTime\": \"12:00:00\",\r\n \"startTime\": \"12:00:00\"\r\n },\r\n \"authors\": [],\r\n \"favoriteBookTitles\": [\r\n {\r\n \"favoriteBookTitle\": \"Green Eggs and Ham\"\r\n }\r\n ],\r\n \"isSportsFan\": false\r\n }\r\n }\r\n}", + "raw": "{\r\n \"{{ParentOrContactUniqueIdName}}\": \"{{supplied:{{scenarioId}}:parentUniqueId}}\",\r\n \"firstName\": \"{{supplied:{{scenarioId}}:FirstName}}\",\r\n \"lastSurname\": \"{{supplied:{{scenarioId}}:LastSurname}}\",\r\n \"_ext\": {\r\n \"Sample\": {\r\n \"teacherConference\": {\r\n \"dayOfWeek\": \"Monday\",\r\n \"endTime\": \"12:00:00\",\r\n \"startTime\": \"12:00:00\"\r\n },\r\n \"authors\": [],\r\n \"favoriteBookTitles\": [\r\n {\r\n \"favoriteBookTitle\": \"Green Eggs and Ham\"\r\n }\r\n ],\r\n \"isSportsFan\": false\r\n }\r\n }\r\n}", "options": { "raw": { "language": "json" @@ -311,7 +311,7 @@ } }, "url": { - "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/parents", + "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/{{ParentOrContactCollectionName}}", "host": [ "{{ApiBaseUrl}}" ], @@ -319,21 +319,21 @@ "data", "v3", "ed-fi", - "parents" + "{{ParentOrContactCollectionName}}" ] } }, "response": [] }, { - "name": "Initialize First StudentParentAssociation Data", + "name": "Initialize First StudentContactAssociation Data", "event": [ { "listen": "test", "script": { "exec": [ - "pm.test(\"Response is 201 or 404\", () => {", - " pm.expect(pm.response.code).to.be.oneOf([201, 404]) ", + "pm.test(\"Response is 201\", () => {", + " pm.expect(pm.response.code).to.equal(201) ", " });" ], "type": "text/javascript" @@ -352,7 +352,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"parentReference\": {\r\n \"parentUniqueId\": \"{{known:{{scenarioId}}:parent1UniqueId}}\"\r\n },\r\n \"studentReference\": {\r\n \"studentUniqueId\": \"{{known:{{scenarioId}}:studentUniqueId}}\"\r\n },\r\n \"_ext\": {\r\n \"Sample\": {\r\n \"bedtimeReader\": true,\r\n \"favoriteBookTitles\": [\r\n {\r\n \"favoriteBookTitle\": \"Green Eggs and Ham\"\r\n }\r\n ]\r\n }\r\n }\r\n}", + "raw": "{\r\n \"{{ParentOrContactName}}Reference\": {\r\n \"{{ParentOrContactUniqueIdName}}\": \"{{known:{{scenarioId}}:parent1UniqueId}}\"\r\n },\r\n \"studentReference\": {\r\n \"studentUniqueId\": \"{{known:{{scenarioId}}:studentUniqueId}}\"\r\n },\r\n \"_ext\": {\r\n \"Sample\": {\r\n \"bedtimeReader\": true,\r\n \"favoriteBookTitles\": [\r\n {\r\n \"favoriteBookTitle\": \"Green Eggs and Ham\"\r\n }\r\n ]\r\n }\r\n }\r\n}", "options": { "raw": { "language": "json" @@ -360,7 +360,7 @@ } }, "url": { - "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/StudentParentAssociations", + "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/{{StudentParentOrContactAssociationCollectionName}}", "host": [ "{{ApiBaseUrl}}" ], @@ -368,21 +368,21 @@ "data", "v3", "ed-fi", - "StudentParentAssociations" + "{{StudentParentOrContactAssociationCollectionName}}" ] } }, "response": [] }, { - "name": "Initialize Second StudentParentAssociation Data", + "name": "Initialize Second StudentContactAssociation Data", "event": [ { "listen": "test", "script": { "exec": [ - "pm.test(\"Response is 201 or 404\", () => {", - " pm.expect(pm.response.code).to.be.oneOf([201, 404]) ", + "pm.test(\"Response is 201\", () => {", + " pm.expect(pm.response.code).to.equal(201) ", " });" ], "type": "text/javascript" @@ -401,7 +401,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"parentReference\": {\r\n \"parentUniqueId\": \"{{known:{{scenarioId}}:parent2UniqueId}}\"\r\n },\r\n \"studentReference\": {\r\n \"studentUniqueId\": \"{{known:{{scenarioId}}:studentUniqueId}}\"\r\n },\r\n \"_ext\": {\r\n \"Sample\": {\r\n \"bedtimeReader\": true,\r\n \"favoriteBookTitles\": [\r\n {\r\n \"favoriteBookTitle\": \"Green Eggs and Ham\"\r\n }\r\n ]\r\n }\r\n }\r\n}", + "raw": "{\r\n \"{{ParentOrContactName}}Reference\": {\r\n \"{{ParentOrContactUniqueIdName}}\": \"{{known:{{scenarioId}}:parent2UniqueId}}\"\r\n },\r\n \"studentReference\": {\r\n \"studentUniqueId\": \"{{known:{{scenarioId}}:studentUniqueId}}\"\r\n },\r\n \"_ext\": {\r\n \"Sample\": {\r\n \"bedtimeReader\": true,\r\n \"favoriteBookTitles\": [\r\n {\r\n \"favoriteBookTitle\": \"Green Eggs and Ham\"\r\n }\r\n ]\r\n }\r\n }\r\n}", "options": { "raw": { "language": "json" @@ -409,7 +409,7 @@ } }, "url": { - "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/StudentParentAssociations", + "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/{{StudentParentOrContactAssociationCollectionName}}", "host": [ "{{ApiBaseUrl}}" ], @@ -417,21 +417,21 @@ "data", "v3", "ed-fi", - "StudentParentAssociations" + "{{StudentParentOrContactAssociationCollectionName}}" ] } }, "response": [] }, { - "name": "StudentParentAssociation by Invalid StudentUniqueId", + "name": "StudentContactAssociation by Invalid StudentUniqueId", "event": [ { "listen": "test", "script": { "exec": [ - "pm.test(\"Response is 200 or 404\", () => {", - " pm.expect(pm.response.code).to.be.oneOf([200, 404]) ", + "pm.test(\"Response is 200\", () => {", + " pm.expect(pm.response.code).to.equal(200) ", " });", "", "if (pm.response.code === 200 ) {", @@ -449,7 +449,7 @@ "method": "GET", "header": [], "url": { - "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/studentParentAssociations?studentUniqueId=InvalidStudentId", + "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/{{StudentParentOrContactAssociationCollectionName}}?studentUniqueId=InvalidStudentId", "host": [ "{{ApiBaseUrl}}" ], @@ -457,7 +457,7 @@ "data", "v3", "ed-fi", - "studentParentAssociations" + "{{StudentParentOrContactAssociationCollectionName}}" ], "query": [ { @@ -470,14 +470,14 @@ "response": [] }, { - "name": "StudentParentAssociation Has Additional Data", + "name": "StudentContactAssociation Has Additional Data", "event": [ { "listen": "test", "script": { "exec": [ - "pm.test(\"Response is 200 or 404\", () => {", - " pm.expect(pm.response.code).to.be.oneOf([200, 404]) ", + "pm.test(\"Response is 200\", () => {", + " pm.expect(pm.response.code).to.equal(200) ", " });", "", "if (pm.response.code === 201 ) {", @@ -495,7 +495,7 @@ "method": "GET", "header": [], "url": { - "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/studentParentAssociations", + "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/{{StudentParentOrContactAssociationCollectionName}}", "host": [ "{{ApiBaseUrl}}" ], @@ -503,21 +503,21 @@ "data", "v3", "ed-fi", - "studentParentAssociations" + "{{StudentParentOrContactAssociationCollectionName}}" ] } }, "response": [] }, { - "name": "StudentParentAssociation by Valid StudentUniqueId", + "name": "StudentContacctAssociation by Valid StudentUniqueId", "event": [ { "listen": "test", "script": { "exec": [ - "pm.test(\"Response is 200 or 404\", () => {", - " pm.expect(pm.response.code).to.be.oneOf([200, 404]) ", + "pm.test(\"Response is 200\", () => {", + " pm.expect(pm.response.code).to.equal(200) ", " });", "", "if (pm.response.code === 200 ) {", @@ -544,7 +544,7 @@ "method": "GET", "header": [], "url": { - "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/studentParentAssociations?studentUniqueId={{known:{{scenarioId}}:studentUniqueId}}", + "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/{{StudentParentOrContactAssociationCollectionName}}?studentUniqueId={{known:{{scenarioId}}:studentUniqueId}}", "host": [ "{{ApiBaseUrl}}" ], @@ -552,7 +552,7 @@ "data", "v3", "ed-fi", - "studentParentAssociations" + "{{StudentParentOrContactAssociationCollectionName}}" ], "query": [ { @@ -565,14 +565,14 @@ "response": [] }, { - "name": "StudentParentAssociation by Valid ParentUniqueId", + "name": "StudentContactAssociation by Valid ContactUniqueId", "event": [ { "listen": "test", "script": { "exec": [ - "pm.test(\"Response is 200 or 404\", () => {", - " pm.expect(pm.response.code).to.be.oneOf([200, 404]) ", + "pm.test(\"Response is 200\", () => {", + " pm.expect(pm.response.code).to.equal(200) ", " });", "", "if (pm.response.code === 200 ) {", @@ -581,12 +581,17 @@ " pm.expect(responseItems.length).to.equal(1);", " });", "", - " pm.test(\"Should return only items for the provided parent unique id\", () => {", + " pm.test(\"Should return only items for the provided contact unique id\", () => {", " const scenarioId = pm.environment.get('scenarioId');", " const parentUniqueId = pm.variables.get('known:'+scenarioId+':parent1UniqueId');", " const responseItems = pm.response.json();", " responseItems.forEach(item => {", - " pm.expect(item.parentReference.parentUniqueId).to.equal(parentUniqueId);", + " if(pm.environment.get('ParentOrContactName') == 'parent') {", + " pm.expect(item.parentReference.parentUniqueId).to.equal(parentUniqueId);", + " }", + " else if(pm.environment.get('ParentOrContactName') == 'contact') {", + " pm.expect(item.contactReference.contactUniqueId).to.equal(parentUniqueId);", + " }", " })", " });", "}" @@ -599,7 +604,7 @@ "method": "GET", "header": [], "url": { - "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/studentParentAssociations?parentUniqueId={{known:{{scenarioId}}:parent1UniqueId}}", + "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/{{StudentParentOrContactAssociationCollectionName}}?{{ParentOrContactUniqueIdName}}={{known:{{scenarioId}}:parent1UniqueId}}", "host": [ "{{ApiBaseUrl}}" ], @@ -607,11 +612,11 @@ "data", "v3", "ed-fi", - "studentParentAssociations" + "{{StudentParentOrContactAssociationCollectionName}}" ], "query": [ { - "key": "parentUniqueId", + "key": "{{ParentOrContactUniqueIdName}}", "value": "{{known:{{scenarioId}}:parent1UniqueId}}" } ] @@ -620,14 +625,14 @@ "response": [] }, { - "name": "StudentParentAssociation by Valid StudentUniqueId and ParentUniqueId", + "name": "StudentContactAssociation by Valid StudentUniqueId and ContactUniqueId", "event": [ { "listen": "test", "script": { "exec": [ - "pm.test(\"Response is 200 or 404\", () => {", - " pm.expect(pm.response.code).to.be.oneOf([200, 404]) ", + "pm.test(\"Response is 200\", () => {", + " pm.expect(pm.response.code).to.equal(200) ", " });", "", "if (pm.response.code === 200 ) {", @@ -636,14 +641,19 @@ " pm.expect(responseItems.length).to.equal(1);", " });", "", - " pm.test(\"Should return only items for the provided student and parent unique id\", () => {", + " pm.test(\"Should return only items for the provided student and contact unique id\", () => {", " const scenarioId = pm.environment.get('scenarioId');", " const studentUniqueId = pm.variables.get('known:'+scenarioId+':studentUniqueId');", " const parentUniqueId = pm.variables.get('known:'+scenarioId+':parent1UniqueId');", " const responseItems = pm.response.json();", " responseItems.forEach(item => {", " pm.expect(item.studentReference.studentUniqueId).to.equal(studentUniqueId);", - " pm.expect(item.parentReference.parentUniqueId).to.equal(parentUniqueId);", + " if(pm.environment.get('ParentOrContactName') == 'parent') {", + " pm.expect(item.parentReference.parentUniqueId).to.equal(parentUniqueId);", + " }", + " else if(pm.environment.get('ParentOrContactName') == 'contact') {", + " pm.expect(item.contactReference.contactUniqueId).to.equal(parentUniqueId);", + " }", " })", " });", "}" @@ -656,7 +666,7 @@ "method": "GET", "header": [], "url": { - "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/studentParentAssociations?studentUniqueId={{known:{{scenarioId}}:studentUniqueId}}&parentUniqueId={{known:{{scenarioId}}:parent1UniqueId}}", + "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/{{StudentParentOrContactAssociationCollectionName}}?studentUniqueId={{known:{{scenarioId}}:studentUniqueId}}&{{ParentOrContactUniqueIdName}}={{known:{{scenarioId}}:parent1UniqueId}}", "host": [ "{{ApiBaseUrl}}" ], @@ -664,7 +674,7 @@ "data", "v3", "ed-fi", - "studentParentAssociations" + "{{StudentParentOrContactAssociationCollectionName}}" ], "query": [ { @@ -672,7 +682,7 @@ "value": "{{known:{{scenarioId}}:studentUniqueId}}" }, { - "key": "parentUniqueId", + "key": "{{ParentOrContactUniqueIdName}}", "value": "{{known:{{scenarioId}}:parent1UniqueId}}" } ] @@ -733,6 +743,18 @@ "script": { "type": "text/javascript", "exec": [ + "// Set variables related to data standard specific contact/parent variablility ", + "let ParentOrContactProperName = pm.environment.get(\"ParentOrContactProperName\");", + "let StudentParentOrContactAssociationCollectionName = \"Student\" + ParentOrContactProperName + \"Associations\";", + "let ParentOrContactUniqueIdName = ParentOrContactProperName + \"UniqueId\";", + "let ParentOrContactName = ParentOrContactProperName.toLowerCase();", + "let ParentOrContactCollectionName = ParentOrContactName + \"s\";", + "", + "pm.environment.set(\"StudentParentOrContactAssociationCollectionName\", StudentParentOrContactAssociationCollectionName);", + "pm.environment.set(\"ParentOrContactUniqueIdName\", ParentOrContactUniqueIdName);", + "pm.environment.set(\"ParentOrContactName\", ParentOrContactName);", + "pm.environment.set(\"ParentOrContactCollectionName\", ParentOrContactCollectionName);", + "", "// Adapted from: https://marcin-chwedczuk.github.io/automatically-generate-new-oauth2-tokens-when-using-postman", "// Assumes Environment with Environment Variables: ApiBaseUrl, ApiKey, ApiSecret", "// See https://gist.github.com/blmeyers/21138bbe6f80b8c35701a8754bfe59d5 for an environment sample for Local (NOTE: environment variable names have been changed from the gist -- you must adjust accordingly)", diff --git a/Postman Test Suite/Ed-Fi ODS-API Integration Test Suite.postman_collection.json b/Postman Test Suite/Ed-Fi ODS-API Integration Test Suite.postman_collection.json index 44655f1789..322280869e 100644 --- a/Postman Test Suite/Ed-Fi ODS-API Integration Test Suite.postman_collection.json +++ b/Postman Test Suite/Ed-Fi ODS-API Integration Test Suite.postman_collection.json @@ -5014,14 +5014,14 @@ "response": [] }, { - "name": "Initialize Parent Data for Post Request", + "name": "Initialize Contact Data for Post Request", "event": [ { "listen": "test", "script": { "exec": [ - "pm.test(\"Response is 201 or 404\", () => {", - " pm.expect(pm.response.code).to.be.oneOf([201, 404]) ", + "pm.test(\"Response is 201\", () => {", + " pm.expect(pm.response.code).to.equal(201) ", " });", "", "if (pm.response.code === 201 ) {", @@ -5066,7 +5066,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"parentUniqueId\": \"{{supplied:{{scenarioId}}:parentUniqueId}}\",\r\n \"firstName\": \"{{supplied:{{scenarioId}}:firstName}}\",\r\n \"lastSurname\": \"{{supplied:{{scenarioId}}:lastSurname}}\",\r\n \"sexDescriptor\": \"{{supplied:{{scenarioId}}:sexDescriptor}}\",\r\n \"personReference\": {\r\n \"personId\": \"{{supplied:{{scenarioId}}:personId}}\",\r\n \"sourceSystemDescriptor\": \"{{supplied:{{scenarioId}}:sourceSystemDescriptor}}\"\r\n },\r\n \"_ext\": {\r\n \"Sample\": {\r\n \"teacherConference\": {\r\n \"dayOfWeek\": \"Monday\",\r\n \"endTime\": \"12:00:00\",\r\n \"startTime\": \"12:00:00\"\r\n },\r\n \"authors\": [],\r\n \"favoriteBookTitles\": [\r\n {\r\n \"favoriteBookTitle\": \"Green Eggs and Ham\"\r\n }\r\n ],\r\n \"isSportsFan\": false\r\n }\r\n }\r\n}", + "raw": "{\r\n \"{{ParentOrContactUniqueIdName}}\": \"{{supplied:{{scenarioId}}:parentUniqueId}}\",\r\n \"firstName\": \"{{supplied:{{scenarioId}}:firstName}}\",\r\n \"lastSurname\": \"{{supplied:{{scenarioId}}:lastSurname}}\",\r\n \"sexDescriptor\": \"{{supplied:{{scenarioId}}:sexDescriptor}}\",\r\n \"personReference\": {\r\n \"personId\": \"{{supplied:{{scenarioId}}:personId}}\",\r\n \"sourceSystemDescriptor\": \"{{supplied:{{scenarioId}}:sourceSystemDescriptor}}\"\r\n },\r\n \"_ext\": {\r\n \"Sample\": {\r\n \"teacherConference\": {\r\n \"dayOfWeek\": \"Monday\",\r\n \"endTime\": \"12:00:00\",\r\n \"startTime\": \"12:00:00\"\r\n },\r\n \"authors\": [],\r\n \"favoriteBookTitles\": [\r\n {\r\n \"favoriteBookTitle\": \"Green Eggs and Ham\"\r\n }\r\n ],\r\n \"isSportsFan\": false\r\n }\r\n }\r\n}", "options": { "raw": { "language": "json" @@ -5074,7 +5074,7 @@ } }, "url": { - "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/parents", + "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/{{ParentOrContactCollectionName}}", "host": [ "{{ApiBaseUrl}}" ], @@ -5082,21 +5082,21 @@ "data", "v3", "ed-fi", - "parents" + "{{ParentOrContactCollectionName}}" ] } }, "response": [] }, { - "name": "Initialize StudentParentAssociations Data for Post Request", + "name": "Initialize StudentContactAssociations Data for Post Request", "event": [ { "listen": "test", "script": { "exec": [ - "pm.test(\"Response is 201 or 404\", () => {", - " pm.expect(pm.response.code).to.be.oneOf([201, 404]) ", + "pm.test(\"Response is 201\", () => {", + " pm.expect(pm.response.code).to.equal(201) ", " });", "" ], @@ -5125,7 +5125,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"parentReference\": {\r\n \"parentUniqueId\": \"{{known:{{scenarioId}}:parentUniqueId}}\"\r\n },\r\n \"studentReference\": {\r\n \"studentUniqueId\": \"{{known:{{scenarioId}}:studentUniqueId}}\"\r\n },\r\n \"_ext\": {\r\n \"Sample\": {\r\n \"bedtimeReader\": true,\r\n \"favoriteBookTitles\": [\r\n {\r\n \"favoriteBookTitle\": \"Green Eggs and Ham\"\r\n }\r\n ]\r\n }\r\n }\r\n}", + "raw": "{\r\n \"{{ParentOrContactName}}Reference\": {\r\n \"{{ParentOrContactUniqueIdName}}\": \"{{known:{{scenarioId}}:parentUniqueId}}\"\r\n },\r\n \"studentReference\": {\r\n \"studentUniqueId\": \"{{known:{{scenarioId}}:studentUniqueId}}\"\r\n },\r\n \"_ext\": {\r\n \"Sample\": {\r\n \"bedtimeReader\": true,\r\n \"favoriteBookTitles\": [\r\n {\r\n \"favoriteBookTitle\": \"Green Eggs and Ham\"\r\n }\r\n ]\r\n }\r\n }\r\n}", "options": { "raw": { "language": "json" @@ -5133,7 +5133,7 @@ } }, "url": { - "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/StudentParentAssociations", + "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/{{StudentParentOrContactAssociationCollectionName}}", "host": [ "{{ApiBaseUrl}}" ], @@ -5141,21 +5141,21 @@ "data", "v3", "ed-fi", - "StudentParentAssociations" + "{{StudentParentOrContactAssociationCollectionName}}" ] } }, "response": [] }, { - "name": "Get Parent By PersonID", + "name": "Get Contact By PersonID", "event": [ { "listen": "test", "script": { "exec": [ - "pm.test(\"Response is 200 or 404\", () => {", - " pm.expect(pm.response.code).to.be.oneOf([200, 404]) ", + "pm.test(\"Response is 200\", () => {", + " pm.expect(pm.response.code).to.equal(200) ", " }); ", "", "if (pm.response.code === 200 ) {", @@ -5199,7 +5199,7 @@ } ], "url": { - "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/parents?parentUniqueId={{supplied:{{scenarioId}}:parentUniqueId}}&personId={{supplied:{{scenarioId}}:personId}}", + "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/{{ParentOrContactCollectionName}}?{{ParentOrContactUniqueIdName}}={{supplied:{{scenarioId}}:parentUniqueId}}&personId={{supplied:{{scenarioId}}:personId}}", "host": [ "{{ApiBaseUrl}}" ], @@ -5207,11 +5207,11 @@ "data", "v3", "ed-fi", - "parents" + "{{ParentOrContactCollectionName}}" ], "query": [ { - "key": "parentUniqueId", + "key": "{{ParentOrContactUniqueIdName}}", "value": "{{supplied:{{scenarioId}}:parentUniqueId}}" }, { @@ -5224,7 +5224,7 @@ "response": [] } ], - "description": "Scenario 4 - Create Person With \"District\" sourceSystemDescriptor and Associate with Parent\r\n\r\nStep 1 Create \"District\" sourceSystemDescriptor\r\nStep 2 Create Person With \"District\" sourceSystemDescriptor\r\nStep 3 Create Student With Associated Person\r\nStep 4 Create parent With Associated same Person\r\nStep 4 Get Parent by PersonId", + "description": "Scenario 4 - Create Person With \"District\" sourceSystemDescriptor and Associate with Contact\r\n\r\nStep 1 Create \"District\" sourceSystemDescriptor\r\nStep 2 Create Person With \"District\" sourceSystemDescriptor\r\nStep 3 Create Student With Associated Person\r\nStep 4 Create contact With Associated same Person\r\nStep 4 Get Contact by PersonId", "event": [ { "listen": "prerequest", @@ -7939,7 +7939,7 @@ "name": "Setup", "item": [ { - "name": "Initialize Supplied Parent/Contact UniqueId", + "name": "Initialize Supplied Contact UniqueId", "event": [ { "listen": "prerequest", @@ -7954,19 +7954,7 @@ "listen": "test", "script": { "exec": [ - "if (pm.response.code == 200) {\r", - " pm.environment.set('parentOrContactName', 'parent');\r", - " pm.environment.set('parentOrContactProperName', 'Parent');\r", - " pm.environment.set('parentOrContactCollectionName', 'parents');\r", - " pm.environment.set('parentOrContactUniqueIdName', 'parentUniqueId');\r", - "} else if (pm.response.code == 404) {\r", - " pm.environment.set('parentOrContactName', 'contact');\r", - " pm.environment.set('parentOrContactProperName', 'Contact');\r", - " pm.environment.set('parentOrContactCollectionName', 'contacts');\r", - " pm.environment.set('parentOrContactUniqueIdName', 'contactUniqueId');\r", - "} else {\r", - " pm.expect.fail(\"Unable to determine whether Parent or Contact is in use.\");\r", - "}" + "" ], "type": "text/javascript" } @@ -7976,7 +7964,7 @@ "method": "GET", "header": [], "url": { - "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/parents?limit=1", + "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/{{ParentOrContactCollectionName}}?limit=1", "host": [ "{{ApiBaseUrl}}" ], @@ -7984,7 +7972,7 @@ "data", "v3", "ed-fi", - "parents" + "{{ParentOrContactCollectionName}}" ], "query": [ { @@ -8002,7 +7990,7 @@ "name": "Invalid (Collections Empty)", "item": [ { - "name": "Create Parent/Contact", + "name": "Create Contact", "event": [ { "listen": "test", @@ -8018,17 +8006,17 @@ "\r", "/*\r", " string FavoriteBookTitle\r", - " documentation \"The title of the parent's favorite book.\"\r", + " documentation \"The title of the contact's favorite book.\"\r", " is required collection\r", " max length 100\r", "*/\r", "pm.test(\"Should indicate that the required collection has no items.\", () => {\r", - " pm.expect(message).to.contain(`${parentOrContactProperName}FavoriteBookTitles (Sample) requires at least one object in the collection.`);\r", + " pm.expect(message).to.contain(`FavoriteBookTitles (Sample) requires at least one object in the collection.`);\r", "});\r", "\r", "/*\r", " shared string EdFi.Author\r", - " documentation \"The parent's favorite authors.\"\r", + " documentation \"The contact's favorite authors.\"\r", " is optional collection\r", "*/\r", "pm.test(\"Should NOT indicate any issues with the optional collection that is empty.\", () => {\r", @@ -8054,7 +8042,7 @@ "header": [], "body": { "mode": "raw", - "raw": "{\r\n \"{{parentOrContactUniqueIdName}}\": \"{{supplied:parentOrContact:uniqueId}}\",\r\n \"firstName\": \"John\",\r\n \"lastSurname\": \"Doe\",\r\n \"_ext\": {\r\n \"Sample\": {\r\n \"teacherConference\": {\r\n \"dayOfWeek\": \"Monday\",\r\n \"endTime\": \"12:00:00\",\r\n \"startTime\": \"12:00:00\"\r\n },\r\n \"authors\": [],\r\n \"favoriteBookTitles\": [],\r\n \"isSportsFan\": false\r\n }\r\n }\r\n}", + "raw": "{\r\n \"{{ParentOrContactUniqueIdName}}\": \"{{supplied:parentOrContact:uniqueId}}\",\r\n \"firstName\": \"John\",\r\n \"lastSurname\": \"Doe\",\r\n \"_ext\": {\r\n \"Sample\": {\r\n \"teacherConference\": {\r\n \"dayOfWeek\": \"Monday\",\r\n \"endTime\": \"12:00:00\",\r\n \"startTime\": \"12:00:00\"\r\n },\r\n \"authors\": [],\r\n \"favoriteBookTitles\": [],\r\n \"isSportsFan\": false\r\n }\r\n }\r\n}", "options": { "raw": { "language": "json" @@ -8062,7 +8050,7 @@ } }, "url": { - "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/{{parentOrContactCollectionName}}", + "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/{{ParentOrContactCollectionName}}", "host": [ "{{ApiBaseUrl}}" ], @@ -8070,7 +8058,7 @@ "data", "v3", "ed-fi", - "{{parentOrContactCollectionName}}" + "{{ParentOrContactCollectionName}}" ] } }, @@ -8082,7 +8070,7 @@ "name": "Invalid (Embedded Objects Not Supplied)", "item": [ { - "name": "Create Parent/Contact", + "name": "Create Contact", "event": [ { "listen": "test", @@ -8092,14 +8080,14 @@ " pm.expect(pm.response.code).to.equal(400);\r", "});\r", "\r", - "const parentOrContactProperName = pm.environment.get('parentOrContactProperName');\r", + "const parentOrContactProperName = pm.environment.get('ParentOrContactProperName');\r", "\r", "if (pm.response.code === 400) {\r", " const message = pm.response.json().message;\r", "\r", " /*\r", " common TeacherConference\r", - " documentation \"The parent's preferred day of the week and time for parent-teacher conferences.\"\r", + " documentation \"The contact's preferred day of the week and time for contact-teacher conferences.\"\r", " is required\r", " */\r", " pm.test(\"Should indicate that the required embedded object is missing.\", () => {\r", @@ -8108,7 +8096,7 @@ "\r", " /*\r", " common EdFi.CTEProgram\r", - " documentation \"A CTE program the parent has completed.\"\r", + " documentation \"A CTE program the contact has completed.\"\r", " is optional\r", " */\r", " pm.test(\"Should NOT indicate any issues with the optional embedded object that is missing.\", () => {\r", @@ -8125,7 +8113,7 @@ "header": [], "body": { "mode": "raw", - "raw": "{\r\n \"{{parentOrContactUniqueIdName}}\": \"{{supplied:parentOrContact:uniqueId}}\",\r\n \"firstName\": \"John\",\r\n \"lastSurname\": \"Doe\",\r\n \"_ext\": {\r\n \"Sample\": {\r\n \"authors\": [],\r\n \"favoriteBookTitles\": [\r\n {\r\n \"favoriteBookTitle\": \"Green Eggs and Ham\"\r\n }\r\n ],\r\n \"isSportsFan\": false\r\n }\r\n }\r\n}", + "raw": "{\r\n \"{{ParentOrContactUniqueIdName}}\": \"{{supplied:parentOrContact:uniqueId}}\",\r\n \"firstName\": \"John\",\r\n \"lastSurname\": \"Doe\",\r\n \"_ext\": {\r\n \"Sample\": {\r\n \"authors\": [],\r\n \"favoriteBookTitles\": [\r\n {\r\n \"favoriteBookTitle\": \"Green Eggs and Ham\"\r\n }\r\n ],\r\n \"isSportsFan\": false\r\n }\r\n }\r\n}", "options": { "raw": { "language": "json" @@ -8133,7 +8121,7 @@ } }, "url": { - "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/{{parentOrContactCollectionName}}", + "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/{{ParentOrContactCollectionName}}", "host": [ "{{ApiBaseUrl}}" ], @@ -8141,7 +8129,7 @@ "data", "v3", "ed-fi", - "{{parentOrContactCollectionName}}" + "{{ParentOrContactCollectionName}}" ] } }, @@ -8153,7 +8141,7 @@ "name": "Valid (Required Items Supplied)", "item": [ { - "name": "Create Parent/Contact", + "name": "Create Contact", "event": [ { "listen": "test", @@ -8175,7 +8163,7 @@ "header": [], "body": { "mode": "raw", - "raw": "{\r\n \"{{parentOrContactUniqueIdName}}\": \"{{supplied:parentOrContact:uniqueId}}\",\r\n \"firstName\": \"John\",\r\n \"lastSurname\": \"Doe\",\r\n \"_ext\": {\r\n \"Sample\": {\r\n \"teacherConference\": {\r\n \"dayOfWeek\": \"Monday\",\r\n \"endTime\": \"12:00:00\",\r\n \"startTime\": \"12:00:00\"\r\n },\r\n \"authors\": [],\r\n \"favoriteBookTitles\": [\r\n {\r\n \"favoriteBookTitle\": \"Green Eggs and Ham\"\r\n }\r\n ],\r\n \"isSportsFan\": false\r\n }\r\n }\r\n}", + "raw": "{\r\n \"{{ParentOrContactUniqueIdName}}\": \"{{supplied:parentOrContact:uniqueId}}\",\r\n \"firstName\": \"John\",\r\n \"lastSurname\": \"Doe\",\r\n \"_ext\": {\r\n \"Sample\": {\r\n \"teacherConference\": {\r\n \"dayOfWeek\": \"Monday\",\r\n \"endTime\": \"12:00:00\",\r\n \"startTime\": \"12:00:00\"\r\n },\r\n \"authors\": [],\r\n \"favoriteBookTitles\": [\r\n {\r\n \"favoriteBookTitle\": \"Green Eggs and Ham\"\r\n }\r\n ],\r\n \"isSportsFan\": false\r\n }\r\n }\r\n}", "options": { "raw": { "language": "json" @@ -8183,7 +8171,7 @@ } }, "url": { - "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/{{parentOrContactCollectionName}}", + "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/{{ParentOrContactCollectionName}}", "host": [ "{{ApiBaseUrl}}" ], @@ -8191,7 +8179,7 @@ "data", "v3", "ed-fi", - "{{parentOrContactCollectionName}}" + "{{ParentOrContactCollectionName}}" ] } }, @@ -8203,7 +8191,7 @@ "name": "Teardown", "item": [ { - "name": "Delete the Parent/Contact", + "name": "Delete the Contact", "event": [ { "listen": "test", @@ -8236,7 +8224,7 @@ } ], "url": { - "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/{{parentOrContactCollectionName}}/{{known:parentOrContact:id}}", + "raw": "{{ApiBaseUrl}}/data/v3/ed-fi/{{ParentOrContactCollectionName}}/{{known:parentOrContact:id}}", "host": [ "{{ApiBaseUrl}}" ], @@ -8244,7 +8232,7 @@ "data", "v3", "ed-fi", - "{{parentOrContactCollectionName}}", + "{{ParentOrContactCollectionName}}", "{{known:parentOrContact:id}}" ] }, @@ -8781,6 +8769,18 @@ "script": { "type": "text/javascript", "exec": [ + "// Set variables related to data standard specific contact/parent variablility ", + "let ParentOrContactProperName = pm.environment.get(\"ParentOrContactProperName\");", + "let StudentParentOrContactAssociationCollectionName = \"Student\" + ParentOrContactProperName + \"Associations\";", + "let ParentOrContactUniqueIdName = ParentOrContactProperName + \"UniqueId\";", + "let ParentOrContactName = ParentOrContactProperName.toLowerCase();", + "let ParentOrContactCollectionName = ParentOrContactName + \"s\";", + "", + "pm.environment.set(\"StudentParentOrContactAssociationCollectionName\", StudentParentOrContactAssociationCollectionName);", + "pm.environment.set(\"ParentOrContactUniqueIdName\", ParentOrContactUniqueIdName);", + "pm.environment.set(\"ParentOrContactName\", ParentOrContactName);", + "pm.environment.set(\"ParentOrContactCollectionName\", ParentOrContactCollectionName);", + "", "// Adapted from: https://marcin-chwedczuk.github.io/automatically-generate-new-oauth2-tokens-when-using-postman", "// Assumes Environment with Environment Variables: ApiBaseUrl, ApiKey, ApiSecret", "// See https://gist.github.com/blmeyers/21138bbe6f80b8c35701a8754bfe59d5 for an environment sample for Local (NOTE: environment variable names have been changed from the gist -- you must adjust accordingly)",