Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Save unpacked response #3455

Merged
merged 3 commits into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
spotless
  • Loading branch information
FikriMilano committed Aug 19, 2024
commit 080c2f1cdff7889cf339f0392a70a0c780ab8dc3
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ private val printer: IParser = FhirContext.forR4().newJsonParser()
fun <T : IBaseResource> assertResourceEquals(expected: T, actual: T) {
Assert.assertEquals(
printer.encodeResourceToString(expected),
printer.encodeResourceToString(actual)
printer.encodeResourceToString(actual),
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -902,9 +902,10 @@ class QuestionnaireViewModelTest : RobolectricTest() {
}

@Test
fun testValidateQuestionnaireResponseWithNestedRepeatedGroupShouldNotUpdateTheOriginalQuestionnaireResponse() = runTest {
val questionnaireString =
"""
fun testValidateQuestionnaireResponseWithNestedRepeatedGroupShouldNotUpdateTheOriginalQuestionnaireResponse() =
runTest {
val questionnaireString =
"""
{
"resourceType": "Questionnaire",
"item": [
Expand Down Expand Up @@ -950,9 +951,9 @@ class QuestionnaireViewModelTest : RobolectricTest() {
]
}
"""
.trimIndent()
val questionnaireResponseString =
"""
.trimIndent()
val questionnaireResponseString =
"""
{
"resourceType": "QuestionnaireResponse",
"item": [
Expand Down Expand Up @@ -1011,21 +1012,21 @@ class QuestionnaireViewModelTest : RobolectricTest() {
]
}
"""
.trimIndent()
val questionnaire = parser.parseResource(questionnaireString) as Questionnaire
val actualQuestionnaireResponse =
parser.parseResource(questionnaireResponseString) as QuestionnaireResponse
val result =
questionnaireViewModel.validateQuestionnaireResponse(
questionnaire,
actualQuestionnaireResponse,
context,
)
val expectedQuestionnaireResponse =
parser.parseResource(questionnaireResponseString) as QuestionnaireResponse
Assert.assertTrue(result)
assertResourceEquals(expectedQuestionnaireResponse, actualQuestionnaireResponse)
}
.trimIndent()
val questionnaire = parser.parseResource(questionnaireString) as Questionnaire
val actualQuestionnaireResponse =
parser.parseResource(questionnaireResponseString) as QuestionnaireResponse
val result =
questionnaireViewModel.validateQuestionnaireResponse(
questionnaire,
actualQuestionnaireResponse,
context,
)
val expectedQuestionnaireResponse =
parser.parseResource(questionnaireResponseString) as QuestionnaireResponse
Assert.assertTrue(result)
assertResourceEquals(expectedQuestionnaireResponse, actualQuestionnaireResponse)
}

@Test
fun testExecuteCqlShouldInvokeRunCqlLibrary() = runTest {
Expand Down
Loading