TSK-568: Remove unnecessary exceptions from method signatures

This commit is contained in:
Konstantin Kläger 2018-06-11 17:45:02 +02:00 committed by Holger Hagen
parent a6ff3c2813
commit 5a76d17a54
25 changed files with 121 additions and 145 deletions

View File

@ -46,6 +46,8 @@ public interface TaskMonitorService {
* @return the report * @return the report
* @throws InvalidArgumentException * @throws InvalidArgumentException
* thrown if DaysToWorkingDaysConverter is initialized with null * thrown if DaysToWorkingDaysConverter is initialized with null
* @throws NotAuthorizedException
* if the current user is not member of role MONITOR
*/ */
WorkbasketLevelReport getWorkbasketLevelReport(List<String> workbasketIds, List<TaskState> states, WorkbasketLevelReport getWorkbasketLevelReport(List<String> workbasketIds, List<TaskState> states,
List<String> categories, List<String> domains, CustomField customField, List<String> customFieldValues) List<String> categories, List<String> domains, CustomField customField, List<String> customFieldValues)
@ -85,6 +87,8 @@ public interface TaskMonitorService {
* @return the report * @return the report
* @throws InvalidArgumentException * @throws InvalidArgumentException
* thrown if DaysToWorkingDaysConverter is initialized with null * thrown if DaysToWorkingDaysConverter is initialized with null
* @throws NotAuthorizedException
* if the current user is not member of role MONITOR
*/ */
WorkbasketLevelReport getWorkbasketLevelReport(List<String> workbasketIds, List<TaskState> states, WorkbasketLevelReport getWorkbasketLevelReport(List<String> workbasketIds, List<TaskState> states,
List<String> categories, List<String> domains, CustomField customField, List<String> customFieldValues, List<String> categories, List<String> domains, CustomField customField, List<String> customFieldValues,
@ -127,6 +131,8 @@ public interface TaskMonitorService {
* @return the report * @return the report
* @throws InvalidArgumentException * @throws InvalidArgumentException
* thrown if DaysToWorkingDaysConverter is initialized with null * thrown if DaysToWorkingDaysConverter is initialized with null
* @throws NotAuthorizedException
* if the current user is not member of role MONITOR
*/ */
WorkbasketLevelReport getWorkbasketLevelReport(List<String> workbasketIds, List<TaskState> states, WorkbasketLevelReport getWorkbasketLevelReport(List<String> workbasketIds, List<TaskState> states,
List<String> categories, List<String> domains, CustomField customField, List<String> customFieldValues, List<String> categories, List<String> domains, CustomField customField, List<String> customFieldValues,
@ -156,6 +162,8 @@ public interface TaskMonitorService {
* @return the report * @return the report
* @throws InvalidArgumentException * @throws InvalidArgumentException
* thrown if DaysToWorkingDaysConverter is initialized with null * thrown if DaysToWorkingDaysConverter is initialized with null
* @throws NotAuthorizedException
* if the current user is not member of role MONITOR
*/ */
CategoryReport getCategoryReport(List<String> workbasketIds, List<TaskState> states, List<String> categories, CategoryReport getCategoryReport(List<String> workbasketIds, List<TaskState> states, List<String> categories,
List<String> domains, CustomField customField, List<String> customFieldValues) List<String> domains, CustomField customField, List<String> customFieldValues)
@ -195,6 +203,8 @@ public interface TaskMonitorService {
* @return the report * @return the report
* @throws InvalidArgumentException * @throws InvalidArgumentException
* thrown if DaysToWorkingDaysConverter is initialized with null * thrown if DaysToWorkingDaysConverter is initialized with null
* @throws NotAuthorizedException
* if the current user is not member of role MONITOR
*/ */
CategoryReport getCategoryReport(List<String> workbasketIds, List<TaskState> states, List<String> categories, CategoryReport getCategoryReport(List<String> workbasketIds, List<TaskState> states, List<String> categories,
List<String> domains, CustomField customField, List<String> customFieldValues, List<String> domains, CustomField customField, List<String> customFieldValues,
@ -237,6 +247,8 @@ public interface TaskMonitorService {
* @return the report * @return the report
* @throws InvalidArgumentException * @throws InvalidArgumentException
* thrown if DaysToWorkingDaysConverter is initialized with null * thrown if DaysToWorkingDaysConverter is initialized with null
* @throws NotAuthorizedException
* if the current user is not member of role MONITOR
*/ */
CategoryReport getCategoryReport(List<String> workbasketIds, List<TaskState> states, List<String> categories, CategoryReport getCategoryReport(List<String> workbasketIds, List<TaskState> states, List<String> categories,
List<String> domains, CustomField customField, List<String> customFieldValues, List<String> domains, CustomField customField, List<String> customFieldValues,
@ -266,6 +278,8 @@ public interface TaskMonitorService {
* @return the ClassificationReport * @return the ClassificationReport
* @throws InvalidArgumentException * @throws InvalidArgumentException
* thrown if DaysToWorkingDaysConverter is initialized with null * thrown if DaysToWorkingDaysConverter is initialized with null
* @throws NotAuthorizedException
* if the current user is not member of role MONITOR
*/ */
ClassificationReport getClassificationReport(List<String> workbasketIds, List<TaskState> states, ClassificationReport getClassificationReport(List<String> workbasketIds, List<TaskState> states,
List<String> categories, List<String> domains, CustomField customField, List<String> customFieldValues) List<String> categories, List<String> domains, CustomField customField, List<String> customFieldValues)
@ -305,6 +319,8 @@ public interface TaskMonitorService {
* @return the ClassificationReport * @return the ClassificationReport
* @throws InvalidArgumentException * @throws InvalidArgumentException
* thrown if DaysToWorkingDaysConverter is initialized with null * thrown if DaysToWorkingDaysConverter is initialized with null
* @throws NotAuthorizedException
* if the current user is not member of role MONITOR
*/ */
ClassificationReport getClassificationReport(List<String> workbasketIds, List<TaskState> states, ClassificationReport getClassificationReport(List<String> workbasketIds, List<TaskState> states,
List<String> categories, List<String> domains, CustomField customField, List<String> customFieldValues, List<String> categories, List<String> domains, CustomField customField, List<String> customFieldValues,
@ -347,6 +363,8 @@ public interface TaskMonitorService {
* @return the ClassificationReport * @return the ClassificationReport
* @throws InvalidArgumentException * @throws InvalidArgumentException
* thrown if DaysToWorkingDaysConverter is initialized with null * thrown if DaysToWorkingDaysConverter is initialized with null
* @throws NotAuthorizedException
* if the current user is not member of role MONITOR
*/ */
ClassificationReport getClassificationReport(List<String> workbasketIds, List<TaskState> states, ClassificationReport getClassificationReport(List<String> workbasketIds, List<TaskState> states,
List<String> categories, List<String> domains, CustomField customField, List<String> customFieldValues, List<String> categories, List<String> domains, CustomField customField, List<String> customFieldValues,
@ -377,6 +395,8 @@ public interface TaskMonitorService {
* @return the DetailedClassificationReport * @return the DetailedClassificationReport
* @throws InvalidArgumentException * @throws InvalidArgumentException
* thrown if DaysToWorkingDaysConverter is initialized with null * thrown if DaysToWorkingDaysConverter is initialized with null
* @throws NotAuthorizedException
* if the current user is not member of role MONITOR
*/ */
DetailedClassificationReport getDetailedClassificationReport(List<String> workbasketIds, List<TaskState> states, DetailedClassificationReport getDetailedClassificationReport(List<String> workbasketIds, List<TaskState> states,
List<String> categories, List<String> domains, CustomField customField, List<String> customFieldValues) List<String> categories, List<String> domains, CustomField customField, List<String> customFieldValues)
@ -417,6 +437,8 @@ public interface TaskMonitorService {
* @return the DetailedClassificationReport * @return the DetailedClassificationReport
* @throws InvalidArgumentException * @throws InvalidArgumentException
* thrown if DaysToWorkingDaysConverter is initialized with null * thrown if DaysToWorkingDaysConverter is initialized with null
* @throws NotAuthorizedException
* if the current user is not member of role MONITOR
*/ */
DetailedClassificationReport getDetailedClassificationReport(List<String> workbasketIds, List<TaskState> states, DetailedClassificationReport getDetailedClassificationReport(List<String> workbasketIds, List<TaskState> states,
List<String> categories, List<String> domains, CustomField customField, List<String> customFieldValues, List<String> categories, List<String> domains, CustomField customField, List<String> customFieldValues,
@ -460,6 +482,8 @@ public interface TaskMonitorService {
* @return the DetailedClassificationReport * @return the DetailedClassificationReport
* @throws InvalidArgumentException * @throws InvalidArgumentException
* thrown if DaysToWorkingDaysConverter is initialized with null * thrown if DaysToWorkingDaysConverter is initialized with null
* @throws NotAuthorizedException
* if the current user is not member of role MONITOR
*/ */
DetailedClassificationReport getDetailedClassificationReport(List<String> workbasketIds, List<TaskState> states, DetailedClassificationReport getDetailedClassificationReport(List<String> workbasketIds, List<TaskState> states,
List<String> categories, List<String> domains, CustomField customField, List<String> customFieldValues, List<String> categories, List<String> domains, CustomField customField, List<String> customFieldValues,
@ -488,6 +512,8 @@ public interface TaskMonitorService {
* @return the report * @return the report
* @throws InvalidArgumentException * @throws InvalidArgumentException
* thrown if customField is null * thrown if customField is null
* @throws NotAuthorizedException
* if the current user is not member of role MONITOR
*/ */
CustomFieldValueReport getCustomFieldValueReport(List<String> workbasketIds, List<TaskState> states, CustomFieldValueReport getCustomFieldValueReport(List<String> workbasketIds, List<TaskState> states,
List<String> categories, List<String> domains, CustomField customField, List<String> customFieldValues) List<String> categories, List<String> domains, CustomField customField, List<String> customFieldValues)
@ -526,6 +552,8 @@ public interface TaskMonitorService {
* @return the report * @return the report
* @throws InvalidArgumentException * @throws InvalidArgumentException
* thrown if customField is null * thrown if customField is null
* @throws NotAuthorizedException
* if the current user is not member of role MONITOR
*/ */
CustomFieldValueReport getCustomFieldValueReport(List<String> workbasketIds, List<TaskState> states, CustomFieldValueReport getCustomFieldValueReport(List<String> workbasketIds, List<TaskState> states,
List<String> categories, List<String> domains, CustomField customField, List<String> customFieldValues, List<String> categories, List<String> domains, CustomField customField, List<String> customFieldValues,
@ -567,6 +595,8 @@ public interface TaskMonitorService {
* @return the report * @return the report
* @throws InvalidArgumentException * @throws InvalidArgumentException
* thrown if customField is null * thrown if customField is null
* @throws NotAuthorizedException
* if the current user is not member of role MONITOR
*/ */
CustomFieldValueReport getCustomFieldValueReport(List<String> workbasketIds, List<TaskState> states, CustomFieldValueReport getCustomFieldValueReport(List<String> workbasketIds, List<TaskState> states,
List<String> categories, List<String> categories,
@ -612,6 +642,8 @@ public interface TaskMonitorService {
* @return the list of task ids * @return the list of task ids
* @throws InvalidArgumentException * @throws InvalidArgumentException
* thrown if columnHeaders is null or if selectedItems is empty or null * thrown if columnHeaders is null or if selectedItems is empty or null
* @throws NotAuthorizedException
* if the current user is not member of role MONITOR
*/ */
List<String> getTaskIdsForSelectedItems(List<String> workbasketIds, List<TaskState> states, List<String> categories, List<String> getTaskIdsForSelectedItems(List<String> workbasketIds, List<TaskState> states, List<String> categories,
List<String> domains, List<String> classificationKeys, List<String> domains, List<String> classificationKeys,
@ -644,6 +676,8 @@ public interface TaskMonitorService {
* pool. * pool.
* @throws InvalidArgumentException * @throws InvalidArgumentException
* thrown if the customAttributeName is invalid/empty. * thrown if the customAttributeName is invalid/empty.
* @throws NotAuthorizedException
* if the current user is not member of role MONITOR
*/ */
List<String> getCustomAttributeValuesForReport(List<String> workbasketIds, List<TaskState> states, List<String> getCustomAttributeValuesForReport(List<String> workbasketIds, List<TaskState> states,
List<String> categories, List<String> domains, List<String> classificationIds, List<String> categories, List<String> domains, List<String> classificationIds,
@ -654,6 +688,8 @@ public interface TaskMonitorService {
* Overloaded method for {@link #getTaskStatusReport(List, List)}. This method omits all filters. * Overloaded method for {@link #getTaskStatusReport(List, List)}. This method omits all filters.
* *
* @return the {@link TaskStatusReport} * @return the {@link TaskStatusReport}
* @throws NotAuthorizedException
* if the current user is not member of role MONITOR or ADMIN
*/ */
TaskStatusReport getTaskStatusReport() throws NotAuthorizedException; TaskStatusReport getTaskStatusReport() throws NotAuthorizedException;
@ -664,6 +700,8 @@ public interface TaskMonitorService {
* @param domains * @param domains
* a list of domains to filter by domains. To omit this filter, use null for this parameter * a list of domains to filter by domains. To omit this filter, use null for this parameter
* @return the {@link TaskStatusReport} * @return the {@link TaskStatusReport}
* @throws NotAuthorizedException
* if the current user is not member of role MONITOR or ADMIN
*/ */
TaskStatusReport getTaskStatusReport(List<String> domains) throws NotAuthorizedException; TaskStatusReport getTaskStatusReport(List<String> domains) throws NotAuthorizedException;
@ -677,6 +715,8 @@ public interface TaskMonitorService {
* @param domains * @param domains
* a list of domains to filter by domains. To omit this filter, use null for this parameter * a list of domains to filter by domains. To omit this filter, use null for this parameter
* @return the {@link TaskStatusReport} * @return the {@link TaskStatusReport}
* @throws NotAuthorizedException
* if the current user is not member of role MONITOR or ADMIN
*/ */
TaskStatusReport getTaskStatusReport(List<String> domains, List<TaskState> states) throws NotAuthorizedException; TaskStatusReport getTaskStatusReport(List<String> domains, List<TaskState> states) throws NotAuthorizedException;

View File

@ -9,7 +9,6 @@ import pro.taskana.exceptions.ConcurrencyException;
import pro.taskana.exceptions.InvalidArgumentException; import pro.taskana.exceptions.InvalidArgumentException;
import pro.taskana.exceptions.InvalidOwnerException; import pro.taskana.exceptions.InvalidOwnerException;
import pro.taskana.exceptions.InvalidStateException; import pro.taskana.exceptions.InvalidStateException;
import pro.taskana.exceptions.InvalidWorkbasketException;
import pro.taskana.exceptions.NotAuthorizedException; import pro.taskana.exceptions.NotAuthorizedException;
import pro.taskana.exceptions.TaskAlreadyExistException; import pro.taskana.exceptions.TaskAlreadyExistException;
import pro.taskana.exceptions.TaskNotFoundException; import pro.taskana.exceptions.TaskNotFoundException;
@ -94,8 +93,8 @@ public interface TaskService {
throws TaskNotFoundException, InvalidStateException, InvalidOwnerException, NotAuthorizedException; throws TaskNotFoundException, InvalidStateException, InvalidOwnerException, NotAuthorizedException;
/** /**
* Complete a claimed Task as owner/admin and update State and Timestamps. * Complete a claimed Task as owner/admin and update State and Timestamps. If task is already completed, the task is
* If task is already completed, the task is returned as itself. * returned as itself.
* *
* @param taskId * @param taskId
* - Id of the Task which should be completed. * - Id of the Task which should be completed.
@ -113,8 +112,8 @@ public interface TaskService {
throws TaskNotFoundException, InvalidOwnerException, InvalidStateException, NotAuthorizedException; throws TaskNotFoundException, InvalidOwnerException, InvalidStateException, NotAuthorizedException;
/** /**
* Complete a Task and update State and Timestamps in every case if the Task exists. * Complete a Task and update State and Timestamps in every case if the Task exists. If task is already completed,
* If task is already completed, the task is returned as itself. * the task is returned as itself.
* *
* @param taskId * @param taskId
* - Id of the Task which should be completed. * - Id of the Task which should be completed.
@ -179,14 +178,11 @@ public interface TaskService {
* Thrown if the target work basket was not found. * Thrown if the target work basket was not found.
* @throws NotAuthorizedException * @throws NotAuthorizedException
* Thrown if the current user is not authorized to transfer this {@link Task} to the target work basket * Thrown if the current user is not authorized to transfer this {@link Task} to the target work basket
* @throws InvalidWorkbasketException
* Thrown if either the source or the target workbasket has a missing required property
* @throws InvalidStateException * @throws InvalidStateException
* Thrown if the task is in a state which does not allow transferring * Thrown if the task is in a state which does not allow transferring
*/ */
Task transfer(String taskId, String destinationWorkbasketId) Task transfer(String taskId, String destinationWorkbasketId)
throws TaskNotFoundException, WorkbasketNotFoundException, NotAuthorizedException, InvalidWorkbasketException, throws TaskNotFoundException, WorkbasketNotFoundException, NotAuthorizedException, InvalidStateException;
InvalidStateException;
/** /**
* Transfer a task to another work basket. The transfer sets the transferred flag and resets the read flag. * Transfer a task to another work basket. The transfer sets the transferred flag and resets the read flag.
@ -204,14 +200,11 @@ public interface TaskService {
* Thrown if the target work basket was not found. * Thrown if the target work basket was not found.
* @throws NotAuthorizedException * @throws NotAuthorizedException
* Thrown if the current user is not authorized to transfer this {@link Task} to the target work basket * Thrown if the current user is not authorized to transfer this {@link Task} to the target work basket
* @throws InvalidWorkbasketException
* Thrown if either the source or the target workbasket has a missing required property
* @throws InvalidStateException * @throws InvalidStateException
* Thrown if the task is in a state which does not allow transferring * Thrown if the task is in a state which does not allow transferring
*/ */
Task transfer(String taskId, String workbasketKey, String domain) Task transfer(String taskId, String workbasketKey, String domain)
throws TaskNotFoundException, WorkbasketNotFoundException, NotAuthorizedException, InvalidWorkbasketException, throws TaskNotFoundException, WorkbasketNotFoundException, NotAuthorizedException, InvalidStateException;
InvalidStateException;
/** /**
* Marks a task as read. * Marks a task as read.
@ -274,20 +267,15 @@ public interface TaskService {
* if the id of the task is not found in the database * if the id of the task is not found in the database
* @throws ConcurrencyException * @throws ConcurrencyException
* if the task has already been updated by another user * if the task has already been updated by another user
* @throws InvalidWorkbasketException
* if the updated task refers to a workbasket that has missing required properties
* @throws ClassificationNotFoundException * @throws ClassificationNotFoundException
* if the updated task refers to a classification that cannot be found * if the updated task refers to a classification that cannot be found
* @throws WorkbasketNotFoundException
* if the updated task refers to a work basket that cannot be found
* @throws NotAuthorizedException * @throws NotAuthorizedException
* if the current user is not authorized to update the task * if the current user is not authorized to update the task
* @throws AttachmentPersistenceException * @throws AttachmentPersistenceException
* if an Attachment with ID will be added multiple times without using the task-methods. * if an Attachment with ID will be added multiple times without using the task-methods.
*/ */
Task updateTask(Task task) throws InvalidArgumentException, TaskNotFoundException, ConcurrencyException, Task updateTask(Task task) throws InvalidArgumentException, TaskNotFoundException, ConcurrencyException,
WorkbasketNotFoundException, ClassificationNotFoundException, InvalidWorkbasketException, ClassificationNotFoundException, NotAuthorizedException, AttachmentPersistenceException;
NotAuthorizedException, AttachmentPersistenceException;
/** /**
* Transfers a list of tasks to an other workbasket. Exceptions will be thrown if the caller got no permissions on * Transfers a list of tasks to an other workbasket. Exceptions will be thrown if the caller got no permissions on

View File

@ -1,5 +1,7 @@
package pro.taskana; package pro.taskana;
import java.sql.SQLException;
import pro.taskana.configuration.TaskanaEngineConfiguration; import pro.taskana.configuration.TaskanaEngineConfiguration;
import pro.taskana.exceptions.NotAuthorizedException; import pro.taskana.exceptions.NotAuthorizedException;
@ -59,8 +61,10 @@ public interface TaskanaEngine {
* *
* @param connection * @param connection
* - The java.sql.Connection that is controlled by the client * - The java.sql.Connection that is controlled by the client
* @throws SQLException
* if a database access error occurs
*/ */
void setConnection(java.sql.Connection connection) throws java.sql.SQLException; void setConnection(java.sql.Connection connection) throws SQLException;
/** /**
* Closes the client's connection, sets it to null and switches to mode PARTICIPATE. Only applicable in mode * Closes the client's connection, sets it to null and switches to mode PARTICIPATE. Only applicable in mode

View File

@ -70,15 +70,11 @@ public interface WorkbasketService {
* @param workbasket * @param workbasket
* The Workbasket to update * The Workbasket to update
* @return the updated Workbasket * @return the updated Workbasket
* @throws InvalidWorkbasketException
* if a required property of the workbasket is not set
* @throws WorkbasketNotFoundException
* if the updated work basket references a distribution target that does not exist
* @throws NotAuthorizedException * @throws NotAuthorizedException
* if the current user is not authorized to update the work basket * if the current user is not authorized to update the work basket
*/ */
Workbasket updateWorkbasket(Workbasket workbasket) Workbasket updateWorkbasket(Workbasket workbasket)
throws InvalidWorkbasketException, WorkbasketNotFoundException, NotAuthorizedException; throws NotAuthorizedException;
/** /**
* Returns a new WorkbasketAccessItem which is not persisted. * Returns a new WorkbasketAccessItem which is not persisted.
@ -309,11 +305,9 @@ public interface WorkbasketService {
* The id of the target workbasket * The id of the target workbasket
* @throws NotAuthorizedException * @throws NotAuthorizedException
* If the current user doesn't have READ permission for the source workbasket * If the current user doesn't have READ permission for the source workbasket
* @throws WorkbasketNotFoundException
* if the source workbasket can´t be found by ID.
*/ */
void removeDistributionTarget(String sourceWorkbasketId, String targetWorkbasketId) void removeDistributionTarget(String sourceWorkbasketId, String targetWorkbasketId)
throws NotAuthorizedException, WorkbasketNotFoundException; throws NotAuthorizedException;
/** /**
* Deletes the workbasket by the given ID of it. * Deletes the workbasket by the given ID of it.

View File

@ -643,7 +643,7 @@ public class TaskServiceImpl implements TaskService {
@Override @Override
public Task updateTask(Task task) public Task updateTask(Task task)
throws InvalidArgumentException, TaskNotFoundException, ConcurrencyException, WorkbasketNotFoundException, throws InvalidArgumentException, TaskNotFoundException, ConcurrencyException,
ClassificationNotFoundException, NotAuthorizedException, AttachmentPersistenceException { ClassificationNotFoundException, NotAuthorizedException, AttachmentPersistenceException {
String userId = CurrentUserContext.getUserid(); String userId = CurrentUserContext.getUserid();
LOGGER.debug("entry to updateTask(task = {}, userId = {})", task, userId); LOGGER.debug("entry to updateTask(task = {}, userId = {})", task, userId);

View File

@ -12,7 +12,6 @@ import org.junit.runner.RunWith;
import acceptance.AbstractAccTest; import acceptance.AbstractAccTest;
import pro.taskana.ClassificationService; import pro.taskana.ClassificationService;
import pro.taskana.ClassificationSummary; import pro.taskana.ClassificationSummary;
import pro.taskana.exceptions.NotAuthorizedException;
import pro.taskana.exceptions.TaskanaRuntimeException; import pro.taskana.exceptions.TaskanaRuntimeException;
import pro.taskana.security.JAASRunner; import pro.taskana.security.JAASRunner;
@ -136,12 +135,10 @@ public class QueryClassificationWithPaginationAccTest extends AbstractAccTest {
/** /**
* Testcase only for DB2 users, because H2 doesn´t throw a Exception when the offset is set to high.<br> * Testcase only for DB2 users, because H2 doesn´t throw a Exception when the offset is set to high.<br>
* Using DB2 should throw a unchecked RuntimeException for a offset which is out of bounds. * Using DB2 should throw a unchecked RuntimeException for a offset which is out of bounds.
*
* @throws NotAuthorizedException
*/ */
@Ignore @Ignore
@Test(expected = TaskanaRuntimeException.class) @Test(expected = TaskanaRuntimeException.class)
public void testPaginationThrowingExceptionWhenPageOutOfBounds() throws NotAuthorizedException { public void testPaginationThrowingExceptionWhenPageOutOfBounds() {
ClassificationService classificationService = taskanaEngine.getClassificationService(); ClassificationService classificationService = taskanaEngine.getClassificationService();
// entrypoint set outside result amount // entrypoint set outside result amount

View File

@ -15,7 +15,6 @@ import pro.taskana.ObjectReference;
import pro.taskana.ObjectReferenceQuery; import pro.taskana.ObjectReferenceQuery;
import pro.taskana.TaskQuery; import pro.taskana.TaskQuery;
import pro.taskana.TaskService; import pro.taskana.TaskService;
import pro.taskana.exceptions.NotAuthorizedException;
import pro.taskana.exceptions.TaskanaRuntimeException; import pro.taskana.exceptions.TaskanaRuntimeException;
import pro.taskana.security.JAASRunner; import pro.taskana.security.JAASRunner;
@ -119,12 +118,10 @@ public class QueryObjectreferencesWithPaginationAccTest extends AbstractAccTest
/** /**
* Testcase only for DB2 users, because H2 doesn´t throw a Exception when the offset is set to high.<br> * Testcase only for DB2 users, because H2 doesn´t throw a Exception when the offset is set to high.<br>
* Using DB2 should throw a unchecked RuntimeException for a offset which is out of bounds. * Using DB2 should throw a unchecked RuntimeException for a offset which is out of bounds.
*
* @throws NotAuthorizedException
*/ */
@Ignore @Ignore
@Test(expected = TaskanaRuntimeException.class) @Test(expected = TaskanaRuntimeException.class)
public void testPaginationThrowingExceptionWhenPageOutOfBounds() throws NotAuthorizedException { public void testPaginationThrowingExceptionWhenPageOutOfBounds() {
// entrypoint set outside result amount // entrypoint set outside result amount
int pageNumber = 6; int pageNumber = 6;
int pageSize = 10; int pageSize = 10;

View File

@ -30,7 +30,6 @@ import pro.taskana.exceptions.AttachmentPersistenceException;
import pro.taskana.exceptions.ClassificationNotFoundException; import pro.taskana.exceptions.ClassificationNotFoundException;
import pro.taskana.exceptions.ConcurrencyException; import pro.taskana.exceptions.ConcurrencyException;
import pro.taskana.exceptions.InvalidArgumentException; import pro.taskana.exceptions.InvalidArgumentException;
import pro.taskana.exceptions.InvalidWorkbasketException;
import pro.taskana.exceptions.NotAuthorizedException; import pro.taskana.exceptions.NotAuthorizedException;
import pro.taskana.exceptions.TaskAlreadyExistException; import pro.taskana.exceptions.TaskAlreadyExistException;
import pro.taskana.exceptions.TaskNotFoundException; import pro.taskana.exceptions.TaskNotFoundException;
@ -171,8 +170,7 @@ public class QueryTasksAccTest extends AbstractAccTest {
@Test @Test
public void testQueryForAttachmentInSummary() public void testQueryForAttachmentInSummary()
throws NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException, throws NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException,
TaskNotFoundException, WorkbasketNotFoundException, ConcurrencyException, InvalidWorkbasketException, TaskNotFoundException, ConcurrencyException, AttachmentPersistenceException {
AttachmentPersistenceException {
TaskService taskService = taskanaEngine.getTaskService(); TaskService taskService = taskanaEngine.getTaskService();
Attachment attachment = createAttachment("DOCTYPE_DEFAULT", // prio 99, SL P2000D Attachment attachment = createAttachment("DOCTYPE_DEFAULT", // prio 99, SL P2000D

View File

@ -3,7 +3,6 @@ package acceptance.task;
import static org.hamcrest.core.IsEqual.equalTo; import static org.hamcrest.core.IsEqual.equalTo;
import static org.junit.Assert.assertThat; import static org.junit.Assert.assertThat;
import java.sql.SQLException;
import java.util.List; import java.util.List;
import org.junit.Ignore; import org.junit.Ignore;
@ -14,8 +13,6 @@ import acceptance.AbstractAccTest;
import pro.taskana.KeyDomain; import pro.taskana.KeyDomain;
import pro.taskana.TaskService; import pro.taskana.TaskService;
import pro.taskana.TaskSummary; import pro.taskana.TaskSummary;
import pro.taskana.exceptions.InvalidArgumentException;
import pro.taskana.exceptions.NotAuthorizedException;
import pro.taskana.exceptions.TaskanaRuntimeException; import pro.taskana.exceptions.TaskanaRuntimeException;
import pro.taskana.security.JAASRunner; import pro.taskana.security.JAASRunner;
import pro.taskana.security.WithAccessId; import pro.taskana.security.WithAccessId;
@ -155,18 +152,13 @@ public class QueryTasksWithPaginationAccTest extends AbstractAccTest {
/** /**
* Testcase only for DB2 users, because H2 doesn´t throw a Exception when the offset is set to high.<br> * Testcase only for DB2 users, because H2 doesn´t throw a Exception when the offset is set to high.<br>
* Using DB2 should throw a unchecked RuntimeException for a offset which is out of bounds. * Using DB2 should throw a unchecked RuntimeException for a offset which is out of bounds.
*
* @throws SQLException
* @throws NotAuthorizedException
* @throws InvalidArgumentException
*/ */
@Ignore @Ignore
@WithAccessId( @WithAccessId(
userName = "teamlead_1", userName = "teamlead_1",
groupNames = {"group_1"}) groupNames = {"group_1"})
@Test(expected = TaskanaRuntimeException.class) @Test(expected = TaskanaRuntimeException.class)
public void testPaginationThrowingExceptionWhenPageOutOfBounds() public void testPaginationThrowingExceptionWhenPageOutOfBounds() {
throws SQLException, NotAuthorizedException, InvalidArgumentException {
TaskService taskService = taskanaEngine.getTaskService(); TaskService taskService = taskanaEngine.getTaskService();
// entrypoint set outside result amount // entrypoint set outside result amount

View File

@ -27,7 +27,6 @@ import pro.taskana.Workbasket;
import pro.taskana.exceptions.InvalidArgumentException; import pro.taskana.exceptions.InvalidArgumentException;
import pro.taskana.exceptions.InvalidOwnerException; import pro.taskana.exceptions.InvalidOwnerException;
import pro.taskana.exceptions.InvalidStateException; import pro.taskana.exceptions.InvalidStateException;
import pro.taskana.exceptions.InvalidWorkbasketException;
import pro.taskana.exceptions.NotAuthorizedException; import pro.taskana.exceptions.NotAuthorizedException;
import pro.taskana.exceptions.TaskNotFoundException; import pro.taskana.exceptions.TaskNotFoundException;
import pro.taskana.exceptions.TaskanaException; import pro.taskana.exceptions.TaskanaException;
@ -50,8 +49,8 @@ public class TransferTaskAccTest extends AbstractAccTest {
groupNames = {"group_1"}) groupNames = {"group_1"})
@Test @Test
public void testTransferTaskToWorkbasketId() public void testTransferTaskToWorkbasketId()
throws NotAuthorizedException, WorkbasketNotFoundException, InvalidWorkbasketException, TaskNotFoundException, throws NotAuthorizedException, WorkbasketNotFoundException, TaskNotFoundException, InvalidStateException,
InvalidStateException, InvalidOwnerException { InvalidOwnerException {
TaskService taskService = taskanaEngine.getTaskService(); TaskService taskService = taskanaEngine.getTaskService();
Task task = taskService.getTask("TKI:000000000000000000000000000000000003"); Task task = taskService.getTask("TKI:000000000000000000000000000000000003");
taskService.claim(task.getId()); taskService.claim(task.getId());
@ -71,8 +70,8 @@ public class TransferTaskAccTest extends AbstractAccTest {
groupNames = {"group_1"}) groupNames = {"group_1"})
@Test @Test
public void testTransferTaskToWorkbasketKeyDomain() public void testTransferTaskToWorkbasketKeyDomain()
throws NotAuthorizedException, WorkbasketNotFoundException, InvalidWorkbasketException, TaskNotFoundException, throws NotAuthorizedException, WorkbasketNotFoundException, TaskNotFoundException, InvalidStateException,
InvalidStateException, InvalidOwnerException { InvalidOwnerException {
TaskService taskService = taskanaEngine.getTaskService(); TaskService taskService = taskanaEngine.getTaskService();
Task task = taskService.getTask("TKI:000000000000000000000000000000000003"); Task task = taskService.getTask("TKI:000000000000000000000000000000000003");
taskService.claim(task.getId()); taskService.claim(task.getId());
@ -92,8 +91,7 @@ public class TransferTaskAccTest extends AbstractAccTest {
groupNames = {"group_1"}) groupNames = {"group_1"})
@Test @Test
public void testDomainChangingWhenTransferTask() public void testDomainChangingWhenTransferTask()
throws NotAuthorizedException, WorkbasketNotFoundException, InvalidWorkbasketException, TaskNotFoundException, throws NotAuthorizedException, WorkbasketNotFoundException, TaskNotFoundException, InvalidStateException {
InvalidStateException {
TaskService taskService = taskanaEngine.getTaskService(); TaskService taskService = taskanaEngine.getTaskService();
Task task = taskService.getTask("TKI:000000000000000000000000000000000000"); Task task = taskService.getTask("TKI:000000000000000000000000000000000000");
String domain1 = task.getDomain(); String domain1 = task.getDomain();
@ -109,8 +107,7 @@ public class TransferTaskAccTest extends AbstractAccTest {
groupNames = {"group_1"}) groupNames = {"group_1"})
@Test(expected = NotAuthorizedException.class) @Test(expected = NotAuthorizedException.class)
public void testThrowsExceptionIfTransferWithNoTransferAuthorization() public void testThrowsExceptionIfTransferWithNoTransferAuthorization()
throws NotAuthorizedException, WorkbasketNotFoundException, InvalidWorkbasketException, TaskNotFoundException, throws NotAuthorizedException, WorkbasketNotFoundException, TaskNotFoundException, InvalidStateException {
InvalidStateException {
TaskService taskService = taskanaEngine.getTaskService(); TaskService taskService = taskanaEngine.getTaskService();
Task task = taskService.getTask("TKI:000000000000000000000000000000000001"); Task task = taskService.getTask("TKI:000000000000000000000000000000000001");
@ -122,8 +119,7 @@ public class TransferTaskAccTest extends AbstractAccTest {
groupNames = {"group_1"}) groupNames = {"group_1"})
@Test(expected = InvalidStateException.class) @Test(expected = InvalidStateException.class)
public void testThrowsExceptionIfTaskIsAlreadyCompleted() public void testThrowsExceptionIfTaskIsAlreadyCompleted()
throws NotAuthorizedException, WorkbasketNotFoundException, InvalidWorkbasketException, TaskNotFoundException, throws NotAuthorizedException, WorkbasketNotFoundException, TaskNotFoundException, InvalidStateException {
InvalidStateException {
TaskService taskService = taskanaEngine.getTaskService(); TaskService taskService = taskanaEngine.getTaskService();
Task task = taskService.getTask("TKI:100000000000000000000000000000000006"); Task task = taskService.getTask("TKI:100000000000000000000000000000000006");
@ -135,8 +131,7 @@ public class TransferTaskAccTest extends AbstractAccTest {
groupNames = {"group_1"}) groupNames = {"group_1"})
@Test(expected = NotAuthorizedException.class) @Test(expected = NotAuthorizedException.class)
public void testThrowsExceptionIfTransferWithNoAppendAuthorization() public void testThrowsExceptionIfTransferWithNoAppendAuthorization()
throws NotAuthorizedException, WorkbasketNotFoundException, InvalidWorkbasketException, TaskNotFoundException, throws NotAuthorizedException, WorkbasketNotFoundException, TaskNotFoundException, InvalidStateException {
InvalidStateException {
TaskService taskService = taskanaEngine.getTaskService(); TaskService taskService = taskanaEngine.getTaskService();
Task task = taskService.getTask("TKI:000000000000000000000000000000000002"); Task task = taskService.getTask("TKI:000000000000000000000000000000000002");

View File

@ -29,7 +29,6 @@ import pro.taskana.exceptions.AttachmentPersistenceException;
import pro.taskana.exceptions.ClassificationNotFoundException; import pro.taskana.exceptions.ClassificationNotFoundException;
import pro.taskana.exceptions.ConcurrencyException; import pro.taskana.exceptions.ConcurrencyException;
import pro.taskana.exceptions.InvalidArgumentException; import pro.taskana.exceptions.InvalidArgumentException;
import pro.taskana.exceptions.InvalidWorkbasketException;
import pro.taskana.exceptions.NotAuthorizedException; import pro.taskana.exceptions.NotAuthorizedException;
import pro.taskana.exceptions.TaskAlreadyExistException; import pro.taskana.exceptions.TaskAlreadyExistException;
import pro.taskana.exceptions.TaskNotFoundException; import pro.taskana.exceptions.TaskNotFoundException;
@ -53,8 +52,7 @@ public class UpdateTaskAccTest extends AbstractAccTest {
groupNames = {"group_1"}) groupNames = {"group_1"})
@Test @Test
public void testUpdatePrimaryObjectReferenceOfTask() public void testUpdatePrimaryObjectReferenceOfTask()
throws NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException, throws NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException, TaskNotFoundException,
WorkbasketNotFoundException, InvalidWorkbasketException, TaskNotFoundException,
ConcurrencyException, AttachmentPersistenceException { ConcurrencyException, AttachmentPersistenceException {
TaskService taskService = taskanaEngine.getTaskService(); TaskService taskService = taskanaEngine.getTaskService();
@ -83,9 +81,8 @@ public class UpdateTaskAccTest extends AbstractAccTest {
groupNames = {"group_1"}) groupNames = {"group_1"})
@Test @Test
public void testThrowsExceptionIfMandatoryPrimaryObjectReferenceIsNotSetOrIncomplete() public void testThrowsExceptionIfMandatoryPrimaryObjectReferenceIsNotSetOrIncomplete()
throws NotAuthorizedException, ClassificationNotFoundException, throws NotAuthorizedException, ClassificationNotFoundException, TaskNotFoundException, ConcurrencyException,
WorkbasketNotFoundException, InvalidWorkbasketException, TaskNotFoundException, AttachmentPersistenceException {
ConcurrencyException, AttachmentPersistenceException {
TaskService taskService = taskanaEngine.getTaskService(); TaskService taskService = taskanaEngine.getTaskService();
Task task = taskService.getTask("TKI:000000000000000000000000000000000000"); Task task = taskService.getTask("TKI:000000000000000000000000000000000000");
@ -141,8 +138,7 @@ public class UpdateTaskAccTest extends AbstractAccTest {
@Test @Test
public void testThrowsExceptionIfTaskHasAlreadyBeenUpdated() public void testThrowsExceptionIfTaskHasAlreadyBeenUpdated()
throws NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException, throws NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException,
WorkbasketNotFoundException, InvalidWorkbasketException, TaskNotFoundException, TaskNotFoundException, ConcurrencyException, AttachmentPersistenceException {
ConcurrencyException, AttachmentPersistenceException {
TaskService taskService = taskanaEngine.getTaskService(); TaskService taskService = taskanaEngine.getTaskService();
Task task = taskService.getTask("TKI:000000000000000000000000000000000000"); Task task = taskService.getTask("TKI:000000000000000000000000000000000000");
@ -167,9 +163,8 @@ public class UpdateTaskAccTest extends AbstractAccTest {
groupNames = {"group_1"}) groupNames = {"group_1"})
@Test @Test
public void testUpdateClassificationOfTask() public void testUpdateClassificationOfTask()
throws TaskNotFoundException, WorkbasketNotFoundException, ClassificationNotFoundException, throws TaskNotFoundException, ClassificationNotFoundException, InvalidArgumentException, ConcurrencyException,
InvalidArgumentException, ConcurrencyException, InvalidWorkbasketException, NotAuthorizedException, NotAuthorizedException, AttachmentPersistenceException {
AttachmentPersistenceException {
TaskService taskService = taskanaEngine.getTaskService(); TaskService taskService = taskanaEngine.getTaskService();
Task task = taskService.getTask("TKI:000000000000000000000000000000000000"); Task task = taskService.getTask("TKI:000000000000000000000000000000000000");
@ -215,9 +210,8 @@ public class UpdateTaskAccTest extends AbstractAccTest {
groupNames = {"group_1"}) groupNames = {"group_1"})
@Test @Test
public void testCustomPropertiesOfTask() public void testCustomPropertiesOfTask()
throws TaskNotFoundException, WorkbasketNotFoundException, ClassificationNotFoundException, throws TaskNotFoundException, ClassificationNotFoundException, InvalidArgumentException, ConcurrencyException,
InvalidArgumentException, ConcurrencyException, InvalidWorkbasketException, NotAuthorizedException, NotAuthorizedException, AttachmentPersistenceException {
AttachmentPersistenceException {
TaskService taskService = taskanaEngine.getTaskService(); TaskService taskService = taskanaEngine.getTaskService();
Task task = taskService.getTask("TKI:000000000000000000000000000000000000"); Task task = taskService.getTask("TKI:000000000000000000000000000000000000");
task.setCustomAttribute("1", "T2100"); task.setCustomAttribute("1", "T2100");
@ -233,8 +227,7 @@ public class UpdateTaskAccTest extends AbstractAccTest {
@Test(expected = InvalidArgumentException.class) @Test(expected = InvalidArgumentException.class)
public void testUpdateOfWorkbasketKeyWhatIsNotAllowed() public void testUpdateOfWorkbasketKeyWhatIsNotAllowed()
throws NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException, throws NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException,
WorkbasketNotFoundException, InvalidWorkbasketException, TaskNotFoundException, TaskNotFoundException, ConcurrencyException, AttachmentPersistenceException {
ConcurrencyException, AttachmentPersistenceException {
TaskService taskService = taskanaEngine.getTaskService(); TaskService taskService = taskanaEngine.getTaskService();
Task task = taskService.getTask("TKI:000000000000000000000000000000000000"); Task task = taskService.getTask("TKI:000000000000000000000000000000000000");
@ -302,7 +295,7 @@ public class UpdateTaskAccTest extends AbstractAccTest {
public void testUpdateCallbackInfoOfSimpleTask() public void testUpdateCallbackInfoOfSimpleTask()
throws WorkbasketNotFoundException, ClassificationNotFoundException, NotAuthorizedException, throws WorkbasketNotFoundException, ClassificationNotFoundException, NotAuthorizedException,
TaskAlreadyExistException, InvalidArgumentException, TaskNotFoundException, ConcurrencyException, TaskAlreadyExistException, InvalidArgumentException, TaskNotFoundException, ConcurrencyException,
InvalidWorkbasketException, AttachmentPersistenceException { AttachmentPersistenceException {
TaskService taskService = taskanaEngine.getTaskService(); TaskService taskService = taskanaEngine.getTaskService();
Task newTask = taskService.newTask("USER_1_1", "DOMAIN_A"); Task newTask = taskService.newTask("USER_1_1", "DOMAIN_A");

View File

@ -27,7 +27,6 @@ import pro.taskana.exceptions.AttachmentPersistenceException;
import pro.taskana.exceptions.ClassificationNotFoundException; import pro.taskana.exceptions.ClassificationNotFoundException;
import pro.taskana.exceptions.ConcurrencyException; import pro.taskana.exceptions.ConcurrencyException;
import pro.taskana.exceptions.InvalidArgumentException; import pro.taskana.exceptions.InvalidArgumentException;
import pro.taskana.exceptions.InvalidWorkbasketException;
import pro.taskana.exceptions.NotAuthorizedException; import pro.taskana.exceptions.NotAuthorizedException;
import pro.taskana.exceptions.TaskAlreadyExistException; import pro.taskana.exceptions.TaskAlreadyExistException;
import pro.taskana.exceptions.TaskNotFoundException; import pro.taskana.exceptions.TaskNotFoundException;
@ -59,8 +58,7 @@ public class UpdateTaskAttachmentsAccTest extends AbstractAccTest {
// the begin of each testcase.... // the begin of each testcase....
private void setUpMethod() private void setUpMethod()
throws TaskNotFoundException, ClassificationNotFoundException, NotAuthorizedException, throws TaskNotFoundException, ClassificationNotFoundException, NotAuthorizedException,
WorkbasketNotFoundException, InvalidArgumentException, ConcurrencyException, InvalidWorkbasketException, InvalidArgumentException, ConcurrencyException, AttachmentPersistenceException {
AttachmentPersistenceException {
taskService = taskanaEngine.getTaskService(); taskService = taskanaEngine.getTaskService();
task = taskService.getTask("TKI:000000000000000000000000000000000000"); // class T2000, prio 1, SL P1D task = taskService.getTask("TKI:000000000000000000000000000000000000"); // class T2000, prio 1, SL P1D
task.setClassificationKey("T2000"); task.setClassificationKey("T2000");
@ -79,8 +77,7 @@ public class UpdateTaskAttachmentsAccTest extends AbstractAccTest {
@Test @Test
public void testAddNewAttachment() public void testAddNewAttachment()
throws TaskNotFoundException, ClassificationNotFoundException, NotAuthorizedException, throws TaskNotFoundException, ClassificationNotFoundException, NotAuthorizedException,
WorkbasketNotFoundException, InvalidArgumentException, ConcurrencyException, InvalidWorkbasketException, InvalidArgumentException, ConcurrencyException, AttachmentPersistenceException {
AttachmentPersistenceException {
setUpMethod(); setUpMethod();
int attachmentCount = task.getAttachments().size(); int attachmentCount = task.getAttachments().size();
assertTrue(task.getPriority() == 1); assertTrue(task.getPriority() == 1);
@ -101,8 +98,8 @@ public class UpdateTaskAttachmentsAccTest extends AbstractAccTest {
groupNames = {"group_1"}) groupNames = {"group_1"})
@Test(expected = AttachmentPersistenceException.class) @Test(expected = AttachmentPersistenceException.class)
public void testAddNewAttachmentTwiceWithoutTaskanaMethodWillThrowAttachmentPersistenceException() public void testAddNewAttachmentTwiceWithoutTaskanaMethodWillThrowAttachmentPersistenceException()
throws TaskNotFoundException, WorkbasketNotFoundException, ClassificationNotFoundException, throws TaskNotFoundException, ClassificationNotFoundException, InvalidArgumentException, ConcurrencyException,
InvalidArgumentException, ConcurrencyException, InvalidWorkbasketException, NotAuthorizedException, NotAuthorizedException,
AttachmentPersistenceException { AttachmentPersistenceException {
setUpMethod(); setUpMethod();
int attachmentCount = 0; int attachmentCount = 0;
@ -125,8 +122,7 @@ public class UpdateTaskAttachmentsAccTest extends AbstractAccTest {
@Test @Test
public void testAddExistingAttachmentAgainWillUpdateWhenNotEqual() public void testAddExistingAttachmentAgainWillUpdateWhenNotEqual()
throws TaskNotFoundException, ClassificationNotFoundException, NotAuthorizedException, throws TaskNotFoundException, ClassificationNotFoundException, NotAuthorizedException,
WorkbasketNotFoundException, InvalidArgumentException, ConcurrencyException, InvalidWorkbasketException, InvalidArgumentException, ConcurrencyException, AttachmentPersistenceException {
AttachmentPersistenceException {
setUpMethod(); setUpMethod();
// Add attachment before // Add attachment before
task = taskService.getTask(task.getId()); task = taskService.getTask(task.getId());
@ -160,8 +156,7 @@ public class UpdateTaskAttachmentsAccTest extends AbstractAccTest {
@Test @Test
public void testAddExistingAttachmentAgainWillDoNothingWhenEqual() public void testAddExistingAttachmentAgainWillDoNothingWhenEqual()
throws TaskNotFoundException, ClassificationNotFoundException, NotAuthorizedException, throws TaskNotFoundException, ClassificationNotFoundException, NotAuthorizedException,
WorkbasketNotFoundException, InvalidArgumentException, ConcurrencyException, InvalidWorkbasketException, InvalidArgumentException, ConcurrencyException, AttachmentPersistenceException {
AttachmentPersistenceException {
setUpMethod(); setUpMethod();
// Add Attachment before // Add Attachment before
int attachmentCount = task.getAttachments().size(); int attachmentCount = task.getAttachments().size();
@ -186,9 +181,8 @@ public class UpdateTaskAttachmentsAccTest extends AbstractAccTest {
groupNames = {"group_1"}) groupNames = {"group_1"})
@Test @Test
public void testAddAttachmentAsNullValueWillBeIgnored() public void testAddAttachmentAsNullValueWillBeIgnored()
throws TaskNotFoundException, WorkbasketNotFoundException, ClassificationNotFoundException, throws TaskNotFoundException, ClassificationNotFoundException, InvalidArgumentException, ConcurrencyException,
InvalidArgumentException, ConcurrencyException, InvalidWorkbasketException, NotAuthorizedException, NotAuthorizedException, AttachmentPersistenceException {
AttachmentPersistenceException {
setUpMethod(); setUpMethod();
// Try to add a single NULL-Element // Try to add a single NULL-Element
int attachmentCount = task.getAttachments().size(); int attachmentCount = task.getAttachments().size();
@ -223,9 +217,8 @@ public class UpdateTaskAttachmentsAccTest extends AbstractAccTest {
groupNames = {"group_1"}) groupNames = {"group_1"})
@Test @Test
public void testRemoveAttachment() public void testRemoveAttachment()
throws TaskNotFoundException, WorkbasketNotFoundException, ClassificationNotFoundException, throws TaskNotFoundException, ClassificationNotFoundException, InvalidArgumentException, ConcurrencyException,
InvalidArgumentException, ConcurrencyException, InvalidWorkbasketException, NotAuthorizedException, NotAuthorizedException, AttachmentPersistenceException {
AttachmentPersistenceException {
setUpMethod(); setUpMethod();
task.addAttachment(attachment); task.addAttachment(attachment);
task = taskService.updateTask(task); task = taskService.updateTask(task);
@ -247,9 +240,8 @@ public class UpdateTaskAttachmentsAccTest extends AbstractAccTest {
groupNames = {"group_1"}) groupNames = {"group_1"})
@Test @Test
public void testRemoveAttachmentWithNullAndNotAddedId() public void testRemoveAttachmentWithNullAndNotAddedId()
throws TaskNotFoundException, WorkbasketNotFoundException, ClassificationNotFoundException, throws TaskNotFoundException, ClassificationNotFoundException, InvalidArgumentException, ConcurrencyException,
InvalidArgumentException, ConcurrencyException, InvalidWorkbasketException, NotAuthorizedException, NotAuthorizedException, AttachmentPersistenceException {
AttachmentPersistenceException {
setUpMethod(); setUpMethod();
task.addAttachment(attachment); task.addAttachment(attachment);
task = taskService.updateTask(task); task = taskService.updateTask(task);
@ -273,9 +265,8 @@ public class UpdateTaskAttachmentsAccTest extends AbstractAccTest {
groupNames = {"group_1"}) groupNames = {"group_1"})
@Test @Test
public void testUpdateAttachment() public void testUpdateAttachment()
throws TaskNotFoundException, WorkbasketNotFoundException, ClassificationNotFoundException, throws TaskNotFoundException, ClassificationNotFoundException, InvalidArgumentException, ConcurrencyException,
InvalidArgumentException, ConcurrencyException, InvalidWorkbasketException, NotAuthorizedException, NotAuthorizedException, AttachmentPersistenceException {
AttachmentPersistenceException {
setUpMethod(); setUpMethod();
((TaskImpl) task).setAttachments(new ArrayList<>()); ((TaskImpl) task).setAttachments(new ArrayList<>());
task = taskService.updateTask(task); task = taskService.updateTask(task);
@ -310,8 +301,7 @@ public class UpdateTaskAttachmentsAccTest extends AbstractAccTest {
@Test @Test
public void modifyExistingAttachment() public void modifyExistingAttachment()
throws TaskNotFoundException, ClassificationNotFoundException, NotAuthorizedException, throws TaskNotFoundException, ClassificationNotFoundException, NotAuthorizedException,
WorkbasketNotFoundException, InvalidArgumentException, ConcurrencyException, InvalidWorkbasketException, InvalidArgumentException, ConcurrencyException, AttachmentPersistenceException {
AttachmentPersistenceException {
setUpMethod(); setUpMethod();
// setup test // setup test
assertThat(task.getAttachments().size(), equalTo(0)); assertThat(task.getAttachments().size(), equalTo(0));
@ -394,8 +384,7 @@ public class UpdateTaskAttachmentsAccTest extends AbstractAccTest {
@Test @Test
public void replaceExistingAttachments() public void replaceExistingAttachments()
throws TaskNotFoundException, ClassificationNotFoundException, NotAuthorizedException, throws TaskNotFoundException, ClassificationNotFoundException, NotAuthorizedException,
WorkbasketNotFoundException, InvalidArgumentException, ConcurrencyException, InvalidWorkbasketException, InvalidArgumentException, ConcurrencyException, AttachmentPersistenceException {
AttachmentPersistenceException {
setUpMethod(); setUpMethod();
// setup test // setup test
assertThat(task.getAttachments().size(), equalTo(0)); assertThat(task.getAttachments().size(), equalTo(0));
@ -441,8 +430,8 @@ public class UpdateTaskAttachmentsAccTest extends AbstractAccTest {
@Test @Test
public void testPrioDurationOfTaskFromAttachmentsAtUpdate() public void testPrioDurationOfTaskFromAttachmentsAtUpdate()
throws NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException, throws NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException,
WorkbasketNotFoundException, TaskAlreadyExistException, InvalidWorkbasketException, TaskNotFoundException, WorkbasketNotFoundException, TaskAlreadyExistException, TaskNotFoundException, ConcurrencyException,
ConcurrencyException, AttachmentPersistenceException { AttachmentPersistenceException {
setUpMethod(); setUpMethod();
TaskService taskService = taskanaEngine.getTaskService(); TaskService taskService = taskanaEngine.getTaskService();
@ -489,8 +478,7 @@ public class UpdateTaskAttachmentsAccTest extends AbstractAccTest {
@Test @Test
public void testAddCustomAttributeToAttachment() public void testAddCustomAttributeToAttachment()
throws TaskNotFoundException, ClassificationNotFoundException, NotAuthorizedException, throws TaskNotFoundException, ClassificationNotFoundException, NotAuthorizedException,
WorkbasketNotFoundException, InvalidArgumentException, ConcurrencyException, InvalidWorkbasketException, InvalidArgumentException, ConcurrencyException, AttachmentPersistenceException {
AttachmentPersistenceException {
TaskService taskService = taskanaEngine.getTaskService(); TaskService taskService = taskanaEngine.getTaskService();
task = taskService.getTask("TKI:000000000000000000000000000000000000"); // class T2000, prio 1, SL P1D task = taskService.getTask("TKI:000000000000000000000000000000000000"); // class T2000, prio 1, SL P1D

View File

@ -150,8 +150,8 @@ public class CreateWorkbasketAccTest extends AbstractAccTest {
groupNames = {"businessadmin"}) groupNames = {"businessadmin"})
@Test(expected = WorkbasketAlreadyExistException.class) @Test(expected = WorkbasketAlreadyExistException.class)
public void testThrowsExceptionIfWorkbasketWithCaseInsensitiveSameKeyDomainIsCreated() public void testThrowsExceptionIfWorkbasketWithCaseInsensitiveSameKeyDomainIsCreated()
throws NotAuthorizedException, InvalidArgumentException, WorkbasketNotFoundException, throws NotAuthorizedException, InvalidWorkbasketException, WorkbasketAlreadyExistException,
InvalidWorkbasketException, WorkbasketAlreadyExistException, DomainNotFoundException { DomainNotFoundException {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService(); WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
Workbasket workbasket = workbasketService.newWorkbasket("X123456", "DOMAIN_A"); Workbasket workbasket = workbasketService.newWorkbasket("X123456", "DOMAIN_A");

View File

@ -12,7 +12,6 @@ import org.junit.runner.RunWith;
import acceptance.AbstractAccTest; import acceptance.AbstractAccTest;
import pro.taskana.WorkbasketService; import pro.taskana.WorkbasketService;
import pro.taskana.WorkbasketSummary; import pro.taskana.WorkbasketSummary;
import pro.taskana.exceptions.NotAuthorizedException;
import pro.taskana.exceptions.TaskanaRuntimeException; import pro.taskana.exceptions.TaskanaRuntimeException;
import pro.taskana.security.JAASRunner; import pro.taskana.security.JAASRunner;
import pro.taskana.security.WithAccessId; import pro.taskana.security.WithAccessId;
@ -152,13 +151,10 @@ public class QueryWorkbasketsWithPaginationAccTest extends AbstractAccTest {
/** /**
* Testcase only for DB2 users, because H2 doesn´t throw a Exception when the offset is set to high.<br> * Testcase only for DB2 users, because H2 doesn´t throw a Exception when the offset is set to high.<br>
* Using DB2 should throw a unchecked RuntimeException for a offset which is out of bounds. * Using DB2 should throw a unchecked RuntimeException for a offset which is out of bounds.
*
* @throws NotAuthorizedException
*/ */
@Ignore @Ignore
@Test(expected = TaskanaRuntimeException.class) @Test(expected = TaskanaRuntimeException.class)
public void testPaginationThrowingExceptionWhenPageOutOfBounds() public void testPaginationThrowingExceptionWhenPageOutOfBounds() {
throws NotAuthorizedException {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService(); WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
// entrypoint set outside result amount // entrypoint set outside result amount

View File

@ -10,7 +10,6 @@ import acceptance.AbstractAccTest;
import pro.taskana.Workbasket; import pro.taskana.Workbasket;
import pro.taskana.WorkbasketService; import pro.taskana.WorkbasketService;
import pro.taskana.WorkbasketType; import pro.taskana.WorkbasketType;
import pro.taskana.exceptions.InvalidWorkbasketException;
import pro.taskana.exceptions.NotAuthorizedException; import pro.taskana.exceptions.NotAuthorizedException;
import pro.taskana.exceptions.WorkbasketNotFoundException; import pro.taskana.exceptions.WorkbasketNotFoundException;
import pro.taskana.security.JAASRunner; import pro.taskana.security.JAASRunner;
@ -31,7 +30,7 @@ public class UpdateWorkbasketAccTest extends AbstractAccTest {
groupNames = {"group_1", "businessadmin"}) groupNames = {"group_1", "businessadmin"})
@Test @Test
public void testUpdateWorkbasket() public void testUpdateWorkbasket()
throws NotAuthorizedException, WorkbasketNotFoundException, InvalidWorkbasketException { throws NotAuthorizedException, WorkbasketNotFoundException {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService(); WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
Workbasket workbasket = workbasketService.getWorkbasket("GPK_KSC", "DOMAIN_A"); Workbasket workbasket = workbasketService.getWorkbasket("GPK_KSC", "DOMAIN_A");
Instant modified = workbasket.getModified(); Instant modified = workbasket.getModified();
@ -63,7 +62,7 @@ public class UpdateWorkbasketAccTest extends AbstractAccTest {
groupNames = {"group_1"}) groupNames = {"group_1"})
@Test(expected = NotAuthorizedException.class) @Test(expected = NotAuthorizedException.class)
public void testCheckAuthorizationToUpdateWorkbasket() public void testCheckAuthorizationToUpdateWorkbasket()
throws NotAuthorizedException, WorkbasketNotFoundException, InvalidWorkbasketException { throws NotAuthorizedException, WorkbasketNotFoundException {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService(); WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
Workbasket workbasket = workbasketService.getWorkbasket("USER_1_1", "DOMAIN_A"); Workbasket workbasket = workbasketService.getWorkbasket("USER_1_1", "DOMAIN_A");

View File

@ -1181,7 +1181,7 @@ public class TaskServiceImplTest {
@Test @Test
public void testUpdateTaskAddingValidAttachment() throws TaskNotFoundException, SystemException, public void testUpdateTaskAddingValidAttachment() throws TaskNotFoundException, SystemException,
WorkbasketNotFoundException, ClassificationNotFoundException, InvalidArgumentException, ConcurrencyException, ClassificationNotFoundException, InvalidArgumentException, ConcurrencyException,
NotAuthorizedException, AttachmentPersistenceException { NotAuthorizedException, AttachmentPersistenceException {
Classification classification = createDummyClassification(); Classification classification = createDummyClassification();
Workbasket wb = createWorkbasket("WB-ID", "WB-Key"); Workbasket wb = createWorkbasket("WB-ID", "WB-Key");
@ -1209,7 +1209,7 @@ public class TaskServiceImplTest {
@Test @Test
public void testUpdateTaskAddingValidAttachmentTwice() throws TaskNotFoundException, SystemException, public void testUpdateTaskAddingValidAttachmentTwice() throws TaskNotFoundException, SystemException,
WorkbasketNotFoundException, ClassificationNotFoundException, InvalidArgumentException, ConcurrencyException, ClassificationNotFoundException, InvalidArgumentException, ConcurrencyException,
NotAuthorizedException, AttachmentPersistenceException { NotAuthorizedException, AttachmentPersistenceException {
Classification classification = createDummyClassification(); Classification classification = createDummyClassification();
Workbasket wb = createWorkbasket("WB-ID", "WB-Key"); Workbasket wb = createWorkbasket("WB-ID", "WB-Key");
@ -1239,7 +1239,7 @@ public class TaskServiceImplTest {
@Test(expected = AttachmentPersistenceException.class) @Test(expected = AttachmentPersistenceException.class)
public void testUpdateTaskAddingAttachmentWithSameIdForcedUsingingListMethod() public void testUpdateTaskAddingAttachmentWithSameIdForcedUsingingListMethod()
throws TaskNotFoundException, SystemException, throws TaskNotFoundException, SystemException,
WorkbasketNotFoundException, ClassificationNotFoundException, InvalidArgumentException, ConcurrencyException, ClassificationNotFoundException, InvalidArgumentException, ConcurrencyException,
NotAuthorizedException, AttachmentPersistenceException { NotAuthorizedException, AttachmentPersistenceException {
Classification classification = createDummyClassification(); Classification classification = createDummyClassification();
Workbasket wb = createWorkbasket("WB-ID", "WB-Key"); Workbasket wb = createWorkbasket("WB-ID", "WB-Key");
@ -1272,7 +1272,7 @@ public class TaskServiceImplTest {
@Test @Test
public void testUpdateTaskUpdateAttachment() throws TaskNotFoundException, SystemException, public void testUpdateTaskUpdateAttachment() throws TaskNotFoundException, SystemException,
WorkbasketNotFoundException, ClassificationNotFoundException, InvalidArgumentException, ConcurrencyException, ClassificationNotFoundException, InvalidArgumentException, ConcurrencyException,
NotAuthorizedException, AttachmentPersistenceException { NotAuthorizedException, AttachmentPersistenceException {
String channelUpdate = "OTHER CHANNEL"; String channelUpdate = "OTHER CHANNEL";
Classification classification = createDummyClassification(); Classification classification = createDummyClassification();
@ -1306,7 +1306,7 @@ public class TaskServiceImplTest {
@Test @Test
public void testUpdateTaskRemovingAttachment() throws TaskNotFoundException, SystemException, public void testUpdateTaskRemovingAttachment() throws TaskNotFoundException, SystemException,
WorkbasketNotFoundException, ClassificationNotFoundException, InvalidArgumentException, ConcurrencyException, ClassificationNotFoundException, InvalidArgumentException, ConcurrencyException,
NotAuthorizedException, AttachmentPersistenceException { NotAuthorizedException, AttachmentPersistenceException {
Classification classification = createDummyClassification(); Classification classification = createDummyClassification();
Workbasket wb = createWorkbasket("WB-ID", "WB-Key"); Workbasket wb = createWorkbasket("WB-ID", "WB-Key");

View File

@ -4,7 +4,6 @@ import java.io.InputStreamReader;
import java.io.PrintWriter; import java.io.PrintWriter;
import java.io.StringWriter; import java.io.StringWriter;
import java.sql.Connection; import java.sql.Connection;
import java.sql.SQLException;
import javax.sql.DataSource; import javax.sql.DataSource;
@ -31,9 +30,8 @@ public class DBCleaner {
* *
* @param dropTables * @param dropTables
* if true drop tables, else clean tables * if true drop tables, else clean tables
* @throws SQLException
*/ */
public void clearDb(DataSource dataSource, boolean dropTables) throws SQLException { public void clearDb(DataSource dataSource, boolean dropTables) {
try (Connection connection = dataSource.getConnection()) { try (Connection connection = dataSource.getConnection()) {
ScriptRunner runner = new ScriptRunner(connection); ScriptRunner runner = new ScriptRunner(connection);
LOGGER.debug(connection.getMetaData().toString()); LOGGER.debug(connection.getMetaData().toString());

View File

@ -55,7 +55,7 @@ public class ClassificationServiceImplIntAutoCommitTest {
private TaskanaEngineImpl taskanaEngineImpl; private TaskanaEngineImpl taskanaEngineImpl;
@BeforeClass @BeforeClass
public static void resetDb() throws SQLException { public static void resetDb() {
DataSource ds = TaskanaEngineConfigurationTest.getDataSource(); DataSource ds = TaskanaEngineConfigurationTest.getDataSource();
DBCleaner cleaner = new DBCleaner(); DBCleaner cleaner = new DBCleaner();
cleaner.clearDb(ds, true); cleaner.clearDb(ds, true);

View File

@ -58,7 +58,7 @@ public class ClassificationServiceImplIntExplicitTest {
private TaskanaEngineImpl taskanaEngineImpl; private TaskanaEngineImpl taskanaEngineImpl;
@BeforeClass @BeforeClass
public static void resetDb() throws SQLException { public static void resetDb() {
DataSource ds = TaskanaEngineConfigurationTest.getDataSource(); DataSource ds = TaskanaEngineConfigurationTest.getDataSource();
DBCleaner cleaner = new DBCleaner(); DBCleaner cleaner = new DBCleaner();
cleaner.clearDb(ds, true); cleaner.clearDb(ds, true);

View File

@ -72,7 +72,7 @@ public class TaskServiceImplIntAutocommitTest {
private WorkbasketService workbasketService; private WorkbasketService workbasketService;
@BeforeClass @BeforeClass
public static void resetDb() throws SQLException { public static void resetDb() {
DataSource ds = TaskanaEngineConfigurationTest.getDataSource(); DataSource ds = TaskanaEngineConfigurationTest.getDataSource();
DBCleaner cleaner = new DBCleaner(); DBCleaner cleaner = new DBCleaner();
cleaner.clearDb(ds, true); cleaner.clearDb(ds, true);

View File

@ -76,7 +76,7 @@ public class TaskServiceImplIntExplicitTest {
private WorkbasketService workbasketService; private WorkbasketService workbasketService;
@BeforeClass @BeforeClass
public static void resetDb() throws SQLException { public static void resetDb() {
DataSource ds = TaskanaEngineConfigurationTest.getDataSource(); DataSource ds = TaskanaEngineConfigurationTest.getDataSource();
DBCleaner cleaner = new DBCleaner(); DBCleaner cleaner = new DBCleaner();
cleaner.clearDb(ds, true); cleaner.clearDb(ds, true);

View File

@ -64,7 +64,7 @@ public class WorkbasketServiceImplIntAutocommitTest {
private Instant now; private Instant now;
@BeforeClass @BeforeClass
public static void resetDb() throws SQLException { public static void resetDb() {
DataSource ds = TaskanaEngineConfigurationTest.getDataSource(); DataSource ds = TaskanaEngineConfigurationTest.getDataSource();
DBCleaner cleaner = new DBCleaner(); DBCleaner cleaner = new DBCleaner();
cleaner.clearDb(ds, true); cleaner.clearDb(ds, true);

View File

@ -54,7 +54,7 @@ public class WorkbasketServiceImplIntExplicitTest {
private WorkbasketService workBasketService; private WorkbasketService workBasketService;
@BeforeClass @BeforeClass
public static void resetDb() throws SQLException { public static void resetDb() {
DataSource ds = TaskanaEngineConfigurationTest.getDataSource(); DataSource ds = TaskanaEngineConfigurationTest.getDataSource();
DBCleaner cleaner = new DBCleaner(); DBCleaner cleaner = new DBCleaner();
cleaner.clearDb(ds, true); cleaner.clearDb(ds, true);

View File

@ -7,10 +7,10 @@ import javax.security.auth.callback.Callback;
import javax.security.auth.callback.CallbackHandler; import javax.security.auth.callback.CallbackHandler;
import javax.security.auth.callback.NameCallback; import javax.security.auth.callback.NameCallback;
import javax.security.auth.callback.PasswordCallback; import javax.security.auth.callback.PasswordCallback;
import javax.security.auth.login.LoginException;
import javax.security.auth.spi.LoginModule; import javax.security.auth.spi.LoginModule;
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter; import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
import pro.taskana.security.GroupPrincipal; import pro.taskana.security.GroupPrincipal;
import pro.taskana.security.UserPrincipal; import pro.taskana.security.UserPrincipal;
@ -25,14 +25,13 @@ public class SampleLoginModule extends UsernamePasswordAuthenticationFilter impl
private Subject subject; private Subject subject;
@Override @Override
public boolean abort() throws LoginException { public boolean abort() {
return true; return true;
} }
@Override @Override
public boolean commit() throws LoginException { public boolean commit() {
addUserPrincipalToSubject(); addUserPrincipalToSubject();
addGroupSubjectsDerivedFromUsername(); addGroupSubjectsDerivedFromUsername();
return true; return true;
@ -83,12 +82,12 @@ public class SampleLoginModule extends UsernamePasswordAuthenticationFilter impl
} }
@Override @Override
public boolean login() throws LoginException { public boolean login() {
return nameCallback.getName().equals(new String(passwordCallback.getPassword())); return nameCallback.getName().equals(new String(passwordCallback.getPassword()));
} }
@Override @Override
public boolean logout() throws LoginException { public boolean logout() {
return true; return true;
} }

View File

@ -37,7 +37,6 @@ import pro.taskana.exceptions.ConcurrencyException;
import pro.taskana.exceptions.InvalidArgumentException; import pro.taskana.exceptions.InvalidArgumentException;
import pro.taskana.exceptions.InvalidOwnerException; import pro.taskana.exceptions.InvalidOwnerException;
import pro.taskana.exceptions.InvalidStateException; import pro.taskana.exceptions.InvalidStateException;
import pro.taskana.exceptions.InvalidWorkbasketException;
import pro.taskana.exceptions.NotAuthorizedException; import pro.taskana.exceptions.NotAuthorizedException;
import pro.taskana.exceptions.TaskAlreadyExistException; import pro.taskana.exceptions.TaskAlreadyExistException;
import pro.taskana.exceptions.TaskNotFoundException; import pro.taskana.exceptions.TaskNotFoundException;
@ -181,8 +180,7 @@ public class TaskController extends AbstractPagingController {
@RequestMapping(path = "/{taskId}/transfer/{workbasketId}") @RequestMapping(path = "/{taskId}/transfer/{workbasketId}")
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public ResponseEntity<TaskResource> transferTask(@PathVariable String taskId, @PathVariable String workbasketId) public ResponseEntity<TaskResource> transferTask(@PathVariable String taskId, @PathVariable String workbasketId)
throws TaskNotFoundException, WorkbasketNotFoundException, NotAuthorizedException, InvalidWorkbasketException, throws TaskNotFoundException, WorkbasketNotFoundException, NotAuthorizedException, InvalidStateException {
InvalidStateException {
Task updatedTask = taskService.transfer(taskId, workbasketId); Task updatedTask = taskService.transfer(taskId, workbasketId);
ResponseEntity<TaskResource> result = new ResponseEntity<>(taskResourceAssembler.toResource(updatedTask), ResponseEntity<TaskResource> result = new ResponseEntity<>(taskResourceAssembler.toResource(updatedTask),
HttpStatus.OK); HttpStatus.OK);
@ -193,8 +191,8 @@ public class TaskController extends AbstractPagingController {
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public ResponseEntity<TaskResource> updateTask( public ResponseEntity<TaskResource> updateTask(
@PathVariable(value = "taskId") String taskId, @PathVariable(value = "taskId") String taskId,
@RequestBody TaskResource taskResource) throws TaskNotFoundException, WorkbasketNotFoundException, @RequestBody TaskResource taskResource)
ClassificationNotFoundException, InvalidArgumentException, ConcurrencyException, InvalidWorkbasketException, throws TaskNotFoundException, ClassificationNotFoundException, InvalidArgumentException, ConcurrencyException,
NotAuthorizedException, AttachmentPersistenceException { NotAuthorizedException, AttachmentPersistenceException {
ResponseEntity<TaskResource> result; ResponseEntity<TaskResource> result;
if (taskId.equals(taskResource.getTaskId())) { if (taskId.equals(taskResource.getTaskId())) {