Skip to content
This repository has been archived by the owner on Feb 7, 2025. It is now read-only.

Commit

Permalink
Merge pull request #867 from CDCgov/story-616_e2e
Browse files Browse the repository at this point in the history
Results E2E Tests
  • Loading branch information
saquino0827 authored Feb 12, 2024
2 parents cdc1b14 + e8826fd commit 0d3bff9
Showing 1 changed file with 28 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,31 +29,34 @@ class ResultTest extends Specification {
parsedJsonBody.fhirResourceId == expectedFhirResourceId
}

// Will progress on these tests when sending data to RS
// def "check that the rest of the message is unchanged except the parts we changed"() {
// when:
// resultClient.submit(labResultJsonFileString, submissionId, true)
// def sentPayload = SentPayloadReader.read()
// def parsedSentPayload = JsonParsing.parse(sentPayload)
// def parsedLabResultJsonFile = JsonParsing.parse(labResultJsonFileString)
//
// then:
//
// parsedSentPayload == parsedLabResultJsonFile
// }
//
// def "check that message type is converted to ORU_R01"() {
// when:
// resultClient.submit(labResultJsonFileString, submissionId, true)
// def sentPayload = SentPayloadReader.read()
// def parsedSentPayload = JsonParsing.parse(sentPayload)
//
// then:
// //test that the MessageHeader's event is now an OML_O21
// parsedSentPayload.entry[0].resource.resourceType == "MessageHeader"
// parsedSentPayload.entry[0].resource.eventCoding.code == "R01"
// parsedSentPayload.entry[0].resource.eventCoding.display.contains("ORU")
// }
def "check that the rest of the message is unchanged except the parts we changed"() {
when:
resultClient.submit(labResultJsonFileString, submissionId, true)
def sentPayload = SentPayloadReader.read()
def parsedSentPayload = JsonParsing.parse(sentPayload)
def parsedLabResultJsonFile = JsonParsing.parse(labResultJsonFileString)

then:
parsedSentPayload.entry[0].resource.meta.tag.remove(1) // Remove ETOR meta tagging from tests
parsedSentPayload == parsedLabResultJsonFile
}

def "check that message type is converted to ORU_R01"() {
when:
resultClient.submit(labResultJsonFileString, submissionId, true)
def sentPayload = SentPayloadReader.read()
def parsedSentPayload = JsonParsing.parse(sentPayload)

then:
//test that the MessageHeader's event is now an ORU_R01
parsedSentPayload.entry[0].resource.resourceType == "MessageHeader"
parsedSentPayload.entry[0].resource.eventCoding.code == "R01"
parsedSentPayload.entry[0].resource.eventCoding.display.contains("ORU")
def etorHeader = parsedSentPayload.entry[0].resource.meta.tag.get(1)
etorHeader.system == "http://localcodes.org/ETOR"
etorHeader.code == "ETOR"
etorHeader.display == "Processed by ETOR"
}

def "return a 400 response when request has unexpected format"() {
given:
Expand Down

0 comments on commit 0d3bff9

Please sign in to comment.