From 9bd8055f7df8735cbd71167cd5f0cfea5d9eeae0 Mon Sep 17 00:00:00 2001 From: BartChris Date: Wed, 11 Dec 2024 18:45:37 +0100 Subject: [PATCH] extend test --- .../production/forms/copyprocess/CreateProcessFormIT.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Kitodo/src/test/java/org/kitodo/production/forms/copyprocess/CreateProcessFormIT.java b/Kitodo/src/test/java/org/kitodo/production/forms/copyprocess/CreateProcessFormIT.java index 5fff1c4be55..4f3237c9875 100644 --- a/Kitodo/src/test/java/org/kitodo/production/forms/copyprocess/CreateProcessFormIT.java +++ b/Kitodo/src/test/java/org/kitodo/production/forms/copyprocess/CreateProcessFormIT.java @@ -13,6 +13,7 @@ import static org.awaitility.Awaitility.await; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertTrue; @@ -193,6 +194,11 @@ private void assertDuplicateTitleNotAllowed(int projectId, boolean switchUserCon if (switchUserContext) { User userTwo = ServiceManager.getUserService().getById(2); SecurityTestUtils.addUserDataToSecurityContext(userTwo, 1); + // Assert that the user 2 is NOT associated with project 2 + assertFalse(ServiceManager.getProjectService() + .getById(projectId) + .getUsers() + .contains(userTwo), "User should not have access to projectOne"); } // Second process creation with duplicate title