diff --git a/platform/engine/task/src/main/java/io/miragon/miranum/platform/tasklist/application/port/in/UserTaskQuery.java b/platform/engine/task/src/main/java/io/miragon/miranum/platform/tasklist/application/port/in/UserTaskQuery.java index 5d024d83..33416ce3 100644 --- a/platform/engine/task/src/main/java/io/miragon/miranum/platform/tasklist/application/port/in/UserTaskQuery.java +++ b/platform/engine/task/src/main/java/io/miragon/miranum/platform/tasklist/application/port/in/UserTaskQuery.java @@ -11,5 +11,5 @@ public interface UserTaskQuery { List getTasksForUser(final String user); - Task getTask(final String user, final String taskId); + Task getTask(final String taskId, final String user); } diff --git a/platform/engine/task/src/main/java/io/miragon/miranum/platform/tasklist/application/service/UserTaskQueryImpl.java b/platform/engine/task/src/main/java/io/miragon/miranum/platform/tasklist/application/service/UserTaskQueryImpl.java index f7dc492c..83be9ca7 100644 --- a/platform/engine/task/src/main/java/io/miragon/miranum/platform/tasklist/application/service/UserTaskQueryImpl.java +++ b/platform/engine/task/src/main/java/io/miragon/miranum/platform/tasklist/application/service/UserTaskQueryImpl.java @@ -28,7 +28,7 @@ public List getTasksForUser(final String user) { } @Override - public Task getTask(final String user, final String taskId) throws TaskAccessDeniedException { + public Task getTask(final String taskId, final String user) throws TaskAccessDeniedException { final Task task = this.taskOutPort.getTask(taskId); return userTaskAccessProvider.hasAccess(task, user); } diff --git a/platform/engine/task/src/test/java/io/miragon/miranum/platform/tasklist/application/service/UserTaskQueryImplTest.java b/platform/engine/task/src/test/java/io/miragon/miranum/platform/tasklist/application/service/UserTaskQueryImplTest.java index 79d6c969..d21770a9 100644 --- a/platform/engine/task/src/test/java/io/miragon/miranum/platform/tasklist/application/service/UserTaskQueryImplTest.java +++ b/platform/engine/task/src/test/java/io/miragon/miranum/platform/tasklist/application/service/UserTaskQueryImplTest.java @@ -114,7 +114,7 @@ void test_get_task_by_id() { when(taskOutPort.getTask(taskId)).thenReturn(tasks); - final Task result = userTaskQuery.getTask(user, taskId); + final Task result = userTaskQuery.getTask(taskId, user); assertThat(result) .isNotNull() @@ -136,7 +136,7 @@ void test_get_task_by_id_with_no_access() { .formKey("exampleForm") .build()); - assertThatThrownBy(() -> userTaskQuery.getTask(user, taskId)) + assertThatThrownBy(() -> userTaskQuery.getTask(taskId, user)) .isInstanceOf(TaskAccessDeniedException.class) .hasMessage("User notAssignedUser has no access to task 5"); }