diff --git a/lib/taskana-core/src/main/java/pro/taskana/TaskMonitorService.java b/lib/taskana-core/src/main/java/pro/taskana/TaskMonitorService.java index cba52aeaf..e665b54f3 100644 --- a/lib/taskana-core/src/main/java/pro/taskana/TaskMonitorService.java +++ b/lib/taskana-core/src/main/java/pro/taskana/TaskMonitorService.java @@ -46,6 +46,8 @@ public interface TaskMonitorService { * @return the report * @throws InvalidArgumentException * thrown if DaysToWorkingDaysConverter is initialized with null + * @throws NotAuthorizedException + * if the current user is not member of role MONITOR */ WorkbasketLevelReport getWorkbasketLevelReport(List workbasketIds, List states, List categories, List domains, CustomField customField, List customFieldValues) @@ -85,6 +87,8 @@ public interface TaskMonitorService { * @return the report * @throws InvalidArgumentException * thrown if DaysToWorkingDaysConverter is initialized with null + * @throws NotAuthorizedException + * if the current user is not member of role MONITOR */ WorkbasketLevelReport getWorkbasketLevelReport(List workbasketIds, List states, List categories, List domains, CustomField customField, List customFieldValues, @@ -127,6 +131,8 @@ public interface TaskMonitorService { * @return the report * @throws InvalidArgumentException * thrown if DaysToWorkingDaysConverter is initialized with null + * @throws NotAuthorizedException + * if the current user is not member of role MONITOR */ WorkbasketLevelReport getWorkbasketLevelReport(List workbasketIds, List states, List categories, List domains, CustomField customField, List customFieldValues, @@ -156,6 +162,8 @@ public interface TaskMonitorService { * @return the report * @throws InvalidArgumentException * thrown if DaysToWorkingDaysConverter is initialized with null + * @throws NotAuthorizedException + * if the current user is not member of role MONITOR */ CategoryReport getCategoryReport(List workbasketIds, List states, List categories, List domains, CustomField customField, List customFieldValues) @@ -195,6 +203,8 @@ public interface TaskMonitorService { * @return the report * @throws InvalidArgumentException * thrown if DaysToWorkingDaysConverter is initialized with null + * @throws NotAuthorizedException + * if the current user is not member of role MONITOR */ CategoryReport getCategoryReport(List workbasketIds, List states, List categories, List domains, CustomField customField, List customFieldValues, @@ -237,6 +247,8 @@ public interface TaskMonitorService { * @return the report * @throws InvalidArgumentException * thrown if DaysToWorkingDaysConverter is initialized with null + * @throws NotAuthorizedException + * if the current user is not member of role MONITOR */ CategoryReport getCategoryReport(List workbasketIds, List states, List categories, List domains, CustomField customField, List customFieldValues, @@ -266,6 +278,8 @@ public interface TaskMonitorService { * @return the ClassificationReport * @throws InvalidArgumentException * thrown if DaysToWorkingDaysConverter is initialized with null + * @throws NotAuthorizedException + * if the current user is not member of role MONITOR */ ClassificationReport getClassificationReport(List workbasketIds, List states, List categories, List domains, CustomField customField, List customFieldValues) @@ -305,6 +319,8 @@ public interface TaskMonitorService { * @return the ClassificationReport * @throws InvalidArgumentException * thrown if DaysToWorkingDaysConverter is initialized with null + * @throws NotAuthorizedException + * if the current user is not member of role MONITOR */ ClassificationReport getClassificationReport(List workbasketIds, List states, List categories, List domains, CustomField customField, List customFieldValues, @@ -347,6 +363,8 @@ public interface TaskMonitorService { * @return the ClassificationReport * @throws InvalidArgumentException * thrown if DaysToWorkingDaysConverter is initialized with null + * @throws NotAuthorizedException + * if the current user is not member of role MONITOR */ ClassificationReport getClassificationReport(List workbasketIds, List states, List categories, List domains, CustomField customField, List customFieldValues, @@ -377,6 +395,8 @@ public interface TaskMonitorService { * @return the DetailedClassificationReport * @throws InvalidArgumentException * thrown if DaysToWorkingDaysConverter is initialized with null + * @throws NotAuthorizedException + * if the current user is not member of role MONITOR */ DetailedClassificationReport getDetailedClassificationReport(List workbasketIds, List states, List categories, List domains, CustomField customField, List customFieldValues) @@ -417,6 +437,8 @@ public interface TaskMonitorService { * @return the DetailedClassificationReport * @throws InvalidArgumentException * thrown if DaysToWorkingDaysConverter is initialized with null + * @throws NotAuthorizedException + * if the current user is not member of role MONITOR */ DetailedClassificationReport getDetailedClassificationReport(List workbasketIds, List states, List categories, List domains, CustomField customField, List customFieldValues, @@ -460,6 +482,8 @@ public interface TaskMonitorService { * @return the DetailedClassificationReport * @throws InvalidArgumentException * thrown if DaysToWorkingDaysConverter is initialized with null + * @throws NotAuthorizedException + * if the current user is not member of role MONITOR */ DetailedClassificationReport getDetailedClassificationReport(List workbasketIds, List states, List categories, List domains, CustomField customField, List customFieldValues, @@ -488,6 +512,8 @@ public interface TaskMonitorService { * @return the report * @throws InvalidArgumentException * thrown if customField is null + * @throws NotAuthorizedException + * if the current user is not member of role MONITOR */ CustomFieldValueReport getCustomFieldValueReport(List workbasketIds, List states, List categories, List domains, CustomField customField, List customFieldValues) @@ -526,6 +552,8 @@ public interface TaskMonitorService { * @return the report * @throws InvalidArgumentException * thrown if customField is null + * @throws NotAuthorizedException + * if the current user is not member of role MONITOR */ CustomFieldValueReport getCustomFieldValueReport(List workbasketIds, List states, List categories, List domains, CustomField customField, List customFieldValues, @@ -567,6 +595,8 @@ public interface TaskMonitorService { * @return the report * @throws InvalidArgumentException * thrown if customField is null + * @throws NotAuthorizedException + * if the current user is not member of role MONITOR */ CustomFieldValueReport getCustomFieldValueReport(List workbasketIds, List states, List categories, @@ -612,6 +642,8 @@ public interface TaskMonitorService { * @return the list of task ids * @throws InvalidArgumentException * 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 getTaskIdsForSelectedItems(List workbasketIds, List states, List categories, List domains, List classificationKeys, @@ -644,6 +676,8 @@ public interface TaskMonitorService { * pool. * @throws InvalidArgumentException * thrown if the customAttributeName is invalid/empty. + * @throws NotAuthorizedException + * if the current user is not member of role MONITOR */ List getCustomAttributeValuesForReport(List workbasketIds, List states, List categories, List domains, List classificationIds, @@ -654,6 +688,8 @@ public interface TaskMonitorService { * Overloaded method for {@link #getTaskStatusReport(List, List)}. This method omits all filters. * * @return the {@link TaskStatusReport} + * @throws NotAuthorizedException + * if the current user is not member of role MONITOR or ADMIN */ TaskStatusReport getTaskStatusReport() throws NotAuthorizedException; @@ -664,6 +700,8 @@ public interface TaskMonitorService { * @param domains * a list of domains to filter by domains. To omit this filter, use null for this parameter * @return the {@link TaskStatusReport} + * @throws NotAuthorizedException + * if the current user is not member of role MONITOR or ADMIN */ TaskStatusReport getTaskStatusReport(List domains) throws NotAuthorizedException; @@ -677,6 +715,8 @@ public interface TaskMonitorService { * @param domains * a list of domains to filter by domains. To omit this filter, use null for this parameter * @return the {@link TaskStatusReport} + * @throws NotAuthorizedException + * if the current user is not member of role MONITOR or ADMIN */ TaskStatusReport getTaskStatusReport(List domains, List states) throws NotAuthorizedException; diff --git a/lib/taskana-core/src/main/java/pro/taskana/TaskService.java b/lib/taskana-core/src/main/java/pro/taskana/TaskService.java index 84471a578..baf0840aa 100644 --- a/lib/taskana-core/src/main/java/pro/taskana/TaskService.java +++ b/lib/taskana-core/src/main/java/pro/taskana/TaskService.java @@ -9,7 +9,6 @@ import pro.taskana.exceptions.ConcurrencyException; import pro.taskana.exceptions.InvalidArgumentException; import pro.taskana.exceptions.InvalidOwnerException; import pro.taskana.exceptions.InvalidStateException; -import pro.taskana.exceptions.InvalidWorkbasketException; import pro.taskana.exceptions.NotAuthorizedException; import pro.taskana.exceptions.TaskAlreadyExistException; import pro.taskana.exceptions.TaskNotFoundException; @@ -94,8 +93,8 @@ public interface TaskService { throws TaskNotFoundException, InvalidStateException, InvalidOwnerException, NotAuthorizedException; /** - * Complete a claimed Task as owner/admin and update State and Timestamps. - * If task is already completed, the task is returned as itself. + * Complete a claimed Task as owner/admin and update State and Timestamps. If task is already completed, the task is + * returned as itself. * * @param taskId * - Id of the Task which should be completed. @@ -113,8 +112,8 @@ public interface TaskService { throws TaskNotFoundException, InvalidOwnerException, InvalidStateException, NotAuthorizedException; /** - * Complete a Task and update State and Timestamps in every case if the Task exists. - * If task is already completed, the task is returned as itself. + * Complete a Task and update State and Timestamps in every case if the Task exists. If task is already completed, + * the task is returned as itself. * * @param taskId * - Id of the Task which should be completed. @@ -179,14 +178,11 @@ public interface TaskService { * Thrown if the target work basket was not found. * @throws NotAuthorizedException * 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 * Thrown if the task is in a state which does not allow transferring */ Task transfer(String taskId, String destinationWorkbasketId) - throws TaskNotFoundException, WorkbasketNotFoundException, NotAuthorizedException, InvalidWorkbasketException, - InvalidStateException; + throws TaskNotFoundException, WorkbasketNotFoundException, NotAuthorizedException, InvalidStateException; /** * 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. * @throws NotAuthorizedException * 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 * Thrown if the task is in a state which does not allow transferring */ Task transfer(String taskId, String workbasketKey, String domain) - throws TaskNotFoundException, WorkbasketNotFoundException, NotAuthorizedException, InvalidWorkbasketException, - InvalidStateException; + throws TaskNotFoundException, WorkbasketNotFoundException, NotAuthorizedException, InvalidStateException; /** * Marks a task as read. @@ -274,20 +267,15 @@ public interface TaskService { * if the id of the task is not found in the database * @throws ConcurrencyException * 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 * 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 * if the current user is not authorized to update the task * @throws AttachmentPersistenceException * if an Attachment with ID will be added multiple times without using the task-methods. */ Task updateTask(Task task) throws InvalidArgumentException, TaskNotFoundException, ConcurrencyException, - WorkbasketNotFoundException, ClassificationNotFoundException, InvalidWorkbasketException, - NotAuthorizedException, AttachmentPersistenceException; + ClassificationNotFoundException, NotAuthorizedException, AttachmentPersistenceException; /** * Transfers a list of tasks to an other workbasket. Exceptions will be thrown if the caller got no permissions on diff --git a/lib/taskana-core/src/main/java/pro/taskana/TaskanaEngine.java b/lib/taskana-core/src/main/java/pro/taskana/TaskanaEngine.java index d08d2442b..0859cd749 100644 --- a/lib/taskana-core/src/main/java/pro/taskana/TaskanaEngine.java +++ b/lib/taskana-core/src/main/java/pro/taskana/TaskanaEngine.java @@ -1,5 +1,7 @@ package pro.taskana; +import java.sql.SQLException; + import pro.taskana.configuration.TaskanaEngineConfiguration; import pro.taskana.exceptions.NotAuthorizedException; @@ -59,8 +61,10 @@ public interface TaskanaEngine { * * @param connection * - 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 diff --git a/lib/taskana-core/src/main/java/pro/taskana/WorkbasketService.java b/lib/taskana-core/src/main/java/pro/taskana/WorkbasketService.java index 24dc0f6d5..3e815ed20 100644 --- a/lib/taskana-core/src/main/java/pro/taskana/WorkbasketService.java +++ b/lib/taskana-core/src/main/java/pro/taskana/WorkbasketService.java @@ -70,15 +70,11 @@ public interface WorkbasketService { * @param workbasket * The Workbasket to update * @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 * if the current user is not authorized to update the work basket */ Workbasket updateWorkbasket(Workbasket workbasket) - throws InvalidWorkbasketException, WorkbasketNotFoundException, NotAuthorizedException; + throws NotAuthorizedException; /** * Returns a new WorkbasketAccessItem which is not persisted. @@ -309,11 +305,9 @@ public interface WorkbasketService { * The id of the target workbasket * @throws NotAuthorizedException * 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) - throws NotAuthorizedException, WorkbasketNotFoundException; + throws NotAuthorizedException; /** * Deletes the workbasket by the given ID of it. diff --git a/lib/taskana-core/src/main/java/pro/taskana/impl/TaskServiceImpl.java b/lib/taskana-core/src/main/java/pro/taskana/impl/TaskServiceImpl.java index 81cc5bd34..7772dc123 100644 --- a/lib/taskana-core/src/main/java/pro/taskana/impl/TaskServiceImpl.java +++ b/lib/taskana-core/src/main/java/pro/taskana/impl/TaskServiceImpl.java @@ -643,7 +643,7 @@ public class TaskServiceImpl implements TaskService { @Override public Task updateTask(Task task) - throws InvalidArgumentException, TaskNotFoundException, ConcurrencyException, WorkbasketNotFoundException, + throws InvalidArgumentException, TaskNotFoundException, ConcurrencyException, ClassificationNotFoundException, NotAuthorizedException, AttachmentPersistenceException { String userId = CurrentUserContext.getUserid(); LOGGER.debug("entry to updateTask(task = {}, userId = {})", task, userId); diff --git a/lib/taskana-core/src/test/java/acceptance/classification/QueryClassificationWithPaginationAccTest.java b/lib/taskana-core/src/test/java/acceptance/classification/QueryClassificationWithPaginationAccTest.java index 7187056ee..cd5c68195 100644 --- a/lib/taskana-core/src/test/java/acceptance/classification/QueryClassificationWithPaginationAccTest.java +++ b/lib/taskana-core/src/test/java/acceptance/classification/QueryClassificationWithPaginationAccTest.java @@ -12,7 +12,6 @@ import org.junit.runner.RunWith; import acceptance.AbstractAccTest; import pro.taskana.ClassificationService; import pro.taskana.ClassificationSummary; -import pro.taskana.exceptions.NotAuthorizedException; import pro.taskana.exceptions.TaskanaRuntimeException; 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.
* Using DB2 should throw a unchecked RuntimeException for a offset which is out of bounds. - * - * @throws NotAuthorizedException */ @Ignore @Test(expected = TaskanaRuntimeException.class) - public void testPaginationThrowingExceptionWhenPageOutOfBounds() throws NotAuthorizedException { + public void testPaginationThrowingExceptionWhenPageOutOfBounds() { ClassificationService classificationService = taskanaEngine.getClassificationService(); // entrypoint set outside result amount diff --git a/lib/taskana-core/src/test/java/acceptance/objectreference/QueryObjectreferencesWithPaginationAccTest.java b/lib/taskana-core/src/test/java/acceptance/objectreference/QueryObjectreferencesWithPaginationAccTest.java index e684f5756..45fe4cba9 100644 --- a/lib/taskana-core/src/test/java/acceptance/objectreference/QueryObjectreferencesWithPaginationAccTest.java +++ b/lib/taskana-core/src/test/java/acceptance/objectreference/QueryObjectreferencesWithPaginationAccTest.java @@ -15,7 +15,6 @@ import pro.taskana.ObjectReference; import pro.taskana.ObjectReferenceQuery; import pro.taskana.TaskQuery; import pro.taskana.TaskService; -import pro.taskana.exceptions.NotAuthorizedException; import pro.taskana.exceptions.TaskanaRuntimeException; 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.
* Using DB2 should throw a unchecked RuntimeException for a offset which is out of bounds. - * - * @throws NotAuthorizedException */ @Ignore @Test(expected = TaskanaRuntimeException.class) - public void testPaginationThrowingExceptionWhenPageOutOfBounds() throws NotAuthorizedException { + public void testPaginationThrowingExceptionWhenPageOutOfBounds() { // entrypoint set outside result amount int pageNumber = 6; int pageSize = 10; diff --git a/lib/taskana-core/src/test/java/acceptance/task/QueryTasksAccTest.java b/lib/taskana-core/src/test/java/acceptance/task/QueryTasksAccTest.java index 718507ea7..a095a7564 100644 --- a/lib/taskana-core/src/test/java/acceptance/task/QueryTasksAccTest.java +++ b/lib/taskana-core/src/test/java/acceptance/task/QueryTasksAccTest.java @@ -30,7 +30,6 @@ import pro.taskana.exceptions.AttachmentPersistenceException; import pro.taskana.exceptions.ClassificationNotFoundException; import pro.taskana.exceptions.ConcurrencyException; import pro.taskana.exceptions.InvalidArgumentException; -import pro.taskana.exceptions.InvalidWorkbasketException; import pro.taskana.exceptions.NotAuthorizedException; import pro.taskana.exceptions.TaskAlreadyExistException; import pro.taskana.exceptions.TaskNotFoundException; @@ -171,8 +170,7 @@ public class QueryTasksAccTest extends AbstractAccTest { @Test public void testQueryForAttachmentInSummary() throws NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException, - TaskNotFoundException, WorkbasketNotFoundException, ConcurrencyException, InvalidWorkbasketException, - AttachmentPersistenceException { + TaskNotFoundException, ConcurrencyException, AttachmentPersistenceException { TaskService taskService = taskanaEngine.getTaskService(); Attachment attachment = createAttachment("DOCTYPE_DEFAULT", // prio 99, SL P2000D diff --git a/lib/taskana-core/src/test/java/acceptance/task/QueryTasksWithPaginationAccTest.java b/lib/taskana-core/src/test/java/acceptance/task/QueryTasksWithPaginationAccTest.java index 140902f9a..c7acdd24f 100644 --- a/lib/taskana-core/src/test/java/acceptance/task/QueryTasksWithPaginationAccTest.java +++ b/lib/taskana-core/src/test/java/acceptance/task/QueryTasksWithPaginationAccTest.java @@ -3,7 +3,6 @@ package acceptance.task; import static org.hamcrest.core.IsEqual.equalTo; import static org.junit.Assert.assertThat; -import java.sql.SQLException; import java.util.List; import org.junit.Ignore; @@ -14,8 +13,6 @@ import acceptance.AbstractAccTest; import pro.taskana.KeyDomain; import pro.taskana.TaskService; import pro.taskana.TaskSummary; -import pro.taskana.exceptions.InvalidArgumentException; -import pro.taskana.exceptions.NotAuthorizedException; import pro.taskana.exceptions.TaskanaRuntimeException; import pro.taskana.security.JAASRunner; 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.
* Using DB2 should throw a unchecked RuntimeException for a offset which is out of bounds. - * - * @throws SQLException - * @throws NotAuthorizedException - * @throws InvalidArgumentException */ @Ignore @WithAccessId( userName = "teamlead_1", groupNames = {"group_1"}) @Test(expected = TaskanaRuntimeException.class) - public void testPaginationThrowingExceptionWhenPageOutOfBounds() - throws SQLException, NotAuthorizedException, InvalidArgumentException { + public void testPaginationThrowingExceptionWhenPageOutOfBounds() { TaskService taskService = taskanaEngine.getTaskService(); // entrypoint set outside result amount diff --git a/lib/taskana-core/src/test/java/acceptance/task/TransferTaskAccTest.java b/lib/taskana-core/src/test/java/acceptance/task/TransferTaskAccTest.java index 4207a83cb..82341f4b0 100644 --- a/lib/taskana-core/src/test/java/acceptance/task/TransferTaskAccTest.java +++ b/lib/taskana-core/src/test/java/acceptance/task/TransferTaskAccTest.java @@ -27,7 +27,6 @@ import pro.taskana.Workbasket; import pro.taskana.exceptions.InvalidArgumentException; import pro.taskana.exceptions.InvalidOwnerException; import pro.taskana.exceptions.InvalidStateException; -import pro.taskana.exceptions.InvalidWorkbasketException; import pro.taskana.exceptions.NotAuthorizedException; import pro.taskana.exceptions.TaskNotFoundException; import pro.taskana.exceptions.TaskanaException; @@ -50,8 +49,8 @@ public class TransferTaskAccTest extends AbstractAccTest { groupNames = {"group_1"}) @Test public void testTransferTaskToWorkbasketId() - throws NotAuthorizedException, WorkbasketNotFoundException, InvalidWorkbasketException, TaskNotFoundException, - InvalidStateException, InvalidOwnerException { + throws NotAuthorizedException, WorkbasketNotFoundException, TaskNotFoundException, InvalidStateException, + InvalidOwnerException { TaskService taskService = taskanaEngine.getTaskService(); Task task = taskService.getTask("TKI:000000000000000000000000000000000003"); taskService.claim(task.getId()); @@ -71,8 +70,8 @@ public class TransferTaskAccTest extends AbstractAccTest { groupNames = {"group_1"}) @Test public void testTransferTaskToWorkbasketKeyDomain() - throws NotAuthorizedException, WorkbasketNotFoundException, InvalidWorkbasketException, TaskNotFoundException, - InvalidStateException, InvalidOwnerException { + throws NotAuthorizedException, WorkbasketNotFoundException, TaskNotFoundException, InvalidStateException, + InvalidOwnerException { TaskService taskService = taskanaEngine.getTaskService(); Task task = taskService.getTask("TKI:000000000000000000000000000000000003"); taskService.claim(task.getId()); @@ -92,8 +91,7 @@ public class TransferTaskAccTest extends AbstractAccTest { groupNames = {"group_1"}) @Test public void testDomainChangingWhenTransferTask() - throws NotAuthorizedException, WorkbasketNotFoundException, InvalidWorkbasketException, TaskNotFoundException, - InvalidStateException { + throws NotAuthorizedException, WorkbasketNotFoundException, TaskNotFoundException, InvalidStateException { TaskService taskService = taskanaEngine.getTaskService(); Task task = taskService.getTask("TKI:000000000000000000000000000000000000"); String domain1 = task.getDomain(); @@ -109,8 +107,7 @@ public class TransferTaskAccTest extends AbstractAccTest { groupNames = {"group_1"}) @Test(expected = NotAuthorizedException.class) public void testThrowsExceptionIfTransferWithNoTransferAuthorization() - throws NotAuthorizedException, WorkbasketNotFoundException, InvalidWorkbasketException, TaskNotFoundException, - InvalidStateException { + throws NotAuthorizedException, WorkbasketNotFoundException, TaskNotFoundException, InvalidStateException { TaskService taskService = taskanaEngine.getTaskService(); Task task = taskService.getTask("TKI:000000000000000000000000000000000001"); @@ -122,8 +119,7 @@ public class TransferTaskAccTest extends AbstractAccTest { groupNames = {"group_1"}) @Test(expected = InvalidStateException.class) public void testThrowsExceptionIfTaskIsAlreadyCompleted() - throws NotAuthorizedException, WorkbasketNotFoundException, InvalidWorkbasketException, TaskNotFoundException, - InvalidStateException { + throws NotAuthorizedException, WorkbasketNotFoundException, TaskNotFoundException, InvalidStateException { TaskService taskService = taskanaEngine.getTaskService(); Task task = taskService.getTask("TKI:100000000000000000000000000000000006"); @@ -135,8 +131,7 @@ public class TransferTaskAccTest extends AbstractAccTest { groupNames = {"group_1"}) @Test(expected = NotAuthorizedException.class) public void testThrowsExceptionIfTransferWithNoAppendAuthorization() - throws NotAuthorizedException, WorkbasketNotFoundException, InvalidWorkbasketException, TaskNotFoundException, - InvalidStateException { + throws NotAuthorizedException, WorkbasketNotFoundException, TaskNotFoundException, InvalidStateException { TaskService taskService = taskanaEngine.getTaskService(); Task task = taskService.getTask("TKI:000000000000000000000000000000000002"); diff --git a/lib/taskana-core/src/test/java/acceptance/task/UpdateTaskAccTest.java b/lib/taskana-core/src/test/java/acceptance/task/UpdateTaskAccTest.java index 307f9cca6..32db1bc31 100644 --- a/lib/taskana-core/src/test/java/acceptance/task/UpdateTaskAccTest.java +++ b/lib/taskana-core/src/test/java/acceptance/task/UpdateTaskAccTest.java @@ -29,7 +29,6 @@ import pro.taskana.exceptions.AttachmentPersistenceException; import pro.taskana.exceptions.ClassificationNotFoundException; import pro.taskana.exceptions.ConcurrencyException; import pro.taskana.exceptions.InvalidArgumentException; -import pro.taskana.exceptions.InvalidWorkbasketException; import pro.taskana.exceptions.NotAuthorizedException; import pro.taskana.exceptions.TaskAlreadyExistException; import pro.taskana.exceptions.TaskNotFoundException; @@ -53,8 +52,7 @@ public class UpdateTaskAccTest extends AbstractAccTest { groupNames = {"group_1"}) @Test public void testUpdatePrimaryObjectReferenceOfTask() - throws NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException, - WorkbasketNotFoundException, InvalidWorkbasketException, TaskNotFoundException, + throws NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException, TaskNotFoundException, ConcurrencyException, AttachmentPersistenceException { TaskService taskService = taskanaEngine.getTaskService(); @@ -83,9 +81,8 @@ public class UpdateTaskAccTest extends AbstractAccTest { groupNames = {"group_1"}) @Test public void testThrowsExceptionIfMandatoryPrimaryObjectReferenceIsNotSetOrIncomplete() - throws NotAuthorizedException, ClassificationNotFoundException, - WorkbasketNotFoundException, InvalidWorkbasketException, TaskNotFoundException, - ConcurrencyException, AttachmentPersistenceException { + throws NotAuthorizedException, ClassificationNotFoundException, TaskNotFoundException, ConcurrencyException, + AttachmentPersistenceException { TaskService taskService = taskanaEngine.getTaskService(); Task task = taskService.getTask("TKI:000000000000000000000000000000000000"); @@ -141,8 +138,7 @@ public class UpdateTaskAccTest extends AbstractAccTest { @Test public void testThrowsExceptionIfTaskHasAlreadyBeenUpdated() throws NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException, - WorkbasketNotFoundException, InvalidWorkbasketException, TaskNotFoundException, - ConcurrencyException, AttachmentPersistenceException { + TaskNotFoundException, ConcurrencyException, AttachmentPersistenceException { TaskService taskService = taskanaEngine.getTaskService(); Task task = taskService.getTask("TKI:000000000000000000000000000000000000"); @@ -167,9 +163,8 @@ public class UpdateTaskAccTest extends AbstractAccTest { groupNames = {"group_1"}) @Test public void testUpdateClassificationOfTask() - throws TaskNotFoundException, WorkbasketNotFoundException, ClassificationNotFoundException, - InvalidArgumentException, ConcurrencyException, InvalidWorkbasketException, NotAuthorizedException, - AttachmentPersistenceException { + throws TaskNotFoundException, ClassificationNotFoundException, InvalidArgumentException, ConcurrencyException, + NotAuthorizedException, AttachmentPersistenceException { TaskService taskService = taskanaEngine.getTaskService(); Task task = taskService.getTask("TKI:000000000000000000000000000000000000"); @@ -215,9 +210,8 @@ public class UpdateTaskAccTest extends AbstractAccTest { groupNames = {"group_1"}) @Test public void testCustomPropertiesOfTask() - throws TaskNotFoundException, WorkbasketNotFoundException, ClassificationNotFoundException, - InvalidArgumentException, ConcurrencyException, InvalidWorkbasketException, NotAuthorizedException, - AttachmentPersistenceException { + throws TaskNotFoundException, ClassificationNotFoundException, InvalidArgumentException, ConcurrencyException, + NotAuthorizedException, AttachmentPersistenceException { TaskService taskService = taskanaEngine.getTaskService(); Task task = taskService.getTask("TKI:000000000000000000000000000000000000"); task.setCustomAttribute("1", "T2100"); @@ -233,8 +227,7 @@ public class UpdateTaskAccTest extends AbstractAccTest { @Test(expected = InvalidArgumentException.class) public void testUpdateOfWorkbasketKeyWhatIsNotAllowed() throws NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException, - WorkbasketNotFoundException, InvalidWorkbasketException, TaskNotFoundException, - ConcurrencyException, AttachmentPersistenceException { + TaskNotFoundException, ConcurrencyException, AttachmentPersistenceException { TaskService taskService = taskanaEngine.getTaskService(); Task task = taskService.getTask("TKI:000000000000000000000000000000000000"); @@ -302,7 +295,7 @@ public class UpdateTaskAccTest extends AbstractAccTest { public void testUpdateCallbackInfoOfSimpleTask() throws WorkbasketNotFoundException, ClassificationNotFoundException, NotAuthorizedException, TaskAlreadyExistException, InvalidArgumentException, TaskNotFoundException, ConcurrencyException, - InvalidWorkbasketException, AttachmentPersistenceException { + AttachmentPersistenceException { TaskService taskService = taskanaEngine.getTaskService(); Task newTask = taskService.newTask("USER_1_1", "DOMAIN_A"); diff --git a/lib/taskana-core/src/test/java/acceptance/task/UpdateTaskAttachmentsAccTest.java b/lib/taskana-core/src/test/java/acceptance/task/UpdateTaskAttachmentsAccTest.java index 547eb8db4..cf99c6fe5 100644 --- a/lib/taskana-core/src/test/java/acceptance/task/UpdateTaskAttachmentsAccTest.java +++ b/lib/taskana-core/src/test/java/acceptance/task/UpdateTaskAttachmentsAccTest.java @@ -27,7 +27,6 @@ import pro.taskana.exceptions.AttachmentPersistenceException; import pro.taskana.exceptions.ClassificationNotFoundException; import pro.taskana.exceptions.ConcurrencyException; import pro.taskana.exceptions.InvalidArgumentException; -import pro.taskana.exceptions.InvalidWorkbasketException; import pro.taskana.exceptions.NotAuthorizedException; import pro.taskana.exceptions.TaskAlreadyExistException; import pro.taskana.exceptions.TaskNotFoundException; @@ -59,8 +58,7 @@ public class UpdateTaskAttachmentsAccTest extends AbstractAccTest { // the begin of each testcase.... private void setUpMethod() throws TaskNotFoundException, ClassificationNotFoundException, NotAuthorizedException, - WorkbasketNotFoundException, InvalidArgumentException, ConcurrencyException, InvalidWorkbasketException, - AttachmentPersistenceException { + InvalidArgumentException, ConcurrencyException, AttachmentPersistenceException { taskService = taskanaEngine.getTaskService(); task = taskService.getTask("TKI:000000000000000000000000000000000000"); // class T2000, prio 1, SL P1D task.setClassificationKey("T2000"); @@ -79,8 +77,7 @@ public class UpdateTaskAttachmentsAccTest extends AbstractAccTest { @Test public void testAddNewAttachment() throws TaskNotFoundException, ClassificationNotFoundException, NotAuthorizedException, - WorkbasketNotFoundException, InvalidArgumentException, ConcurrencyException, InvalidWorkbasketException, - AttachmentPersistenceException { + InvalidArgumentException, ConcurrencyException, AttachmentPersistenceException { setUpMethod(); int attachmentCount = task.getAttachments().size(); assertTrue(task.getPriority() == 1); @@ -101,8 +98,8 @@ public class UpdateTaskAttachmentsAccTest extends AbstractAccTest { groupNames = {"group_1"}) @Test(expected = AttachmentPersistenceException.class) public void testAddNewAttachmentTwiceWithoutTaskanaMethodWillThrowAttachmentPersistenceException() - throws TaskNotFoundException, WorkbasketNotFoundException, ClassificationNotFoundException, - InvalidArgumentException, ConcurrencyException, InvalidWorkbasketException, NotAuthorizedException, + throws TaskNotFoundException, ClassificationNotFoundException, InvalidArgumentException, ConcurrencyException, + NotAuthorizedException, AttachmentPersistenceException { setUpMethod(); int attachmentCount = 0; @@ -125,8 +122,7 @@ public class UpdateTaskAttachmentsAccTest extends AbstractAccTest { @Test public void testAddExistingAttachmentAgainWillUpdateWhenNotEqual() throws TaskNotFoundException, ClassificationNotFoundException, NotAuthorizedException, - WorkbasketNotFoundException, InvalidArgumentException, ConcurrencyException, InvalidWorkbasketException, - AttachmentPersistenceException { + InvalidArgumentException, ConcurrencyException, AttachmentPersistenceException { setUpMethod(); // Add attachment before task = taskService.getTask(task.getId()); @@ -160,8 +156,7 @@ public class UpdateTaskAttachmentsAccTest extends AbstractAccTest { @Test public void testAddExistingAttachmentAgainWillDoNothingWhenEqual() throws TaskNotFoundException, ClassificationNotFoundException, NotAuthorizedException, - WorkbasketNotFoundException, InvalidArgumentException, ConcurrencyException, InvalidWorkbasketException, - AttachmentPersistenceException { + InvalidArgumentException, ConcurrencyException, AttachmentPersistenceException { setUpMethod(); // Add Attachment before int attachmentCount = task.getAttachments().size(); @@ -186,9 +181,8 @@ public class UpdateTaskAttachmentsAccTest extends AbstractAccTest { groupNames = {"group_1"}) @Test public void testAddAttachmentAsNullValueWillBeIgnored() - throws TaskNotFoundException, WorkbasketNotFoundException, ClassificationNotFoundException, - InvalidArgumentException, ConcurrencyException, InvalidWorkbasketException, NotAuthorizedException, - AttachmentPersistenceException { + throws TaskNotFoundException, ClassificationNotFoundException, InvalidArgumentException, ConcurrencyException, + NotAuthorizedException, AttachmentPersistenceException { setUpMethod(); // Try to add a single NULL-Element int attachmentCount = task.getAttachments().size(); @@ -223,9 +217,8 @@ public class UpdateTaskAttachmentsAccTest extends AbstractAccTest { groupNames = {"group_1"}) @Test public void testRemoveAttachment() - throws TaskNotFoundException, WorkbasketNotFoundException, ClassificationNotFoundException, - InvalidArgumentException, ConcurrencyException, InvalidWorkbasketException, NotAuthorizedException, - AttachmentPersistenceException { + throws TaskNotFoundException, ClassificationNotFoundException, InvalidArgumentException, ConcurrencyException, + NotAuthorizedException, AttachmentPersistenceException { setUpMethod(); task.addAttachment(attachment); task = taskService.updateTask(task); @@ -247,9 +240,8 @@ public class UpdateTaskAttachmentsAccTest extends AbstractAccTest { groupNames = {"group_1"}) @Test public void testRemoveAttachmentWithNullAndNotAddedId() - throws TaskNotFoundException, WorkbasketNotFoundException, ClassificationNotFoundException, - InvalidArgumentException, ConcurrencyException, InvalidWorkbasketException, NotAuthorizedException, - AttachmentPersistenceException { + throws TaskNotFoundException, ClassificationNotFoundException, InvalidArgumentException, ConcurrencyException, + NotAuthorizedException, AttachmentPersistenceException { setUpMethod(); task.addAttachment(attachment); task = taskService.updateTask(task); @@ -273,9 +265,8 @@ public class UpdateTaskAttachmentsAccTest extends AbstractAccTest { groupNames = {"group_1"}) @Test public void testUpdateAttachment() - throws TaskNotFoundException, WorkbasketNotFoundException, ClassificationNotFoundException, - InvalidArgumentException, ConcurrencyException, InvalidWorkbasketException, NotAuthorizedException, - AttachmentPersistenceException { + throws TaskNotFoundException, ClassificationNotFoundException, InvalidArgumentException, ConcurrencyException, + NotAuthorizedException, AttachmentPersistenceException { setUpMethod(); ((TaskImpl) task).setAttachments(new ArrayList<>()); task = taskService.updateTask(task); @@ -310,8 +301,7 @@ public class UpdateTaskAttachmentsAccTest extends AbstractAccTest { @Test public void modifyExistingAttachment() throws TaskNotFoundException, ClassificationNotFoundException, NotAuthorizedException, - WorkbasketNotFoundException, InvalidArgumentException, ConcurrencyException, InvalidWorkbasketException, - AttachmentPersistenceException { + InvalidArgumentException, ConcurrencyException, AttachmentPersistenceException { setUpMethod(); // setup test assertThat(task.getAttachments().size(), equalTo(0)); @@ -394,8 +384,7 @@ public class UpdateTaskAttachmentsAccTest extends AbstractAccTest { @Test public void replaceExistingAttachments() throws TaskNotFoundException, ClassificationNotFoundException, NotAuthorizedException, - WorkbasketNotFoundException, InvalidArgumentException, ConcurrencyException, InvalidWorkbasketException, - AttachmentPersistenceException { + InvalidArgumentException, ConcurrencyException, AttachmentPersistenceException { setUpMethod(); // setup test assertThat(task.getAttachments().size(), equalTo(0)); @@ -441,8 +430,8 @@ public class UpdateTaskAttachmentsAccTest extends AbstractAccTest { @Test public void testPrioDurationOfTaskFromAttachmentsAtUpdate() throws NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException, - WorkbasketNotFoundException, TaskAlreadyExistException, InvalidWorkbasketException, TaskNotFoundException, - ConcurrencyException, AttachmentPersistenceException { + WorkbasketNotFoundException, TaskAlreadyExistException, TaskNotFoundException, ConcurrencyException, + AttachmentPersistenceException { setUpMethod(); TaskService taskService = taskanaEngine.getTaskService(); @@ -489,8 +478,7 @@ public class UpdateTaskAttachmentsAccTest extends AbstractAccTest { @Test public void testAddCustomAttributeToAttachment() throws TaskNotFoundException, ClassificationNotFoundException, NotAuthorizedException, - WorkbasketNotFoundException, InvalidArgumentException, ConcurrencyException, InvalidWorkbasketException, - AttachmentPersistenceException { + InvalidArgumentException, ConcurrencyException, AttachmentPersistenceException { TaskService taskService = taskanaEngine.getTaskService(); task = taskService.getTask("TKI:000000000000000000000000000000000000"); // class T2000, prio 1, SL P1D diff --git a/lib/taskana-core/src/test/java/acceptance/workbasket/CreateWorkbasketAccTest.java b/lib/taskana-core/src/test/java/acceptance/workbasket/CreateWorkbasketAccTest.java index d1d121b7a..7de3436fc 100644 --- a/lib/taskana-core/src/test/java/acceptance/workbasket/CreateWorkbasketAccTest.java +++ b/lib/taskana-core/src/test/java/acceptance/workbasket/CreateWorkbasketAccTest.java @@ -150,8 +150,8 @@ public class CreateWorkbasketAccTest extends AbstractAccTest { groupNames = {"businessadmin"}) @Test(expected = WorkbasketAlreadyExistException.class) public void testThrowsExceptionIfWorkbasketWithCaseInsensitiveSameKeyDomainIsCreated() - throws NotAuthorizedException, InvalidArgumentException, WorkbasketNotFoundException, - InvalidWorkbasketException, WorkbasketAlreadyExistException, DomainNotFoundException { + throws NotAuthorizedException, InvalidWorkbasketException, WorkbasketAlreadyExistException, + DomainNotFoundException { WorkbasketService workbasketService = taskanaEngine.getWorkbasketService(); Workbasket workbasket = workbasketService.newWorkbasket("X123456", "DOMAIN_A"); diff --git a/lib/taskana-core/src/test/java/acceptance/workbasket/QueryWorkbasketsWithPaginationAccTest.java b/lib/taskana-core/src/test/java/acceptance/workbasket/QueryWorkbasketsWithPaginationAccTest.java index ad9102035..dfbadde35 100644 --- a/lib/taskana-core/src/test/java/acceptance/workbasket/QueryWorkbasketsWithPaginationAccTest.java +++ b/lib/taskana-core/src/test/java/acceptance/workbasket/QueryWorkbasketsWithPaginationAccTest.java @@ -12,7 +12,6 @@ import org.junit.runner.RunWith; import acceptance.AbstractAccTest; import pro.taskana.WorkbasketService; import pro.taskana.WorkbasketSummary; -import pro.taskana.exceptions.NotAuthorizedException; import pro.taskana.exceptions.TaskanaRuntimeException; import pro.taskana.security.JAASRunner; 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.
* Using DB2 should throw a unchecked RuntimeException for a offset which is out of bounds. - * - * @throws NotAuthorizedException */ @Ignore @Test(expected = TaskanaRuntimeException.class) - public void testPaginationThrowingExceptionWhenPageOutOfBounds() - throws NotAuthorizedException { + public void testPaginationThrowingExceptionWhenPageOutOfBounds() { WorkbasketService workbasketService = taskanaEngine.getWorkbasketService(); // entrypoint set outside result amount diff --git a/lib/taskana-core/src/test/java/acceptance/workbasket/UpdateWorkbasketAccTest.java b/lib/taskana-core/src/test/java/acceptance/workbasket/UpdateWorkbasketAccTest.java index 66c2ba35c..e40e44646 100644 --- a/lib/taskana-core/src/test/java/acceptance/workbasket/UpdateWorkbasketAccTest.java +++ b/lib/taskana-core/src/test/java/acceptance/workbasket/UpdateWorkbasketAccTest.java @@ -10,7 +10,6 @@ import acceptance.AbstractAccTest; import pro.taskana.Workbasket; import pro.taskana.WorkbasketService; import pro.taskana.WorkbasketType; -import pro.taskana.exceptions.InvalidWorkbasketException; import pro.taskana.exceptions.NotAuthorizedException; import pro.taskana.exceptions.WorkbasketNotFoundException; import pro.taskana.security.JAASRunner; @@ -31,7 +30,7 @@ public class UpdateWorkbasketAccTest extends AbstractAccTest { groupNames = {"group_1", "businessadmin"}) @Test public void testUpdateWorkbasket() - throws NotAuthorizedException, WorkbasketNotFoundException, InvalidWorkbasketException { + throws NotAuthorizedException, WorkbasketNotFoundException { WorkbasketService workbasketService = taskanaEngine.getWorkbasketService(); Workbasket workbasket = workbasketService.getWorkbasket("GPK_KSC", "DOMAIN_A"); Instant modified = workbasket.getModified(); @@ -63,7 +62,7 @@ public class UpdateWorkbasketAccTest extends AbstractAccTest { groupNames = {"group_1"}) @Test(expected = NotAuthorizedException.class) public void testCheckAuthorizationToUpdateWorkbasket() - throws NotAuthorizedException, WorkbasketNotFoundException, InvalidWorkbasketException { + throws NotAuthorizedException, WorkbasketNotFoundException { WorkbasketService workbasketService = taskanaEngine.getWorkbasketService(); Workbasket workbasket = workbasketService.getWorkbasket("USER_1_1", "DOMAIN_A"); diff --git a/lib/taskana-core/src/test/java/pro/taskana/impl/TaskServiceImplTest.java b/lib/taskana-core/src/test/java/pro/taskana/impl/TaskServiceImplTest.java index 151d46683..bdbab2f01 100644 --- a/lib/taskana-core/src/test/java/pro/taskana/impl/TaskServiceImplTest.java +++ b/lib/taskana-core/src/test/java/pro/taskana/impl/TaskServiceImplTest.java @@ -1181,7 +1181,7 @@ public class TaskServiceImplTest { @Test public void testUpdateTaskAddingValidAttachment() throws TaskNotFoundException, SystemException, - WorkbasketNotFoundException, ClassificationNotFoundException, InvalidArgumentException, ConcurrencyException, + ClassificationNotFoundException, InvalidArgumentException, ConcurrencyException, NotAuthorizedException, AttachmentPersistenceException { Classification classification = createDummyClassification(); Workbasket wb = createWorkbasket("WB-ID", "WB-Key"); @@ -1209,7 +1209,7 @@ public class TaskServiceImplTest { @Test public void testUpdateTaskAddingValidAttachmentTwice() throws TaskNotFoundException, SystemException, - WorkbasketNotFoundException, ClassificationNotFoundException, InvalidArgumentException, ConcurrencyException, + ClassificationNotFoundException, InvalidArgumentException, ConcurrencyException, NotAuthorizedException, AttachmentPersistenceException { Classification classification = createDummyClassification(); Workbasket wb = createWorkbasket("WB-ID", "WB-Key"); @@ -1239,7 +1239,7 @@ public class TaskServiceImplTest { @Test(expected = AttachmentPersistenceException.class) public void testUpdateTaskAddingAttachmentWithSameIdForcedUsingingListMethod() throws TaskNotFoundException, SystemException, - WorkbasketNotFoundException, ClassificationNotFoundException, InvalidArgumentException, ConcurrencyException, + ClassificationNotFoundException, InvalidArgumentException, ConcurrencyException, NotAuthorizedException, AttachmentPersistenceException { Classification classification = createDummyClassification(); Workbasket wb = createWorkbasket("WB-ID", "WB-Key"); @@ -1272,7 +1272,7 @@ public class TaskServiceImplTest { @Test public void testUpdateTaskUpdateAttachment() throws TaskNotFoundException, SystemException, - WorkbasketNotFoundException, ClassificationNotFoundException, InvalidArgumentException, ConcurrencyException, + ClassificationNotFoundException, InvalidArgumentException, ConcurrencyException, NotAuthorizedException, AttachmentPersistenceException { String channelUpdate = "OTHER CHANNEL"; Classification classification = createDummyClassification(); @@ -1306,7 +1306,7 @@ public class TaskServiceImplTest { @Test public void testUpdateTaskRemovingAttachment() throws TaskNotFoundException, SystemException, - WorkbasketNotFoundException, ClassificationNotFoundException, InvalidArgumentException, ConcurrencyException, + ClassificationNotFoundException, InvalidArgumentException, ConcurrencyException, NotAuthorizedException, AttachmentPersistenceException { Classification classification = createDummyClassification(); Workbasket wb = createWorkbasket("WB-ID", "WB-Key"); diff --git a/lib/taskana-core/src/test/java/pro/taskana/impl/configuration/DBCleaner.java b/lib/taskana-core/src/test/java/pro/taskana/impl/configuration/DBCleaner.java index 2673e030c..42eea3ccb 100644 --- a/lib/taskana-core/src/test/java/pro/taskana/impl/configuration/DBCleaner.java +++ b/lib/taskana-core/src/test/java/pro/taskana/impl/configuration/DBCleaner.java @@ -4,7 +4,6 @@ import java.io.InputStreamReader; import java.io.PrintWriter; import java.io.StringWriter; import java.sql.Connection; -import java.sql.SQLException; import javax.sql.DataSource; @@ -31,9 +30,8 @@ public class DBCleaner { * * @param dropTables * 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()) { ScriptRunner runner = new ScriptRunner(connection); LOGGER.debug(connection.getMetaData().toString()); diff --git a/lib/taskana-core/src/test/java/pro/taskana/impl/integration/ClassificationServiceImplIntAutoCommitTest.java b/lib/taskana-core/src/test/java/pro/taskana/impl/integration/ClassificationServiceImplIntAutoCommitTest.java index 08c640f2c..73f99a0dd 100644 --- a/lib/taskana-core/src/test/java/pro/taskana/impl/integration/ClassificationServiceImplIntAutoCommitTest.java +++ b/lib/taskana-core/src/test/java/pro/taskana/impl/integration/ClassificationServiceImplIntAutoCommitTest.java @@ -55,7 +55,7 @@ public class ClassificationServiceImplIntAutoCommitTest { private TaskanaEngineImpl taskanaEngineImpl; @BeforeClass - public static void resetDb() throws SQLException { + public static void resetDb() { DataSource ds = TaskanaEngineConfigurationTest.getDataSource(); DBCleaner cleaner = new DBCleaner(); cleaner.clearDb(ds, true); diff --git a/lib/taskana-core/src/test/java/pro/taskana/impl/integration/ClassificationServiceImplIntExplicitTest.java b/lib/taskana-core/src/test/java/pro/taskana/impl/integration/ClassificationServiceImplIntExplicitTest.java index 110bfc24b..e75846a1e 100644 --- a/lib/taskana-core/src/test/java/pro/taskana/impl/integration/ClassificationServiceImplIntExplicitTest.java +++ b/lib/taskana-core/src/test/java/pro/taskana/impl/integration/ClassificationServiceImplIntExplicitTest.java @@ -58,7 +58,7 @@ public class ClassificationServiceImplIntExplicitTest { private TaskanaEngineImpl taskanaEngineImpl; @BeforeClass - public static void resetDb() throws SQLException { + public static void resetDb() { DataSource ds = TaskanaEngineConfigurationTest.getDataSource(); DBCleaner cleaner = new DBCleaner(); cleaner.clearDb(ds, true); diff --git a/lib/taskana-core/src/test/java/pro/taskana/impl/integration/TaskServiceImplIntAutocommitTest.java b/lib/taskana-core/src/test/java/pro/taskana/impl/integration/TaskServiceImplIntAutocommitTest.java index df9f561e8..497423e75 100644 --- a/lib/taskana-core/src/test/java/pro/taskana/impl/integration/TaskServiceImplIntAutocommitTest.java +++ b/lib/taskana-core/src/test/java/pro/taskana/impl/integration/TaskServiceImplIntAutocommitTest.java @@ -72,7 +72,7 @@ public class TaskServiceImplIntAutocommitTest { private WorkbasketService workbasketService; @BeforeClass - public static void resetDb() throws SQLException { + public static void resetDb() { DataSource ds = TaskanaEngineConfigurationTest.getDataSource(); DBCleaner cleaner = new DBCleaner(); cleaner.clearDb(ds, true); diff --git a/lib/taskana-core/src/test/java/pro/taskana/impl/integration/TaskServiceImplIntExplicitTest.java b/lib/taskana-core/src/test/java/pro/taskana/impl/integration/TaskServiceImplIntExplicitTest.java index 9bfe24143..871721627 100644 --- a/lib/taskana-core/src/test/java/pro/taskana/impl/integration/TaskServiceImplIntExplicitTest.java +++ b/lib/taskana-core/src/test/java/pro/taskana/impl/integration/TaskServiceImplIntExplicitTest.java @@ -76,7 +76,7 @@ public class TaskServiceImplIntExplicitTest { private WorkbasketService workbasketService; @BeforeClass - public static void resetDb() throws SQLException { + public static void resetDb() { DataSource ds = TaskanaEngineConfigurationTest.getDataSource(); DBCleaner cleaner = new DBCleaner(); cleaner.clearDb(ds, true); diff --git a/lib/taskana-core/src/test/java/pro/taskana/impl/integration/WorkbasketServiceImplIntAutocommitTest.java b/lib/taskana-core/src/test/java/pro/taskana/impl/integration/WorkbasketServiceImplIntAutocommitTest.java index 07dafbf29..ea87cc2ee 100644 --- a/lib/taskana-core/src/test/java/pro/taskana/impl/integration/WorkbasketServiceImplIntAutocommitTest.java +++ b/lib/taskana-core/src/test/java/pro/taskana/impl/integration/WorkbasketServiceImplIntAutocommitTest.java @@ -64,7 +64,7 @@ public class WorkbasketServiceImplIntAutocommitTest { private Instant now; @BeforeClass - public static void resetDb() throws SQLException { + public static void resetDb() { DataSource ds = TaskanaEngineConfigurationTest.getDataSource(); DBCleaner cleaner = new DBCleaner(); cleaner.clearDb(ds, true); diff --git a/lib/taskana-core/src/test/java/pro/taskana/impl/integration/WorkbasketServiceImplIntExplicitTest.java b/lib/taskana-core/src/test/java/pro/taskana/impl/integration/WorkbasketServiceImplIntExplicitTest.java index fb0664603..b772dcc07 100644 --- a/lib/taskana-core/src/test/java/pro/taskana/impl/integration/WorkbasketServiceImplIntExplicitTest.java +++ b/lib/taskana-core/src/test/java/pro/taskana/impl/integration/WorkbasketServiceImplIntExplicitTest.java @@ -54,7 +54,7 @@ public class WorkbasketServiceImplIntExplicitTest { private WorkbasketService workBasketService; @BeforeClass - public static void resetDb() throws SQLException { + public static void resetDb() { DataSource ds = TaskanaEngineConfigurationTest.getDataSource(); DBCleaner cleaner = new DBCleaner(); cleaner.clearDb(ds, true); diff --git a/rest/taskana-rest-spring-example/src/main/java/pro/taskana/rest/security/SampleLoginModule.java b/rest/taskana-rest-spring-example/src/main/java/pro/taskana/rest/security/SampleLoginModule.java index ada436e6f..b86305d77 100644 --- a/rest/taskana-rest-spring-example/src/main/java/pro/taskana/rest/security/SampleLoginModule.java +++ b/rest/taskana-rest-spring-example/src/main/java/pro/taskana/rest/security/SampleLoginModule.java @@ -7,10 +7,10 @@ import javax.security.auth.callback.Callback; import javax.security.auth.callback.CallbackHandler; import javax.security.auth.callback.NameCallback; import javax.security.auth.callback.PasswordCallback; -import javax.security.auth.login.LoginException; import javax.security.auth.spi.LoginModule; import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter; + import pro.taskana.security.GroupPrincipal; import pro.taskana.security.UserPrincipal; @@ -25,14 +25,13 @@ public class SampleLoginModule extends UsernamePasswordAuthenticationFilter impl private Subject subject; - @Override - public boolean abort() throws LoginException { + public boolean abort() { return true; } @Override - public boolean commit() throws LoginException { + public boolean commit() { addUserPrincipalToSubject(); addGroupSubjectsDerivedFromUsername(); return true; @@ -83,12 +82,12 @@ public class SampleLoginModule extends UsernamePasswordAuthenticationFilter impl } @Override - public boolean login() throws LoginException { + public boolean login() { return nameCallback.getName().equals(new String(passwordCallback.getPassword())); } @Override - public boolean logout() throws LoginException { + public boolean logout() { return true; } diff --git a/rest/taskana-rest-spring/src/main/java/pro/taskana/rest/TaskController.java b/rest/taskana-rest-spring/src/main/java/pro/taskana/rest/TaskController.java index 2b37407e4..76fb03206 100644 --- a/rest/taskana-rest-spring/src/main/java/pro/taskana/rest/TaskController.java +++ b/rest/taskana-rest-spring/src/main/java/pro/taskana/rest/TaskController.java @@ -37,7 +37,6 @@ import pro.taskana.exceptions.ConcurrencyException; import pro.taskana.exceptions.InvalidArgumentException; import pro.taskana.exceptions.InvalidOwnerException; import pro.taskana.exceptions.InvalidStateException; -import pro.taskana.exceptions.InvalidWorkbasketException; import pro.taskana.exceptions.NotAuthorizedException; import pro.taskana.exceptions.TaskAlreadyExistException; import pro.taskana.exceptions.TaskNotFoundException; @@ -181,8 +180,7 @@ public class TaskController extends AbstractPagingController { @RequestMapping(path = "/{taskId}/transfer/{workbasketId}") @Transactional(rollbackFor = Exception.class) public ResponseEntity transferTask(@PathVariable String taskId, @PathVariable String workbasketId) - throws TaskNotFoundException, WorkbasketNotFoundException, NotAuthorizedException, InvalidWorkbasketException, - InvalidStateException { + throws TaskNotFoundException, WorkbasketNotFoundException, NotAuthorizedException, InvalidStateException { Task updatedTask = taskService.transfer(taskId, workbasketId); ResponseEntity result = new ResponseEntity<>(taskResourceAssembler.toResource(updatedTask), HttpStatus.OK); @@ -193,8 +191,8 @@ public class TaskController extends AbstractPagingController { @Transactional(rollbackFor = Exception.class) public ResponseEntity updateTask( @PathVariable(value = "taskId") String taskId, - @RequestBody TaskResource taskResource) throws TaskNotFoundException, WorkbasketNotFoundException, - ClassificationNotFoundException, InvalidArgumentException, ConcurrencyException, InvalidWorkbasketException, + @RequestBody TaskResource taskResource) + throws TaskNotFoundException, ClassificationNotFoundException, InvalidArgumentException, ConcurrencyException, NotAuthorizedException, AttachmentPersistenceException { ResponseEntity result; if (taskId.equals(taskResource.getTaskId())) {