Skip to content

Commit

Permalink
Update migration9to10 test
Browse files Browse the repository at this point in the history
  • Loading branch information
LZRS committed Nov 28, 2024
1 parent 61d617d commit e464ce9
Showing 1 changed file with 27 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,33 @@ class ResourceDatabaseMigrationTest {
assertThat(retrievedTask).isEqualTo(bedNetTask)
}

@Test fun migrate9To10_should_execute_with_no_exception(): Unit = runBlocking { TODO() }
@Test fun migrate9To10_should_execute_with_no_exception(): Unit = runBlocking {
val patientId = "patient-001"
val patientResourceUuid = "e2c79e28-ed4d-4029-a12c-108d1eb5bedb"
val patient: String = Patient().apply {
id = patientId
}.let { iParser.encodeResourceToString(it) }

val taskId = "bed-net-001"
val taskResourceUuid = "8593abf6-b8dd-44d7-a35f-1c8843bc2c45"
val bedNetTask =
Task()
.apply {
id = taskId
status = Task.TaskStatus.READY
`for` = Reference(patient)
}
.let { iParser.encodeResourceToString(it) }

helper.createDatabase(DB_NAME, 9).apply {
execSQL("INSERT INTO ResourceEntity (resourceUuid, resourceType, resourceId, serializedResource) VALUES ('$patientResourceUuid', 'Patient', '$patientId', '$patient');")
execSQL("INSERT INTO ResourceEntity (resourceUuid, resourceType, resourceId, serializedResource) VALUES ('$taskResourceUuid', 'Task', '$taskId', '$bedNetTask');")

execSQL("INSERT INTO ReferenceIndexEntity (resourceUuid, resourceType, index_name, index_path, index_value) VALUES ('$taskResourceUuid', 'Task', 'subject', 'Task.for', 'Patient/$patientId');")
}

TODO("Finish test")
}

companion object {
const val DB_NAME = "migration_tests.db"
Expand Down

0 comments on commit e464ce9

Please sign in to comment.