Skip to content

Commit

Permalink
test: add latest application services to tests
Browse files Browse the repository at this point in the history
  • Loading branch information
andrea-acampora committed May 8, 2023
1 parent 37d0650 commit 5b8deda
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/test/kotlin/application/handlers/TestEventHandlers.kt
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ class TestEventHandlers : StringSpec({
val eventHandler = ProcessEventHandlers.PatientTrackedEventHandler(
surgicalProcessController(),
surgeryBookingController(),
patientController(),
MockEventProducer()
)
eventHandler.canHandle(event) shouldBe true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ class MockDigitalTwinManager :

override fun createPatientDT(patientId: PatientData.PatientId): Patient? = null

override fun deletePatientDT(patientId: PatientData.PatientId): Boolean = true

override fun createSurgicalProcess(process: SurgicalProcess): Boolean = surgicalProcesses.add(process)

override fun updateSurgicalProcessState(
Expand All @@ -46,7 +48,13 @@ class MockDigitalTwinManager :
override fun updateSurgicalProcessStep(processId: ProcessData.ProcessId, step: ProcessData.ProcessStep): Boolean =
surgicalProcesses.any { it.id == processId }

override fun updateSurgicalProcessRoom(processId: ProcessData.ProcessId, room: Room): Boolean = true
override fun updateSurgicalProcessRoom(
processId: ProcessData.ProcessId,
latestRoomId: String?,
room: Room
): Boolean = true

override fun deleteSurgicalProcess(processId: ProcessData.ProcessId): Boolean = true

override fun getSurgeryBookingByPatient(patientId: PatientData.PatientId): SurgeryBooking? =
surgeryBookings.find { it.patientId == patientId }
Expand All @@ -55,4 +63,6 @@ class MockDigitalTwinManager :
patientId: PatientData.PatientId,
surgeryBookingId: SurgeryBookingData.SurgeryBookingId
): Boolean = true

override fun deleteSurgeryBooking(bookingId: SurgeryBookingData.SurgeryBookingId): Boolean = true
}

0 comments on commit 5b8deda

Please sign in to comment.