From ee5f9096c85f6789078597ba19f7c02e6b24d2c5 Mon Sep 17 00:00:00 2001 From: Paul-Christian Volkmer Date: Sat, 7 Mar 2026 10:48:16 +0100 Subject: feat: configuration of additional users (#254) --- .../dnpm/etl/processor/input/MtbFileRestControllerTest.kt | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src/integrationTest/kotlin/dev/dnpm/etl') diff --git a/src/integrationTest/kotlin/dev/dnpm/etl/processor/input/MtbFileRestControllerTest.kt b/src/integrationTest/kotlin/dev/dnpm/etl/processor/input/MtbFileRestControllerTest.kt index afaca73..4c7de9c 100644 --- a/src/integrationTest/kotlin/dev/dnpm/etl/processor/input/MtbFileRestControllerTest.kt +++ b/src/integrationTest/kotlin/dev/dnpm/etl/processor/input/MtbFileRestControllerTest.kt @@ -159,16 +159,16 @@ class MtbFileRestControllerTest { "/api/mtb/etl/patient-record", ] ) - fun testShouldDenyPermissionToSendMtbFile(url: String) { + fun testShouldGrantPermissionToSendMtbFileToUser(url: String) { mockMvc .post(url) { - with(anonymous()) + with(user("testuser").roles("USER")) contentType = MediaType.APPLICATION_JSON content = ObjectMapper().writeValueAsString(mtbFile) } - .andExpect { status { isUnauthorized() } } + .andExpect { status { isAccepted() } } - verify(requestProcessor, never()).processMtbFile(any()) + verify(requestProcessor, times(1)).processMtbFile(any()) } @ParameterizedTest @@ -185,14 +185,13 @@ class MtbFileRestControllerTest { "/api/mtb/etl/patient-record", ] ) - fun testShouldDenyPermissionToSendMtbFileForUser(url: String) { + fun testShouldDenyPermissionToSendMtbFileForAnonymous(url: String) { mockMvc .post(url) { - with(user("fakeuser").roles("USER")) contentType = MediaType.APPLICATION_JSON content = ObjectMapper().writeValueAsString(mtbFile) } - .andExpect { status { isForbidden() } } + .andExpect { status { isUnauthorized() } } verify(requestProcessor, never()).processMtbFile(any()) } -- cgit v1.2.3