From 464c8b8c1d29aabef21b34d1a69028ad2922f82f Mon Sep 17 00:00:00 2001 From: Paul-Christian Volkmer Date: Mon, 15 Jul 2024 11:59:00 +0200 Subject: refactor: use dedicated type for path param --- .../dnpm/etl/processor/web/HomeControllerTest.kt | 33 ++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'src/integrationTest/kotlin') diff --git a/src/integrationTest/kotlin/dev/dnpm/etl/processor/web/HomeControllerTest.kt b/src/integrationTest/kotlin/dev/dnpm/etl/processor/web/HomeControllerTest.kt index 80c17d2..82835b4 100644 --- a/src/integrationTest/kotlin/dev/dnpm/etl/processor/web/HomeControllerTest.kt +++ b/src/integrationTest/kotlin/dev/dnpm/etl/processor/web/HomeControllerTest.kt @@ -201,6 +201,39 @@ class HomeControllerTest { assertThat(page.querySelectorAll("div.notification.info")).isEmpty() } + @Test + @WithMockUser(username = "admin", roles = ["ADMIN"]) + fun testShouldShowPatientPseudonym() { + whenever(requestService.findRequestByPatientId(anyValueClass(), any())).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("http://localhost/patient/PSEUDO1") + assertThat(page.querySelectorAll("h2 > span")).hasSize(1) + assertThat(page.querySelectorAll("h2 > span").first().textContent).isEqualTo("PSEUDO1") + } + } @Nested -- cgit v1.2.3