From c08d0213ee3cf5357120f3aabc5d01d8e774a917 Mon Sep 17 00:00:00 2001 From: Abigail Nicolas Sayago Date: Fri, 20 Oct 2023 10:18:28 -0700 Subject: [PATCH] Fx tests for Update --- .../SearchParameterDuplicatedUpdate.json | 10 +++++----- .../Rest/UpdateTests.cs | 16 ++++++++-------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/Microsoft.Health.Fhir.Tests.Common/TestFiles/Normative/SearchParameterDuplicatedUpdate.json b/src/Microsoft.Health.Fhir.Tests.Common/TestFiles/Normative/SearchParameterDuplicatedUpdate.json index 816bfccb96..3eb06e171c 100644 --- a/src/Microsoft.Health.Fhir.Tests.Common/TestFiles/Normative/SearchParameterDuplicatedUpdate.json +++ b/src/Microsoft.Health.Fhir.Tests.Common/TestFiles/Normative/SearchParameterDuplicatedUpdate.json @@ -1,13 +1,13 @@ { "resourceType": "SearchParameter", "version": "4.0.1", - "name": "description", + "name": "reason", "status": "draft", - "description": "The description of the research definition", - "code": "description", + "description": "The reason for the study", + "code": "reason", "base": [ - "ResearchDefinition" + "ImagingStudy" ], "type": "string", - "expression": "ResearchDefinition.description" + "expression": "ImagingStudy.reason" } diff --git a/test/Microsoft.Health.Fhir.Shared.Tests.E2E/Rest/UpdateTests.cs b/test/Microsoft.Health.Fhir.Shared.Tests.E2E/Rest/UpdateTests.cs index 526e9d572a..4e05aad265 100644 --- a/test/Microsoft.Health.Fhir.Shared.Tests.E2E/Rest/UpdateTests.cs +++ b/test/Microsoft.Health.Fhir.Shared.Tests.E2E/Rest/UpdateTests.cs @@ -267,12 +267,12 @@ public async Task GivenTheResource_WhenUpdatingANewDuplicatedSearchParameterReso { /* When the server starts, search-parameters.json files are loaded and the default search parameters * are created. The search parameter with the code 'description' and base 'ResearchDefinition' already exists with - * the url http://hl7.org/fhir/SearchParameter/ResearchDefinition-description */ + * the url http://hl7.org/fhir/SearchParameter/ImagingStudy-reason */ var id = Guid.NewGuid(); var resourceToCreate = Samples.GetJsonSample("SearchParameterDuplicatedUpdate"); resourceToCreate.Id = id.ToString(); - resourceToCreate.Url = "http://hl7.org/fhir/SearchParameter/ResearchDefinition-description"; + resourceToCreate.Url = "http://hl7.org/fhir/SearchParameter/ImagingStudy-reason"; using FhirClientException ex = await Assert.ThrowsAsync(() => _client.UpdateAsync( $"SearchParameter/{id}", @@ -284,7 +284,7 @@ public async Task GivenTheResource_WhenUpdatingANewDuplicatedSearchParameterReso Assert.NotEmpty(operationOutcome.Issue); Assert.Single(operationOutcome.Issue); - var expectedError = "A search parameter with the same code value 'description' already exists for base type 'ResearchDefinition'."; + var expectedError = "A search parameter with the same code value 'reason' already exists for base type 'ImagingStudy'."; Assert.Contains(expectedError, operationOutcome.Issue[0].Diagnostics); } @@ -294,12 +294,12 @@ public async Task GivenTheResource_WhenUpdatingANewDuplicatedSearchParameterReso { /* When the server starts, search-parameters.json files are loaded and the default search parameters * are created. The search parameter with the code 'description' and base 'ResearchDefinition' already exists with - * the url http://hl7.org/fhir/SearchParameter/ResearchDefinition-description */ + * the url http://hl7.org/fhir/SearchParameter/ImagingStudy-reason */ var id = Guid.NewGuid(); var resourceToCreate = Samples.GetJsonSample("SearchParameterDuplicatedUpdate"); resourceToCreate.Id = id.ToString(); - resourceToCreate.Url = "http://hl7.org/fhir/SearchParameter/description-ResearchDefinition-test-update-url"; + resourceToCreate.Url = "http://hl7.org/fhir/SearchParameter/reason-ImagingStudy-test-update-url"; using FhirClientException ex = await Assert.ThrowsAsync(() => _client.UpdateAsync( $"SearchParameter/{id}", @@ -311,13 +311,13 @@ public async Task GivenTheResource_WhenUpdatingANewDuplicatedSearchParameterReso Assert.NotEmpty(operationOutcome.Issue); Assert.Equal(2, operationOutcome.Issue.Count); - var firstIssue = "A search parameter with Uri 'http://hl7.org/fhir/SearchParameter/description-ResearchDefinition-test-update-url' was not found."; - var secondIssue = "A search parameter with the same code value 'description' already exists for base type 'ResearchDefinition'."; + var firstIssue = "A search parameter with Uri 'http://hl7.org/fhir/SearchParameter/reason-ImagingStudy-test-update-url' was not found."; + var secondIssue = "A search parameter with the same code value 'reason' already exists for base type 'ImagingStudy'."; Assert.Contains(firstIssue, operationOutcome.Issue[0].Diagnostics); Assert.Contains(secondIssue, operationOutcome.Issue[1].Diagnostics); - /* If a search parameter with the url http://hl7.org/fhir/SearchParameter/description-ResearchDefinition-test-update-url already exists + /* If a search parameter with the url http://hl7.org/fhir/SearchParameter/reason-ImagingStudy-test-update-url already exists * this test will fail because the first Issue will not be shown in the OperationOutcome. */ }