mirror of
https://github.com/pcvolkmer/etl-processor.git
synced 2025-04-20 17:56:50 +00:00
refactor: use dedicated type for path param
This commit is contained in:
parent
3f1bb4f4e2
commit
464c8b8c1d
@ -201,6 +201,39 @@ class HomeControllerTest {
|
|||||||
assertThat(page.querySelectorAll("div.notification.info")).isEmpty()
|
assertThat(page.querySelectorAll("div.notification.info")).isEmpty()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@WithMockUser(username = "admin", roles = ["ADMIN"])
|
||||||
|
fun testShouldShowPatientPseudonym() {
|
||||||
|
whenever(requestService.findRequestByPatientId(anyValueClass(), any<Pageable>())).thenReturn(
|
||||||
|
PageImpl(
|
||||||
|
listOf(
|
||||||
|
Request(
|
||||||
|
2L,
|
||||||
|
randomRequestId(),
|
||||||
|
PatientPseudonym("PSEUDO1"),
|
||||||
|
PatientId("PATIENT1"),
|
||||||
|
Fingerprint("ashdkasdh"),
|
||||||
|
RequestType.MTB_FILE,
|
||||||
|
RequestStatus.SUCCESS
|
||||||
|
),
|
||||||
|
Request(
|
||||||
|
1L,
|
||||||
|
randomRequestId(),
|
||||||
|
PatientPseudonym("PSEUDO1"),
|
||||||
|
PatientId("PATIENT1"),
|
||||||
|
Fingerprint("asdasdasd"),
|
||||||
|
RequestType.MTB_FILE,
|
||||||
|
RequestStatus.ERROR
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
val page = webClient.getPage<HtmlPage>("http://localhost/patient/PSEUDO1")
|
||||||
|
assertThat(page.querySelectorAll("h2 > span")).hasSize(1)
|
||||||
|
assertThat(page.querySelectorAll("h2 > span").first().textContent).isEqualTo("PSEUDO1")
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nested
|
@Nested
|
||||||
|
@ -53,12 +53,12 @@ class HomeController(
|
|||||||
|
|
||||||
@GetMapping(path = ["patient/{patientPseudonym}"])
|
@GetMapping(path = ["patient/{patientPseudonym}"])
|
||||||
fun byPatient(
|
fun byPatient(
|
||||||
@PathVariable patientPseudonym: String,
|
@PathVariable patientPseudonym: PatientPseudonym,
|
||||||
@PageableDefault(page = 0, size = 20, sort = ["processedAt"], direction = Sort.Direction.DESC) pageable: Pageable,
|
@PageableDefault(page = 0, size = 20, sort = ["processedAt"], direction = Sort.Direction.DESC) pageable: Pageable,
|
||||||
model: Model
|
model: Model
|
||||||
): String {
|
): String {
|
||||||
val requests = requestService.findRequestByPatientId(PatientPseudonym(patientPseudonym), pageable)
|
val requests = requestService.findRequestByPatientId(patientPseudonym, pageable)
|
||||||
model.addAttribute("patientPseudonym", patientPseudonym)
|
model.addAttribute("patientPseudonym", patientPseudonym.value)
|
||||||
model.addAttribute("requests", requests)
|
model.addAttribute("requests", requests)
|
||||||
|
|
||||||
return "index"
|
return "index"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user