Skip to content

Commit

Permalink
bugfix: fix get task by id typo (#427)
Browse files Browse the repository at this point in the history
Fixing a small typo causing the get task by id endpoint to fail.
  • Loading branch information
lmoesle authored Jul 23, 2024
1 parent 1216594 commit 0c45235
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ public interface UserTaskQuery {

List<Task> getTasksForUser(final String user);

Task getTask(final String user, final String taskId);
Task getTask(final String taskId, final String user);
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public List<Task> 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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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");
}
Expand Down

0 comments on commit 0c45235

Please sign in to comment.