diff options
| author | Paul-Christian Volkmer | 2026-03-07 10:48:16 +0100 |
|---|---|---|
| committer | GitHub | 2026-03-07 09:48:16 +0000 |
| commit | ee5f9096c85f6789078597ba19f7c02e6b24d2c5 (patch) | |
| tree | 616831069941510eea5ce652947837adefe86e49 /src/integrationTest/kotlin/dev/dnpm | |
| parent | 9eb8d74117c4c363f787fbc3e02a90e7f21a402e (diff) | |
feat: configuration of additional users (#254)
Diffstat (limited to 'src/integrationTest/kotlin/dev/dnpm')
| -rw-r--r-- | src/integrationTest/kotlin/dev/dnpm/etl/processor/input/MtbFileRestControllerTest.kt | 13 |
1 files changed, 6 insertions, 7 deletions
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<Mtb>()) + verify(requestProcessor, times(1)).processMtbFile(any<Mtb>()) } @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<Mtb>()) } |
