TSK-512: Improve general exception handling

- Add root cause to taskana exceptions
- Either throw an exception or log the error
- Remove unnecessary exceptions from method signatures
This commit is contained in:
Konstantin Kläger 2018-06-06 17:00:22 +02:00 committed by Holger Hagen
parent 63c3b7ee53
commit 3230e35c2c
83 changed files with 1684 additions and 1961 deletions

View File

@ -10,7 +10,6 @@ import pro.taskana.exceptions.ClassificationNotFoundException;
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;
@ -25,8 +24,8 @@ public class ExampleBootstrap {
@PostConstruct
public void init(@Observes @Initialized(ApplicationScoped.class) Object init)
throws TaskNotFoundException, NotAuthorizedException, WorkbasketNotFoundException,
ClassificationNotFoundException, InvalidStateException, InvalidOwnerException, InvalidWorkbasketException,
TaskAlreadyExistException, InvalidArgumentException {
ClassificationNotFoundException, InvalidStateException, InvalidOwnerException, TaskAlreadyExistException,
InvalidArgumentException {
System.out.println("---------------------------> Start App");
Task task = taskanaEjb.getTaskService().newTask(null);
ObjectReference objRef = new ObjectReference();

View File

@ -1,8 +1,9 @@
package pro.taskana;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import pro.taskana.configuration.TaskanaEngineConfiguration;
import java.io.IOException;
import java.io.InputStream;
import java.sql.SQLException;
import java.util.Properties;
import javax.annotation.PostConstruct;
import javax.enterprise.context.ApplicationScoped;
@ -12,10 +13,11 @@ import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.sql.DataSource;
import java.io.IOException;
import java.io.InputStream;
import java.sql.SQLException;
import java.util.Properties;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import pro.taskana.configuration.TaskanaEngineConfiguration;
@ApplicationScoped
public class TaskanaProducers {
@ -50,7 +52,7 @@ public class TaskanaProducers {
@ApplicationScoped
@Produces
public TaskanaEngine generateTaskEngine() throws SQLException {
public TaskanaEngine generateTaskEngine() {
return taskanaEngineConfiguration.buildTaskanaEngine();
}

View File

@ -5,7 +5,6 @@ import javax.inject.Inject;
import pro.taskana.exceptions.ClassificationNotFoundException;
import pro.taskana.exceptions.InvalidArgumentException;
import pro.taskana.exceptions.InvalidWorkbasketException;
import pro.taskana.exceptions.NotAuthorizedException;
import pro.taskana.exceptions.TaskAlreadyExistException;
import pro.taskana.exceptions.WorkbasketNotFoundException;
@ -35,8 +34,7 @@ public class TaskanaEjb {
}
public void triggerRollback() throws NotAuthorizedException, WorkbasketNotFoundException,
ClassificationNotFoundException, TaskAlreadyExistException, InvalidWorkbasketException,
InvalidArgumentException {
ClassificationNotFoundException, TaskAlreadyExistException, InvalidArgumentException {
Task task = taskService.newTask(null);
ObjectReference objRef = new ObjectReference();
objRef.setCompany("aCompany");

View File

@ -5,7 +5,6 @@ import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import javax.naming.NamingException;
import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;
@ -14,7 +13,6 @@ import org.jboss.arquillian.junit.Arquillian;
import org.jboss.shrinkwrap.api.Archive;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.wildfly.swarm.Swarm;
@ -45,12 +43,8 @@ public class TaskanaProducersTest {
return swarm;
}
@Before
public void init() throws SQLException, ClassNotFoundException {
}
@Test
public void testCommit() throws SQLException, ClassNotFoundException, NamingException {
public void testCommit() throws SQLException, ClassNotFoundException {
Client client = ClientBuilder.newClient();
client.target("http://127.0.0.1:8090/rest/test").request().get();
@ -70,7 +64,7 @@ public class TaskanaProducersTest {
}
@Test
public void testRollback() throws SQLException, ClassNotFoundException, NamingException {
public void testRollback() throws SQLException, ClassNotFoundException {
Client client = ClientBuilder.newClient();
client.target("http://127.0.0.1:8090/rest/test").request().post(null);

View File

@ -66,7 +66,7 @@ public class TaskanaRestTest {
@POST
public Response rollbackTask()
throws NotAuthorizedException, WorkbasketNotFoundException, ClassificationNotFoundException,
InvalidWorkbasketException, TaskAlreadyExistException, InvalidArgumentException {
TaskAlreadyExistException, InvalidArgumentException {
taskanaEjb.triggerRollback();
return Response.status(204).build();
}
@ -74,8 +74,7 @@ public class TaskanaRestTest {
@DELETE
@Path("{id}")
public void completeTask(@PathParam("id") String id)
throws TaskNotFoundException, InvalidOwnerException, InvalidStateException, ClassificationNotFoundException,
NotAuthorizedException {
throws TaskNotFoundException, InvalidOwnerException, InvalidStateException, NotAuthorizedException {
logger.info(id);
taskanaEjb.getTaskService().forceCompleteTask(id);
}

View File

@ -173,7 +173,6 @@ public class TaskanaEngineConfiguration {
if (key != null) {
roleMap.put(key, roleMemberSet);
} else {
LOGGER.error("Internal System error when processing role property {}.", propertyName);
throw new SystemException(
"Internal System error when processing role property " + propertyName);
}
@ -203,8 +202,8 @@ public class TaskanaEngineConfiguration {
LOGGER.debug("Role properties were loaded from file {}.", propertiesFile);
}
} catch (IOException e) {
LOGGER.error("caught IOException when processing properties file {}.", propertiesFile);
throw new SystemException("internal System error when processing properties file " + propertiesFile);
throw new SystemException("internal System error when processing properties file " + propertiesFile,
e.getCause());
}
return props;
}

View File

@ -9,7 +9,7 @@ public class AttachmentPersistenceException extends TaskanaException {
private static final long serialVersionUID = 123L;
public AttachmentPersistenceException(String attachmentId) {
super("AttachmentId=" + attachmentId);
public AttachmentPersistenceException(String msg, Throwable cause) {
super(msg, cause);
}
}

View File

@ -9,5 +9,9 @@ public class ClassificationInUseException extends TaskanaException {
super(msg);
}
public ClassificationInUseException(String msg, Throwable cause) {
super(msg, cause);
}
private static final long serialVersionUID = 1L;
}

View File

@ -11,5 +11,9 @@ public class InvalidArgumentException extends TaskanaException {
super(msg);
}
public InvalidArgumentException(String msg, Throwable cause) {
super(msg, cause);
}
private static final long serialVersionUID = 1L;
}

View File

@ -9,6 +9,10 @@ public class NotAuthorizedToQueryWorkbasketException extends TaskanaRuntimeExcep
super(msg);
}
public NotAuthorizedToQueryWorkbasketException(String msg, Throwable cause) {
super(msg, cause);
}
private static final long serialVersionUID = 1L;
}

View File

@ -9,5 +9,9 @@ public class SystemException extends TaskanaRuntimeException {
super(msg);
}
public SystemException(String msg, Throwable cause) {
super(msg, cause);
}
private static final long serialVersionUID = 1L;
}

View File

@ -237,7 +237,8 @@ public class ClassificationServiceImpl implements ClassificationService {
try {
Duration.parse(classification.getServiceLevel());
} catch (Exception e) {
throw new InvalidArgumentException("Invalid service level. Please use the format defined by ISO 8601");
throw new InvalidArgumentException("Invalid service level. Please use the format defined by ISO 8601",
e.getCause());
}
}
@ -278,7 +279,6 @@ public class ClassificationServiceImpl implements ClassificationService {
taskanaEngine.openConnection();
result = classificationMapper.findById(id);
if (result == null) {
LOGGER.error("Classification for id {} was not found. Throwing ClassificationNotFoundException", id);
throw new ClassificationNotFoundException(id, "Classification for id " + id + " was not found");
}
return result;
@ -303,9 +303,6 @@ public class ClassificationServiceImpl implements ClassificationService {
if (result == null) {
result = classificationMapper.findByKeyAndDomain(key, "");
if (result == null) {
LOGGER.error(
"Classification for key {} and domain {} was not found. Throwing ClassificationNotFoundException",
key, domain);
throw new ClassificationNotFoundException(key, domain,
"Classification for key " + key + " was not found");
}
@ -400,7 +397,8 @@ public class ClassificationServiceImpl implements ClassificationService {
} catch (PersistenceException e) {
if (isReferentialIntegrityConstraintViolation(e)) {
throw new ClassificationInUseException("The classification " + classificationId
+ " is in use and cannot be deleted. There are either tasks or attachments associated with the classification.");
+ " is in use and cannot be deleted. There are either tasks or attachments associated with the classification.",
e.getCause());
}
}
} finally {

View File

@ -332,7 +332,8 @@ public class TaskImpl implements Task {
num = Integer.parseInt(number);
} catch (NumberFormatException e) {
throw new InvalidArgumentException(
"Argument '" + number + "' to getCustomAttribute cannot be converted to a number between 1 and 16");
"Argument '" + number + "' to getCustomAttribute cannot be converted to a number between 1 and 16",
e.getCause());
}
switch (num) {
@ -382,7 +383,8 @@ public class TaskImpl implements Task {
num = Integer.parseInt(number);
} catch (NumberFormatException e) {
throw new InvalidArgumentException(
"Argument '" + number + "' to getCustomAttribute cannot be converted to a number between 1 and 16");
"Argument '" + number + "' to getCustomAttribute cannot be converted to a number between 1 and 16",
e.getCause());
}
switch (num) {

View File

@ -400,7 +400,8 @@ public class TaskQueryImpl implements TaskQuery {
num = Integer.parseInt(number);
} catch (NumberFormatException e) {
throw new InvalidArgumentException(
"Argument '" + number + "' to getCustomAttribute cannot be converted to a number between 1 and 16");
"Argument '" + number + "' to getCustomAttribute cannot be converted to a number between 1 and 16",
e.getCause());
}
switch (num) {
@ -467,7 +468,8 @@ public class TaskQueryImpl implements TaskQuery {
num = Integer.parseInt(number);
} catch (NumberFormatException e) {
throw new InvalidArgumentException(
"Argument '" + number + "' to getCustomAttribute cannot be converted to a number between 1 and 16");
"Argument '" + number + "' to getCustomAttribute cannot be converted to a number between 1 and 16",
e.getCause());
}
switch (num) {
@ -851,7 +853,7 @@ public class TaskQueryImpl implements TaskQuery {
}
}
} catch (NotAuthorizedException e) {
throw new NotAuthorizedToQueryWorkbasketException(e.getMessage());
throw new NotAuthorizedToQueryWorkbasketException(e.getMessage(), e.getCause());
}
}

View File

@ -38,7 +38,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.SystemException;
import pro.taskana.exceptions.TaskAlreadyExistException;
@ -78,8 +77,7 @@ public class TaskServiceImpl implements TaskService {
this.converter = DaysToWorkingDaysConverter
.initialize(Collections.singletonList(new TimeIntervalColumnHeader(0)), Instant.now());
} catch (InvalidArgumentException e) {
LOGGER.error("could not initialize DaysToWorkingDaysConverter. Caught exception " + e);
throw new SystemException("Internal error. Cannot initialize DaysToWorkingDaysConverter");
throw new SystemException("Internal error. Cannot initialize DaysToWorkingDaysConverter", e.getCause());
}
this.taskanaEngine = (TaskanaEngineImpl) taskanaEngine;
this.taskMapper = taskMapper;
@ -363,8 +361,6 @@ public class TaskServiceImpl implements TaskService {
.list();
if (workbaskets.isEmpty()) {
String currentUser = CurrentUserContext.getUserid();
LOGGER.error("The current user {} has no read permission for workbasket {}.", currentUser,
workbasketId);
throw new NotAuthorizedException(
"The current user " + currentUser + " has no read permission for workbasket " + workbasketId);
} else {
@ -388,7 +384,6 @@ public class TaskServiceImpl implements TaskService {
.findFirst()
.orElse(null);
if (classification == null) {
LOGGER.error("Could not find a Classification for task {} ", resultTask);
throw new SystemException(
"Could not find a Classification for task " + resultTask.getId());
}
@ -396,7 +391,6 @@ public class TaskServiceImpl implements TaskService {
resultTask.setClassificationSummary(classification);
return resultTask;
} else {
LOGGER.warn("Method getTaskById() didn't find task with id {}. Throwing TaskNotFoundException", id);
throw new TaskNotFoundException(id, "Task with id " + id + " was not found");
}
} finally {
@ -407,8 +401,7 @@ public class TaskServiceImpl implements TaskService {
@Override
public Task transfer(String taskId, String destinationWorkbasketId)
throws TaskNotFoundException, WorkbasketNotFoundException, NotAuthorizedException, InvalidWorkbasketException,
InvalidStateException {
throws TaskNotFoundException, WorkbasketNotFoundException, NotAuthorizedException, InvalidStateException {
LOGGER.debug("entry to transfer(taskId = {}, destinationWorkbasketId = {})", taskId, destinationWorkbasketId);
TaskImpl task = null;
try {
@ -447,8 +440,7 @@ public class TaskServiceImpl implements TaskService {
@Override
public Task transfer(String taskId, String destinationWorkbasketKey, String domain)
throws TaskNotFoundException, WorkbasketNotFoundException, NotAuthorizedException, InvalidWorkbasketException,
InvalidStateException {
throws TaskNotFoundException, WorkbasketNotFoundException, NotAuthorizedException, InvalidStateException {
LOGGER.debug("entry to transfer(taskId = {}, destinationWorkbasketKey = {}, domain = {})", taskId,
destinationWorkbasketKey, domain);
TaskImpl task = null;
@ -652,8 +644,7 @@ public class TaskServiceImpl implements TaskService {
@Override
public Task updateTask(Task task)
throws InvalidArgumentException, TaskNotFoundException, ConcurrencyException, WorkbasketNotFoundException,
ClassificationNotFoundException, InvalidWorkbasketException, NotAuthorizedException,
AttachmentPersistenceException {
ClassificationNotFoundException, NotAuthorizedException, AttachmentPersistenceException {
String userId = CurrentUserContext.getUserid();
LOGGER.debug("entry to updateTask(task = {}, userId = {})", task, userId);
TaskImpl newTaskImpl = (TaskImpl) task;
@ -778,11 +769,9 @@ public class TaskServiceImpl implements TaskService {
.findFirst()
.orElse(null);
if (aClassification == null) {
LOGGER.error("Didnt find a Classification for task ");
throw new SystemException(
"Did not find a Classification for task (Id=" + task.getTaskId() + ",classification="
+ task.getClassificationSummary().getId()
+ ")");
+ task.getClassificationSummary().getId() + ")");
}
// set the classification on the task object
task.setClassificationSummary(aClassification);
@ -908,7 +897,6 @@ public class TaskServiceImpl implements TaskService {
.findFirst()
.orElse(null);
if (aClassification == null) {
LOGGER.error("Could not find a Classification for attachment {}.", att);
throw new SystemException("Could not find a Classification for attachment " + att);
}
att.setClassificationSummary(aClassification);
@ -930,7 +918,6 @@ public class TaskServiceImpl implements TaskService {
.orElse(null);
if (aClassification == null) {
LOGGER.error("Could not find a Classification for attachment {}.", att);
throw new SystemException("Could not find a Classification for attachment " + att);
}
att.setClassificationSummary(aClassification);
@ -1052,8 +1039,6 @@ public class TaskServiceImpl implements TaskService {
}
if (customFieldsToUpdate == null || customFieldsToUpdate.isEmpty()) {
LOGGER.warn(
"The customFieldsToUpdate argument to updateTasks must not be empty. Throwing InvalidArgumentException.");
throw new InvalidArgumentException("The customFieldsToUpdate argument to updateTasks must not be empty.");
}
validateObjectReference(selectionCriteria, "ObjectReference", "updateTasks call");
@ -1070,7 +1055,6 @@ public class TaskServiceImpl implements TaskService {
for (Map.Entry<String, String> entry : customFieldsToUpdate.entrySet()) {
String key = entry.getKey();
if (!allowedKeys.contains(key)) {
LOGGER.warn("The customFieldsToUpdate argument to updateTasks contains invalid key {}.", key);
throw new InvalidArgumentException(
"The customFieldsToUpdate argument to updateTasks contains invalid key " + key);
} else {
@ -1165,8 +1149,7 @@ public class TaskServiceImpl implements TaskService {
private void standardUpdateActions(TaskImpl oldTaskImpl, TaskImpl newTaskImpl,
PrioDurationHolder prioDurationFromAttachments)
throws InvalidArgumentException, ConcurrencyException, WorkbasketNotFoundException,
ClassificationNotFoundException {
throws InvalidArgumentException, ConcurrencyException, ClassificationNotFoundException {
validateObjectReference(newTaskImpl.getPrimaryObjRef(), "primary ObjectReference", "Task");
if (oldTaskImpl.getModified() != null && !oldTaskImpl.getModified().equals(newTaskImpl.getModified())
|| oldTaskImpl.getClaimed() != null && !oldTaskImpl.getClaimed().equals(newTaskImpl.getClaimed())
@ -1312,10 +1295,10 @@ public class TaskServiceImpl implements TaskService {
newTaskImpl.getId(),
attachmentImpl);
} catch (PersistenceException e) {
LOGGER.error(
"TaskService.updateTask() for TaskId={} can NOT INSERT the current Attachment, because it was added fored multiple times and wasn´t persisted before. ID={}",
newTaskImpl.getId(), attachmentImpl.getId());
throw new AttachmentPersistenceException(attachmentImpl.getId());
throw new AttachmentPersistenceException(
"Cannot insert the Attachement " + attachmentImpl.getId() + " for Task "
+ newTaskImpl.getId() + " because it already exists.",
e.getCause());
}
}
@ -1412,7 +1395,7 @@ public class TaskServiceImpl implements TaskService {
}
BulkOperationResults<String, Exception> classificationChanged(String taskId, String classificationId)
throws TaskNotFoundException, ClassificationNotFoundException {
throws ClassificationNotFoundException {
LOGGER.debug("entry to classificationChanged(taskId = {} , classificationId = {} )", taskId, classificationId);
TaskImpl task = null;
BulkOperationResults<String, Exception> bulkLog = new BulkOperationResults<>();

View File

@ -372,7 +372,8 @@ public class TaskSummaryImpl implements TaskSummary {
num = Integer.parseInt(number);
} catch (NumberFormatException e) {
throw new InvalidArgumentException(
"Argument '" + number + "' to getCustomAttribute cannot be converted to a number between 1 and 16");
"Argument '" + number + "' to getCustomAttribute cannot be converted to a number between 1 and 16",
e.getCause());
}
switch (num) {

View File

@ -254,8 +254,7 @@ public class TaskanaEngineImpl implements TaskanaEngine {
try {
this.sessionManager.commit();
} catch (Exception e) {
LOGGER.error("closeSession(): Tried to Autocommit and caught exception" + e);
throw new AutocommitFailedException(e);
throw new AutocommitFailedException(e.getCause());
}
}
this.sessionManager.close();
@ -344,18 +343,13 @@ public class TaskanaEngineImpl implements TaskanaEngine {
} else if (isPostgreSQL(databaseProductName)) {
configuration.setDatabaseId("postgres");
} else {
LOGGER.error(
"Method createSqlSessionManager() didn't find database with name {}. Throwing UnsupportedDatabaseException",
databaseProductName);
throw new UnsupportedDatabaseException(databaseProductName);
}
} catch (SQLException e) {
LOGGER.error(
"Method createSqlSessionManager() could not open a connection to the database. No databaseId has been set.",
e);
throw new SystemException(
"Method createSqlSessionManager() could not open a connection to the database. No databaseId has been set.");
"Method createSqlSessionManager() could not open a connection to the database. No databaseId has been set.",
e.getCause());
}
// add mappers

View File

@ -67,9 +67,6 @@ public class WorkbasketServiceImpl implements WorkbasketService {
taskanaEngine.openConnection();
result = workbasketMapper.findById(workbasketId);
if (result == null) {
LOGGER.error(
"Method getWorkbasket() didn't find workbasket with ID {}. Throwing WorkbasketNotFoundException",
workbasketId);
throw new WorkbasketNotFoundException(workbasketId,
"Workbasket with id " + workbasketId + " was not found.");
}
@ -92,9 +89,6 @@ public class WorkbasketServiceImpl implements WorkbasketService {
taskanaEngine.openConnection();
result = workbasketMapper.findByKeyAndDomain(workbasketKey, domain);
if (result == null) {
LOGGER.error(
"Method getWorkbasketByKey() didn't find workbasket with key {}. Throwing WorkbasketNotFoundException",
workbasketKey);
throw new WorkbasketNotFoundException(workbasketKey, domain,
"Workbasket with key " + workbasketKey + " and domain " + domain + " was not found.");
}
@ -150,9 +144,6 @@ public class WorkbasketServiceImpl implements WorkbasketService {
Workbasket existingWorkbasket = workbasketMapper.findByKeyAndDomain(newWorkbasket.getKey(),
newWorkbasket.getDomain());
if (existingWorkbasket != null) {
LOGGER.error(
"createWorkbasket failed because Workbasket with key {} and domain {} already exists. Throwing WorkbasketAlreadyExistsException.",
newWorkbasket.getKey(), newWorkbasket.getDomain());
throw new WorkbasketAlreadyExistException(existingWorkbasket);
}
@ -172,7 +163,7 @@ public class WorkbasketServiceImpl implements WorkbasketService {
@Override
public Workbasket updateWorkbasket(Workbasket workbasketToUpdate)
throws NotAuthorizedException, WorkbasketNotFoundException, InvalidWorkbasketException {
throws NotAuthorizedException {
LOGGER.debug("entry to updateWorkbasket(workbasket)", workbasketToUpdate);
taskanaEngine.checkRoleMembership(TaskanaRole.BUSINESS_ADMIN, TaskanaRole.ADMIN);
@ -208,8 +199,6 @@ public class WorkbasketServiceImpl implements WorkbasketService {
accessItem.setId(IdGenerator.generateWithPrefix(ID_PREFIX_WORKBASKET_AUTHORIZATION));
if (workbasketAccessItem.getId() == null || workbasketAccessItem.getAccessId() == null
|| workbasketAccessItem.getWorkbasketId() == null) {
LOGGER.error(
"createWorkbasketAccessItem failed because id, accessId or workbasketId is null. Throwing InvalidArgumentException.");
throw new InvalidArgumentException(
"Checking the preconditions of the current WorkbasketAccessItem failed. WorkbasketAccessItem="
+ workbasketAccessItem.toString());
@ -243,16 +232,10 @@ public class WorkbasketServiceImpl implements WorkbasketService {
for (WorkbasketAccessItem workbasketAccessItem : wbAccessItems) {
WorkbasketAccessItemImpl wbAccessItemImpl = (WorkbasketAccessItemImpl) workbasketAccessItem;
if (wbAccessItemImpl.getWorkbasketId() == null) {
LOGGER.error(
"setWorkbasketAccessItem failed because WorkbasketAccessItem {} has a null workbasketId. Throwing InvalidArgumentException.",
workbasketAccessItem);
throw new InvalidArgumentException(
"Checking the preconditions of the current WorkbasketAccessItem failed - WBID is NULL. WorkbasketAccessItem="
+ workbasketAccessItem.toString());
} else if (!wbAccessItemImpl.getWorkbasketId().equals(workbasketId)) {
LOGGER.error(
"setWorkbasketAccessItem failed because WorkbasketAccessItem {} does not refer to workbasket {}. Throwing InvalidArgumentException.",
workbasketAccessItem, workbasketId);
throw new InvalidArgumentException(
"Checking the preconditions of the current WorkbasketAccessItem failed - the WBID does not match. Target-WBID='"
+ workbasketId + "' WorkbasketAccessItem="
@ -311,8 +294,6 @@ public class WorkbasketServiceImpl implements WorkbasketService {
taskanaEngine.openConnection();
if (workbasketMapper.findById(workbasketId) == null) {
LOGGER.error("Throwing WorkbasketNotFoundException because workbasket with id {} does not exist",
workbasketId);
throw new WorkbasketNotFoundException(workbasketId,
"Workbasket with id " + workbasketId + " was not found.");
}
@ -326,9 +307,6 @@ public class WorkbasketServiceImpl implements WorkbasketService {
WorkbasketAccessItem wbAcc = workbasketAccessMapper.findByWorkbasketAndAccessId(workbasketId,
accessIds);
if (wbAcc == null) {
LOGGER.error(
"AccessIds {} do not have permission {} on workbasket with id {}. Throwing NotAuthorizedException.",
LoggerUtils.listToString(accessIds), Arrays.toString(requestedPermissions), workbasketId);
throw new NotAuthorizedException(
"Not authorized. Permission '" + Arrays.toString(requestedPermissions) + "' on workbasket '"
+ workbasketId
@ -340,9 +318,6 @@ public class WorkbasketServiceImpl implements WorkbasketService {
for (WorkbasketPermission perm : requestedPermissions) {
if (!grantedPermissions.contains(perm)) {
isAuthorized = false;
LOGGER.error(
"AccessIds {} do not have permission {} on workbasket with id {}. Throwing NotAuthorizedException.",
LoggerUtils.listToString(accessIds), perm.name(), workbasketId);
throw new NotAuthorizedException(
"Not authorized. Permission '" + perm.name() + "' on workbasket '" + workbasketId
+ "' is needed.");
@ -363,9 +338,6 @@ public class WorkbasketServiceImpl implements WorkbasketService {
taskanaEngine.openConnection();
if (workbasketMapper.findByKeyAndDomain(workbasketKey, domain) == null) {
LOGGER.error(
"Throwing WorkbasketNotFoundException because workbasket with key {} and domain {} does not exist",
workbasketKey, domain);
throw new WorkbasketNotFoundException(workbasketKey, domain,
"Workbasket with key " + workbasketKey + " and domain " + domain + " was not found");
}
@ -377,9 +349,6 @@ public class WorkbasketServiceImpl implements WorkbasketService {
WorkbasketAccessItem wbAcc = workbasketAccessMapper.findByWorkbasketKeyDomainAndAccessId(
workbasketKey, domain, accessIds);
if (wbAcc == null) {
LOGGER.error(
"AccessIds {} do not have permission {} on workbasket with key {} and domain {}. Throwing NotAuthorizedException.",
LoggerUtils.listToString(accessIds), Arrays.toString(requestedPermissions), workbasketKey, domain);
throw new NotAuthorizedException(
"Not authorized. Permission '" + Arrays.toString(requestedPermissions)
+ "' on workbasket with key '"
@ -391,9 +360,6 @@ public class WorkbasketServiceImpl implements WorkbasketService {
for (WorkbasketPermission perm : requestedPermissions) {
if (!grantedPermissions.contains(perm)) {
isAuthorized = false;
LOGGER.error(
"AccessIds {} do not have permission {} on workbasket with key {} and domain {}. Throwing NotAuthorizedException.",
LoggerUtils.listToString(accessIds), perm.name(), workbasketKey, domain);
throw new NotAuthorizedException(
"Not authorized. Permission '" + perm.name() + "' on workbasket with key '" + workbasketKey
+ "' and domain '" + domain + "' is needed.");
@ -746,7 +712,7 @@ public class WorkbasketServiceImpl implements WorkbasketService {
@Override
public void removeDistributionTarget(String sourceWorkbasketId, String targetWorkbasketId)
throws NotAuthorizedException, WorkbasketNotFoundException {
throws NotAuthorizedException {
LOGGER.debug("entry to removeDistributionTarget(sourceWorkbasketId = {}, targetWorkbasketId = {})",
sourceWorkbasketId, targetWorkbasketId);
taskanaEngine.checkRoleMembership(TaskanaRole.BUSINESS_ADMIN, TaskanaRole.ADMIN);

View File

@ -62,7 +62,7 @@ public class MapTypeHandler extends BaseTypeHandler<Map> {
return null;
}
private Map convertToMap(String fieldValue) throws SQLException {
private Map convertToMap(String fieldValue) {
JSONObject jsonObj = new JSONObject(fieldValue);
return jsonObj.toMap();
}

View File

@ -23,7 +23,6 @@ import pro.taskana.TimeInterval;
import pro.taskana.configuration.TaskanaEngineConfiguration;
import pro.taskana.database.TestDataGenerator;
import pro.taskana.exceptions.ClassificationNotFoundException;
import pro.taskana.exceptions.NotAuthorizedException;
import pro.taskana.impl.configuration.DBCleaner;
import pro.taskana.impl.configuration.TaskanaEngineConfigurationTest;
@ -78,7 +77,7 @@ public abstract class AbstractAccTest {
protected Attachment createAttachment(String classificationKey, ObjectReference objRef,
String channel, String receivedDate, Map<String, String> customAttributes)
throws ClassificationNotFoundException, NotAuthorizedException {
throws ClassificationNotFoundException {
Attachment attachment = taskanaEngine.getTaskService().newAttachment();
attachment.setClassificationSummary(

View File

@ -102,7 +102,7 @@ public class CreateClassificationAccTest extends AbstractAccTest {
@Test
public void testCreateClassificationWithInvalidValues()
throws ClassificationAlreadyExistException, NotAuthorizedException, ClassificationNotFoundException,
DomainNotFoundException, InvalidArgumentException {
DomainNotFoundException {
long amountOfClassificationsBefore = classificationService.createClassificationQuery().count();
// Check key NULL

View File

@ -6,8 +6,6 @@ import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import java.sql.SQLException;
import org.junit.Test;
import org.junit.runner.RunWith;
@ -38,7 +36,7 @@ public class DeleteClassificationAccTest extends AbstractAccTest {
groupNames = {"businessadmin"})
@Test
public void testDeleteClassificationInDomain()
throws SQLException, ClassificationNotFoundException, NotAuthorizedException, ClassificationInUseException {
throws ClassificationNotFoundException, NotAuthorizedException, ClassificationInUseException {
classificationService.deleteClassification("L140101", "DOMAIN_A");
Classification classification = classificationService.getClassification("L140101", "DOMAIN_A");
@ -51,7 +49,7 @@ public class DeleteClassificationAccTest extends AbstractAccTest {
groupNames = {"group_1", "group_2"})
@Test(expected = NotAuthorizedException.class)
public void testDeleteClassificationInDomainUserIsNotAuthorized()
throws SQLException, ClassificationNotFoundException, NotAuthorizedException, ClassificationInUseException {
throws ClassificationNotFoundException, NotAuthorizedException, ClassificationInUseException {
classificationService.deleteClassification("L140101", "DOMAIN_A");
fail("NotAuthorizedException should have been thrown");
}
@ -61,7 +59,7 @@ public class DeleteClassificationAccTest extends AbstractAccTest {
groupNames = {"group_1", "businessadmin"})
@Test(expected = ClassificationInUseException.class)
public void testThrowExeptionIfDeleteClassificationWithExistingTasks()
throws SQLException, ClassificationNotFoundException, NotAuthorizedException, ClassificationInUseException {
throws ClassificationNotFoundException, NotAuthorizedException, ClassificationInUseException {
classificationService.deleteClassification("L1050", "DOMAIN_A");
}
@ -70,7 +68,7 @@ public class DeleteClassificationAccTest extends AbstractAccTest {
groupNames = {"group_1", "businessadmin"})
@Test(expected = ClassificationInUseException.class)
public void testThrowExeptionIfDeleteMasterClassificationWithExistingTasks()
throws SQLException, ClassificationNotFoundException, NotAuthorizedException, ClassificationInUseException {
throws ClassificationNotFoundException, NotAuthorizedException, ClassificationInUseException {
classificationService.deleteClassification("L1050", "");
}
@ -79,7 +77,7 @@ public class DeleteClassificationAccTest extends AbstractAccTest {
groupNames = {"businessadmin"})
@Test
public void testDeleteMasterClassification()
throws SQLException, ClassificationNotFoundException, NotAuthorizedException, ClassificationInUseException {
throws ClassificationNotFoundException, NotAuthorizedException, ClassificationInUseException {
classificationService.deleteClassification("L3060", "");
@ -97,7 +95,7 @@ public class DeleteClassificationAccTest extends AbstractAccTest {
groupNames = {"businessadmin"})
@Test(expected = ClassificationInUseException.class)
public void testDeleteMasterClassificationWithExistingAttachment()
throws SQLException, ClassificationNotFoundException, NotAuthorizedException, ClassificationInUseException {
throws ClassificationNotFoundException, NotAuthorizedException, ClassificationInUseException {
classificationService.deleteClassification("L12010", "");
@ -115,7 +113,7 @@ public class DeleteClassificationAccTest extends AbstractAccTest {
groupNames = {"group_1", "businessadmin"})
@Test
public void testThrowExceptionWhenChildClassificationIsInUseAndRollback()
throws ClassificationInUseException, NotAuthorizedException, ClassificationNotFoundException {
throws NotAuthorizedException, ClassificationNotFoundException {
boolean classificationInUse = false;
try {
classificationService.deleteClassification("L11010", "DOMAIN_A");

View File

@ -3,7 +3,6 @@ package acceptance.classification;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import java.sql.SQLException;
import java.util.List;
import java.util.stream.Collectors;
@ -12,9 +11,6 @@ import org.junit.Test;
import acceptance.AbstractAccTest;
import pro.taskana.ClassificationService;
import pro.taskana.ClassificationSummary;
import pro.taskana.exceptions.ClassificationNotFoundException;
import pro.taskana.exceptions.InvalidArgumentException;
import pro.taskana.exceptions.NotAuthorizedException;
/**
* Acceptance test for all "get classification" scenarios.
@ -26,8 +22,7 @@ public class QueryClassificationAccTest extends AbstractAccTest {
}
@Test
public void testQueryClassificationValuesForColumnName()
throws SQLException, ClassificationNotFoundException, NotAuthorizedException, InvalidArgumentException {
public void testQueryClassificationValuesForColumnName() {
ClassificationService classificationService = taskanaEngine.getClassificationService();
List<String> columnValueList = classificationService.createClassificationQuery()
.listValues("NAME", null);
@ -59,8 +54,7 @@ public class QueryClassificationAccTest extends AbstractAccTest {
}
@Test
public void testFindClassificationsByCategoryAndDomain()
throws SQLException, ClassificationNotFoundException, NotAuthorizedException, InvalidArgumentException {
public void testFindClassificationsByCategoryAndDomain() {
ClassificationService classificationService = taskanaEngine.getClassificationService();
List<ClassificationSummary> classificationSummaryList = classificationService.createClassificationQuery()
.categoryIn("MANUAL")
@ -72,8 +66,7 @@ public class QueryClassificationAccTest extends AbstractAccTest {
}
@Test
public void testGetOneClassificationForMultipleDomains()
throws SQLException, ClassificationNotFoundException, NotAuthorizedException, InvalidArgumentException {
public void testGetOneClassificationForMultipleDomains() {
ClassificationService classificationService = taskanaEngine.getClassificationService();
List<ClassificationSummary> classifications = classificationService.createClassificationQuery()
.keyIn("L10000")
@ -85,8 +78,7 @@ public class QueryClassificationAccTest extends AbstractAccTest {
}
@Test
public void testGetClassificationsForTypeAndParent()
throws SQLException, ClassificationNotFoundException, NotAuthorizedException, InvalidArgumentException {
public void testGetClassificationsForTypeAndParent() {
ClassificationService classificationService = taskanaEngine.getClassificationService();
List<ClassificationSummary> classifications = classificationService.createClassificationQuery()
.typeIn("TASK", "DOCUMENT")
@ -110,8 +102,7 @@ public class QueryClassificationAccTest extends AbstractAccTest {
}
@Test
public void testGetClassificationsForKeyAndCategories()
throws SQLException, ClassificationNotFoundException, NotAuthorizedException, InvalidArgumentException {
public void testGetClassificationsForKeyAndCategories() {
ClassificationService classificationService = taskanaEngine.getClassificationService();
List<ClassificationSummary> classifications = classificationService.createClassificationQuery()
.keyIn("T2100", "L10000")
@ -135,8 +126,7 @@ public class QueryClassificationAccTest extends AbstractAccTest {
}
@Test
public void testGetClassificationsWithParentKey()
throws SQLException, ClassificationNotFoundException, NotAuthorizedException, InvalidArgumentException {
public void testGetClassificationsWithParentKey() {
ClassificationService classificationService = taskanaEngine.getClassificationService();
List<ClassificationSummary> classifications = classificationService.createClassificationQuery()
.keyIn("A12", "A13")
@ -159,8 +149,7 @@ public class QueryClassificationAccTest extends AbstractAccTest {
}
@Test
public void testGetClassificationsWithCustom1()
throws SQLException, ClassificationNotFoundException, NotAuthorizedException, InvalidArgumentException {
public void testGetClassificationsWithCustom1() {
ClassificationService classificationService = taskanaEngine.getClassificationService();
List<ClassificationSummary> classifications = classificationService.createClassificationQuery()
.custom1Like("VNR,RVNR,KOLVNR", "VNR")
@ -171,8 +160,7 @@ public class QueryClassificationAccTest extends AbstractAccTest {
}
@Test
public void testGetClassificationsWithCustom1Like()
throws SQLException, ClassificationNotFoundException, NotAuthorizedException, InvalidArgumentException {
public void testGetClassificationsWithCustom1Like() {
ClassificationService classificationService = taskanaEngine.getClassificationService();
List<ClassificationSummary> classifications = classificationService.createClassificationQuery()
.custom1Like("%RVNR%")
@ -184,8 +172,7 @@ public class QueryClassificationAccTest extends AbstractAccTest {
}
@Test
public void testGetClassificationsWithParentAndCustom2()
throws SQLException, ClassificationNotFoundException, NotAuthorizedException, InvalidArgumentException {
public void testGetClassificationsWithParentAndCustom2() {
ClassificationService classificationService = taskanaEngine.getClassificationService();
List<ClassificationSummary> classifications = classificationService.createClassificationQuery()
.parentIdIn("CLI:100000000000000000000000000000000004")
@ -197,8 +184,7 @@ public class QueryClassificationAccTest extends AbstractAccTest {
}
@Test
public void testFindClassificationsByCreatedTimestamp()
throws SQLException, ClassificationNotFoundException, NotAuthorizedException, InvalidArgumentException {
public void testFindClassificationsByCreatedTimestamp() {
ClassificationService classificationService = taskanaEngine.getClassificationService();
List<ClassificationSummary> classificationSummaryList = classificationService.createClassificationQuery()
.domainIn("DOMAIN_A")
@ -210,8 +196,7 @@ public class QueryClassificationAccTest extends AbstractAccTest {
}
@Test
public void testFindClassificationsByPriorityAndValidInDomain()
throws SQLException, ClassificationNotFoundException, NotAuthorizedException, InvalidArgumentException {
public void testFindClassificationsByPriorityAndValidInDomain() {
ClassificationService classificationService = taskanaEngine.getClassificationService();
List<ClassificationSummary> list = classificationService.createClassificationQuery()
.validInDomainEquals(Boolean.TRUE)

View File

@ -27,7 +27,7 @@ public class QueryClassificationWithPaginationAccTest extends AbstractAccTest {
}
@Test
public void testGetFirstPageOfClassificationQueryWithOffset() throws NotAuthorizedException {
public void testGetFirstPageOfClassificationQueryWithOffset() {
ClassificationService classificationService = taskanaEngine.getClassificationService();
List<ClassificationSummary> results = classificationService.createClassificationQuery()
.domainIn("DOMAIN_A")
@ -36,7 +36,7 @@ public class QueryClassificationWithPaginationAccTest extends AbstractAccTest {
}
@Test
public void testGetSecondPageOfClassificationQueryWithOffset() throws NotAuthorizedException {
public void testGetSecondPageOfClassificationQueryWithOffset() {
ClassificationService classificationService = taskanaEngine.getClassificationService();
List<ClassificationSummary> results = classificationService.createClassificationQuery()
.domainIn("DOMAIN_A")
@ -45,7 +45,7 @@ public class QueryClassificationWithPaginationAccTest extends AbstractAccTest {
}
@Test
public void testListOffsetAndLimitOutOfBounds() throws NotAuthorizedException {
public void testListOffsetAndLimitOutOfBounds() {
ClassificationService classificationService = taskanaEngine.getClassificationService();
// both will be 0, working
@ -68,7 +68,7 @@ public class QueryClassificationWithPaginationAccTest extends AbstractAccTest {
}
@Test
public void testPaginationWithPages() throws NotAuthorizedException {
public void testPaginationWithPages() {
ClassificationService classificationService = taskanaEngine.getClassificationService();
// Getting full page
@ -105,7 +105,7 @@ public class QueryClassificationWithPaginationAccTest extends AbstractAccTest {
}
@Test
public void testPaginationNullAndNegativeLimitsIgnoring() throws NotAuthorizedException {
public void testPaginationNullAndNegativeLimitsIgnoring() {
ClassificationService classificationService = taskanaEngine.getClassificationService();
// 0 limit/size = 0 results
@ -153,8 +153,7 @@ public class QueryClassificationWithPaginationAccTest extends AbstractAccTest {
}
@Test
public void testCountOfClassificationsQuery()
throws NotAuthorizedException {
public void testCountOfClassificationsQuery() {
ClassificationService classificationService = taskanaEngine.getClassificationService();
long count = classificationService.createClassificationQuery()
.domainIn("DOMAIN_A")

View File

@ -7,7 +7,6 @@ import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import java.sql.SQLException;
import java.time.Duration;
import java.time.Instant;
import java.util.ArrayList;
@ -50,7 +49,7 @@ public class UpdateClassificationAccTest extends AbstractAccTest {
groupNames = {"businessadmin"})
@Test
public void testUpdateClassification()
throws SQLException, ClassificationNotFoundException, NotAuthorizedException, ConcurrencyException,
throws ClassificationNotFoundException, NotAuthorizedException, ConcurrencyException,
InvalidArgumentException {
String newName = "updated Name";
String newEntryPoint = "updated EntryPoint";
@ -89,7 +88,7 @@ public class UpdateClassificationAccTest extends AbstractAccTest {
@Test(expected = NotAuthorizedException.class)
public void testUpdateClassificationFails()
throws SQLException, ClassificationNotFoundException, NotAuthorizedException, ConcurrencyException,
throws ClassificationNotFoundException, NotAuthorizedException, ConcurrencyException,
InvalidArgumentException {
String newName = "updated Name";
String newEntryPoint = "updated EntryPoint";
@ -188,7 +187,7 @@ public class UpdateClassificationAccTest extends AbstractAccTest {
groupNames = {"admin"})
@Test
public void testUpdateClassificationPrioServiceLevel()
throws SQLException, ClassificationNotFoundException, NotAuthorizedException, ConcurrencyException,
throws ClassificationNotFoundException, NotAuthorizedException, ConcurrencyException,
InterruptedException, TaskNotFoundException, InvalidArgumentException {
String newEntryPoint = "updated EntryPoint";
Instant before = Instant.now();

View File

@ -54,7 +54,7 @@ public class TaskanaRoleConfigAccTest extends TaskanaEngineImpl {
}
@Test
public void testOtherConfigFileSameDelimiter() throws IOException, SQLException {
public void testOtherConfigFileSameDelimiter() throws IOException {
String propertiesFileName = createNewConfigFileWithSameDelimiter("/dummyTestConfig.properties");
try {
getConfiguration().initTaskanaProperties(propertiesFileName, "|");
@ -81,7 +81,7 @@ public class TaskanaRoleConfigAccTest extends TaskanaEngineImpl {
}
@Test
public void testOtherConfigFileDifferentDelimiter() throws IOException, SQLException {
public void testOtherConfigFileDifferentDelimiter() throws IOException {
String delimiter = ";";
String propertiesFileName = createNewConfigFileWithDifferentDelimiter("/dummyTestConfig.properties", delimiter);
try {

View File

@ -3,7 +3,6 @@ package acceptance.objectreference;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import java.sql.SQLException;
import java.util.List;
import org.junit.Test;
@ -11,9 +10,6 @@ import org.junit.Test;
import acceptance.AbstractAccTest;
import pro.taskana.ObjectReference;
import pro.taskana.TaskQuery;
import pro.taskana.exceptions.ClassificationNotFoundException;
import pro.taskana.exceptions.InvalidArgumentException;
import pro.taskana.exceptions.NotAuthorizedException;
/**
* Acceptance test for all "get classification" scenarios.
@ -42,8 +38,7 @@ public class QueryObjectReferenceAccTest extends AbstractAccTest {
}
@Test
public void testFindObjectReferenceByCompany()
throws SQLException, ClassificationNotFoundException, NotAuthorizedException, InvalidArgumentException {
public void testFindObjectReferenceByCompany() {
TaskQuery taskQuery = taskanaEngine.getTaskService().createTaskQuery();
List<ObjectReference> objectReferenceList = taskQuery.createObjectReferenceQuery()
@ -55,8 +50,7 @@ public class QueryObjectReferenceAccTest extends AbstractAccTest {
}
@Test
public void testFindObjectReferenceBySystem()
throws SQLException, ClassificationNotFoundException, NotAuthorizedException, InvalidArgumentException {
public void testFindObjectReferenceBySystem() {
TaskQuery taskQuery = taskanaEngine.getTaskService().createTaskQuery();
List<ObjectReference> objectReferenceList = taskQuery.createObjectReferenceQuery()
@ -69,8 +63,7 @@ public class QueryObjectReferenceAccTest extends AbstractAccTest {
}
@Test
public void testFindObjectReferenceBySystemInstance()
throws SQLException, ClassificationNotFoundException, NotAuthorizedException, InvalidArgumentException {
public void testFindObjectReferenceBySystemInstance() {
TaskQuery taskQuery = taskanaEngine.getTaskService().createTaskQuery();
List<ObjectReference> objectReferenceList = taskQuery.createObjectReferenceQuery()
@ -83,8 +76,7 @@ public class QueryObjectReferenceAccTest extends AbstractAccTest {
}
@Test
public void testFindObjectReferenceByType()
throws SQLException, ClassificationNotFoundException, NotAuthorizedException, InvalidArgumentException {
public void testFindObjectReferenceByType() {
TaskQuery taskQuery = taskanaEngine.getTaskService().createTaskQuery();
List<ObjectReference> objectReferenceList = taskQuery.createObjectReferenceQuery()
@ -96,8 +88,7 @@ public class QueryObjectReferenceAccTest extends AbstractAccTest {
}
@Test
public void testFindObjectReferenceByValue()
throws SQLException, ClassificationNotFoundException, NotAuthorizedException, InvalidArgumentException {
public void testFindObjectReferenceByValue() {
TaskQuery taskQuery = taskanaEngine.getTaskService().createTaskQuery();
List<ObjectReference> objectReferenceList = taskQuery.createObjectReferenceQuery()

View File

@ -41,20 +41,20 @@ public class QueryObjectreferencesWithPaginationAccTest extends AbstractAccTest
}
@Test
public void testGetFirstPageOfObjectRefQueryWithOffset() throws NotAuthorizedException {
public void testGetFirstPageOfObjectRefQueryWithOffset() {
List<ObjectReference> results = objRefQuery.list(0, 5);
assertThat(results.size(), equalTo(3));
}
@Test
public void testGetSecondPageOfObjectRefQueryWithOffset() throws NotAuthorizedException {
public void testGetSecondPageOfObjectRefQueryWithOffset() {
List<ObjectReference> results = objRefQuery.list(2, 5);
assertThat(results.size(), equalTo(1));
}
@Test
public void testListOffsetAndLimitOutOfBounds() throws NotAuthorizedException {
public void testListOffsetAndLimitOutOfBounds() {
// both will be 0, working
List<ObjectReference> results = objRefQuery.list(-1, -3);
assertThat(results.size(), equalTo(0));
@ -69,7 +69,7 @@ public class QueryObjectreferencesWithPaginationAccTest extends AbstractAccTest
}
@Test
public void testPaginationWithPages() throws NotAuthorizedException {
public void testPaginationWithPages() {
// Getting full page
int pageNumber = 1;
int pageSize = 10;
@ -96,7 +96,7 @@ public class QueryObjectreferencesWithPaginationAccTest extends AbstractAccTest
}
@Test
public void testPaginationNullAndNegativeLimitsIgnoring() throws NotAuthorizedException {
public void testPaginationNullAndNegativeLimitsIgnoring() {
// 0 limit/size = 0 results
int pageNumber = 2;
int pageSize = 0;
@ -132,8 +132,7 @@ public class QueryObjectreferencesWithPaginationAccTest extends AbstractAccTest
}
@Test
public void testCountOfClassificationsQuery()
throws NotAuthorizedException {
public void testCountOfClassificationsQuery() {
long count = objRefQuery.count();
assertThat(count, equalTo(3L));
}

View File

@ -3,7 +3,6 @@ package acceptance.security;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import java.sql.SQLException;
import java.util.List;
import org.junit.Test;
@ -12,9 +11,6 @@ import org.junit.runner.RunWith;
import acceptance.AbstractAccTest;
import pro.taskana.ClassificationService;
import pro.taskana.ClassificationSummary;
import pro.taskana.exceptions.ClassificationNotFoundException;
import pro.taskana.exceptions.InvalidArgumentException;
import pro.taskana.exceptions.NotAuthorizedException;
import pro.taskana.security.JAASRunner;
import pro.taskana.security.WithAccessId;
@ -31,8 +27,7 @@ public class ClassificationQueryAccTest extends AbstractAccTest {
}
@Test
public void testFindClassificationsByDomainUnauthenticated()
throws SQLException, ClassificationNotFoundException, NotAuthorizedException, InvalidArgumentException {
public void testFindClassificationsByDomainUnauthenticated() {
ClassificationService classificationService = taskanaEngine.getClassificationService();
List<ClassificationSummary> classificationSummaryList = classificationService.createClassificationQuery()
.domainIn("DOMAIN_A")
@ -44,8 +39,7 @@ public class ClassificationQueryAccTest extends AbstractAccTest {
@WithAccessId(userName = "businessadmin")
@Test
public void testFindClassificationsByDomainBusinessAdmin()
throws SQLException, ClassificationNotFoundException, NotAuthorizedException, InvalidArgumentException {
public void testFindClassificationsByDomainBusinessAdmin() {
ClassificationService classificationService = taskanaEngine.getClassificationService();
List<ClassificationSummary> classificationSummaryList = classificationService.createClassificationQuery()
.domainIn("DOMAIN_A")
@ -57,8 +51,7 @@ public class ClassificationQueryAccTest extends AbstractAccTest {
@WithAccessId(userName = "admin")
@Test
public void testFindClassificationsByDomainAdmin()
throws SQLException, ClassificationNotFoundException, NotAuthorizedException, InvalidArgumentException {
public void testFindClassificationsByDomainAdmin() {
ClassificationService classificationService = taskanaEngine.getClassificationService();
List<ClassificationSummary> classificationSummaryList = classificationService.createClassificationQuery()
.domainIn("DOMAIN_A")

View File

@ -1,6 +1,5 @@
package acceptance.security;
import java.sql.SQLException;
import java.util.List;
import org.junit.Assert;
@ -27,8 +26,7 @@ public class WorkbasketQueryAccTest extends AbstractAccTest {
}
@Test
public void testQueryWorkbasketByUnauthenticated()
throws SQLException, NotAuthorizedException, InvalidArgumentException {
public void testQueryWorkbasketByUnauthenticated() throws InvalidArgumentException {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
List<WorkbasketSummary> results = workbasketService.createWorkbasketQuery()
.nameLike("%")
@ -50,8 +48,7 @@ public class WorkbasketQueryAccTest extends AbstractAccTest {
@WithAccessId(
userName = "unknown")
@Test
public void testQueryWorkbasketByUnknownUser()
throws SQLException, NotAuthorizedException, InvalidArgumentException {
public void testQueryWorkbasketByUnknownUser() throws InvalidArgumentException {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
List<WorkbasketSummary> results = workbasketService.createWorkbasketQuery()
.nameLike("%")
@ -74,8 +71,7 @@ public class WorkbasketQueryAccTest extends AbstractAccTest {
userName = "unknown",
groupNames = "businessadmin")
@Test
public void testQueryWorkbasketByBusinessAdmin()
throws SQLException, NotAuthorizedException, InvalidArgumentException {
public void testQueryWorkbasketByBusinessAdmin() throws NotAuthorizedException, InvalidArgumentException {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
List<WorkbasketSummary> results = workbasketService.createWorkbasketQuery()
.nameLike("%")
@ -95,8 +91,7 @@ public class WorkbasketQueryAccTest extends AbstractAccTest {
userName = "unknown",
groupNames = "admin")
@Test
public void testQueryWorkbasketByAdmin()
throws SQLException, NotAuthorizedException, InvalidArgumentException {
public void testQueryWorkbasketByAdmin() throws NotAuthorizedException, InvalidArgumentException {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
List<WorkbasketSummary> results = workbasketService.createWorkbasketQuery()
.nameLike("%")

View File

@ -7,7 +7,6 @@ import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import java.sql.SQLException;
import java.time.Duration;
import java.time.Instant;
import java.util.Collections;
@ -26,9 +25,7 @@ import pro.taskana.TaskState;
import pro.taskana.Workbasket;
import pro.taskana.WorkbasketService;
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;
@ -58,8 +55,8 @@ public class CreateTaskAccTest extends AbstractAccTest {
groupNames = {"group_1"})
@Test
public void testCreateSimpleManualTask()
throws SQLException, NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException,
WorkbasketNotFoundException, TaskAlreadyExistException, InvalidWorkbasketException {
throws NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException,
WorkbasketNotFoundException, TaskAlreadyExistException {
TaskService taskService = taskanaEngine.getTaskService();
Task newTask = taskService.newTask("USER_1_1", "DOMAIN_A");
@ -90,8 +87,8 @@ public class CreateTaskAccTest extends AbstractAccTest {
groupNames = {"group_1"})
@Test
public void testCreateSimpleTaskWithCustomAttributes()
throws SQLException, NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException,
WorkbasketNotFoundException, TaskAlreadyExistException, InvalidWorkbasketException, TaskNotFoundException {
throws NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException,
WorkbasketNotFoundException, TaskAlreadyExistException, TaskNotFoundException {
TaskService taskService = taskanaEngine.getTaskService();
Task newTask = taskService.newTask("USER_1_1", "DOMAIN_A");
@ -157,9 +154,8 @@ public class CreateTaskAccTest extends AbstractAccTest {
groupNames = {"group_1"})
@Test
public void testCreateExternalTaskWithAttachment()
throws SQLException, NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException,
WorkbasketNotFoundException, TaskAlreadyExistException, InvalidWorkbasketException, TaskNotFoundException,
ConcurrencyException {
throws NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException,
WorkbasketNotFoundException, TaskAlreadyExistException, TaskNotFoundException {
TaskService taskService = taskanaEngine.getTaskService();
Task newTask = taskService.newTask("USER_1_1", "DOMAIN_A");
@ -223,8 +219,8 @@ public class CreateTaskAccTest extends AbstractAccTest {
groupNames = {"group_1"})
@Test
public void testCreateExternalTaskWithMultipleAttachments()
throws SQLException, NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException,
WorkbasketNotFoundException, TaskAlreadyExistException, InvalidWorkbasketException, TaskNotFoundException {
throws NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException,
WorkbasketNotFoundException, TaskAlreadyExistException, TaskNotFoundException {
TaskService taskService = taskanaEngine.getTaskService();
Task newTask = taskService.newTask("USER_1_1", "DOMAIN_A");
@ -260,8 +256,8 @@ public class CreateTaskAccTest extends AbstractAccTest {
groupNames = {"group_1"})
@Test
public void testPrioDurationOfTaskFromAttachmentsAtCreate()
throws SQLException, NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException,
WorkbasketNotFoundException, TaskAlreadyExistException, InvalidWorkbasketException, TaskNotFoundException {
throws NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException,
WorkbasketNotFoundException, TaskAlreadyExistException, TaskNotFoundException {
TaskService taskService = taskanaEngine.getTaskService();
Task newTask = taskService.newTask("USER_1_1", "DOMAIN_A");
@ -306,8 +302,8 @@ public class CreateTaskAccTest extends AbstractAccTest {
groupNames = {"group_1"})
@Test
public void testThrowsExceptionIfAttachmentIsInvalid()
throws SQLException, NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException,
WorkbasketNotFoundException, TaskAlreadyExistException, InvalidWorkbasketException {
throws NotAuthorizedException, ClassificationNotFoundException,
WorkbasketNotFoundException, TaskAlreadyExistException {
TaskService taskService = taskanaEngine.getTaskService();
Task newTask = makeNewTask(taskService);
@ -378,7 +374,7 @@ public class CreateTaskAccTest extends AbstractAccTest {
}
}
private Task makeNewTask(TaskService taskService) throws ClassificationNotFoundException {
private Task makeNewTask(TaskService taskService) {
Task newTask = taskService.newTask("USER_1_1", "DOMAIN_A");
newTask.setClassificationKey("L12010");
newTask.setPrimaryObjRef(createObjectReference("COMPANY_A", "SYSTEM_A", "INSTANCE_A", "VNR", "1234567"));
@ -391,8 +387,8 @@ public class CreateTaskAccTest extends AbstractAccTest {
groupNames = {"group_1"})
@Test
public void testUseCustomNameIfSetForNewTask()
throws SQLException, NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException,
WorkbasketNotFoundException, TaskAlreadyExistException, InvalidWorkbasketException {
throws NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException,
WorkbasketNotFoundException, TaskAlreadyExistException {
TaskService taskService = taskanaEngine.getTaskService();
Task newTask = taskService.newTask("USER_1_1", "DOMAIN_A");
@ -411,8 +407,8 @@ public class CreateTaskAccTest extends AbstractAccTest {
groupNames = {"group_1"})
@Test
public void testUseClassificationMetadataFromCorrectDomainForNewTask()
throws SQLException, NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException,
WorkbasketNotFoundException, TaskAlreadyExistException, InvalidWorkbasketException {
throws NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException,
WorkbasketNotFoundException, TaskAlreadyExistException {
TaskService taskService = taskanaEngine.getTaskService();
Task newTask = taskService.newTask("USER_1_1", "DOMAIN_A");
@ -431,8 +427,8 @@ public class CreateTaskAccTest extends AbstractAccTest {
groupNames = {"group_1"})
@Test(expected = WorkbasketNotFoundException.class)
public void testGetExceptionIfWorkbasketDoesNotExist()
throws SQLException, NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException,
WorkbasketNotFoundException, TaskAlreadyExistException, InvalidWorkbasketException {
throws NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException,
WorkbasketNotFoundException, TaskAlreadyExistException {
TaskService taskService = taskanaEngine.getTaskService();
Task newTask = taskService.newTask("UNKNOWN");
@ -446,8 +442,8 @@ public class CreateTaskAccTest extends AbstractAccTest {
groupNames = {"group_1"})
@Test(expected = NotAuthorizedException.class)
public void testGetExceptionIfAppendIsNotPermitted()
throws SQLException, NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException,
WorkbasketNotFoundException, TaskAlreadyExistException, InvalidWorkbasketException {
throws NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException,
WorkbasketNotFoundException, TaskAlreadyExistException {
TaskService taskService = taskanaEngine.getTaskService();
Task newTask = taskService.newTask("GPK_KSC", "DOMAIN_A");
@ -461,8 +457,8 @@ public class CreateTaskAccTest extends AbstractAccTest {
groupNames = {"group_1"})
@Test
public void testThrowsExceptionIfMandatoryPrimaryObjectReferenceIsNotSetOrIncomplete()
throws SQLException, NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException,
WorkbasketNotFoundException, TaskAlreadyExistException, InvalidWorkbasketException {
throws NotAuthorizedException, ClassificationNotFoundException,
WorkbasketNotFoundException, TaskAlreadyExistException {
TaskService taskService = taskanaEngine.getTaskService();
Task newTask = taskService.newTask("USER_1_1", "DOMAIN_A");
@ -535,8 +531,8 @@ public class CreateTaskAccTest extends AbstractAccTest {
groupNames = {"group_1"})
@Test
public void testSetDomainFromWorkbasket()
throws SQLException, NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException,
WorkbasketNotFoundException, TaskAlreadyExistException, InvalidWorkbasketException {
throws NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException,
WorkbasketNotFoundException, TaskAlreadyExistException {
TaskService taskService = taskanaEngine.getTaskService();
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
@ -559,8 +555,8 @@ public class CreateTaskAccTest extends AbstractAccTest {
groupNames = {"group_1"})
@Test
public void testCreatedTaskObjectEqualsReadTaskObject()
throws SQLException, NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException,
WorkbasketNotFoundException, TaskAlreadyExistException, InvalidWorkbasketException, TaskNotFoundException {
throws NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException,
WorkbasketNotFoundException, TaskAlreadyExistException, TaskNotFoundException {
TaskService taskService = taskanaEngine.getTaskService();
Task newTask = taskService.newTask("USER_1_1", "DOMAIN_A");

View File

@ -4,7 +4,6 @@ import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
@ -64,7 +63,7 @@ public class DeleteTaskAccTest extends AbstractAccTest {
groupNames = {"group_1", "admin"})
@Test(expected = InvalidStateException.class)
public void testThrowsExceptionIfTaskIsNotCompleted()
throws TaskNotFoundException, InvalidStateException, SQLException, NotAuthorizedException {
throws TaskNotFoundException, InvalidStateException, NotAuthorizedException {
TaskService taskService = taskanaEngine.getTaskService();
Task task = taskService.getTask("TKI:000000000000000000000000000000000029");
@ -76,7 +75,7 @@ public class DeleteTaskAccTest extends AbstractAccTest {
groupNames = {"group_1", "admin"})
@Test(expected = TaskNotFoundException.class)
public void testForceDeleteTaskIfNotCompleted()
throws SQLException, TaskNotFoundException, InvalidStateException, NotAuthorizedException {
throws TaskNotFoundException, InvalidStateException, NotAuthorizedException {
TaskService taskService = taskanaEngine.getTaskService();
Task task = taskService.getTask("TKI:000000000000000000000000000000000027");
try {

View File

@ -6,7 +6,6 @@ import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
import java.sql.SQLException;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
@ -79,8 +78,7 @@ public class QueryTasksAccTest extends AbstractAccTest {
userName = "teamlead_1",
groupNames = {"group_1", "group_2"})
@Test
public void testQueryForOwnerLike()
throws SQLException, NotAuthorizedException, InvalidArgumentException {
public void testQueryForOwnerLike() {
TaskService taskService = taskanaEngine.getTaskService();
List<TaskSummary> results = taskService.createTaskQuery()
@ -102,8 +100,7 @@ public class QueryTasksAccTest extends AbstractAccTest {
userName = "teamlead_1",
groupNames = {"group_1", "group_2"})
@Test
public void testQueryForParentBusinessProcessId()
throws SQLException, NotAuthorizedException, InvalidArgumentException {
public void testQueryForParentBusinessProcessId() {
TaskService taskService = taskanaEngine.getTaskService();
List<TaskSummary> results = taskService.createTaskQuery()
@ -126,8 +123,7 @@ public class QueryTasksAccTest extends AbstractAccTest {
userName = "teamlead_1",
groupNames = {"group_1", "group_2"})
@Test
public void testQueryForName()
throws SQLException, NotAuthorizedException, InvalidArgumentException {
public void testQueryForName() {
TaskService taskService = taskanaEngine.getTaskService();
List<TaskSummary> results = taskService.createTaskQuery()
@ -150,8 +146,7 @@ public class QueryTasksAccTest extends AbstractAccTest {
userName = "teamlead_1",
groupNames = {"group_1", "group_2"})
@Test
public void testQueryForClassificationKey()
throws SQLException, NotAuthorizedException, InvalidArgumentException {
public void testQueryForClassificationKey() {
TaskService taskService = taskanaEngine.getTaskService();
List<TaskSummary> results = taskService.createTaskQuery()
@ -175,7 +170,7 @@ public class QueryTasksAccTest extends AbstractAccTest {
groupNames = {"group_1"})
@Test
public void testQueryForAttachmentInSummary()
throws SQLException, NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException,
throws NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException,
TaskNotFoundException, WorkbasketNotFoundException, ConcurrencyException, InvalidWorkbasketException,
AttachmentPersistenceException {
TaskService taskService = taskanaEngine.getTaskService();
@ -201,8 +196,7 @@ public class QueryTasksAccTest extends AbstractAccTest {
userName = "teamlead_1",
groupNames = {"group_1"})
@Test
public void testQueryForWorkbasketKeyDomain()
throws SQLException, NotAuthorizedException, InvalidArgumentException {
public void testQueryForWorkbasketKeyDomain() {
TaskService taskService = taskanaEngine.getTaskService();
List<KeyDomain> workbasketIdentifiers = Arrays.asList(new KeyDomain("GPK_KSC", "DOMAIN_A"),
new KeyDomain("USER_1_2", "DOMAIN_A"));
@ -228,7 +222,7 @@ public class QueryTasksAccTest extends AbstractAccTest {
groupNames = {"group_1"})
@Test
public void testQueryForCustom1()
throws SQLException, NotAuthorizedException, InvalidArgumentException {
throws InvalidArgumentException {
TaskService taskService = taskanaEngine.getTaskService();
List<TaskSummary> results = taskService.createTaskQuery()
@ -262,7 +256,7 @@ public class QueryTasksAccTest extends AbstractAccTest {
groupNames = {"group_1"})
@Test
public void testQueryForCustom2()
throws SQLException, NotAuthorizedException, InvalidArgumentException {
throws InvalidArgumentException {
TaskService taskService = taskanaEngine.getTaskService();
List<TaskSummary> results = taskService.createTaskQuery()
@ -296,7 +290,7 @@ public class QueryTasksAccTest extends AbstractAccTest {
groupNames = {"group_1"})
@Test
public void testQueryForCustom3()
throws SQLException, NotAuthorizedException, InvalidArgumentException {
throws InvalidArgumentException {
TaskService taskService = taskanaEngine.getTaskService();
List<TaskSummary> results = taskService.createTaskQuery()
@ -330,7 +324,7 @@ public class QueryTasksAccTest extends AbstractAccTest {
groupNames = {"group_1"})
@Test
public void testQueryForCustom4()
throws SQLException, NotAuthorizedException, InvalidArgumentException {
throws InvalidArgumentException {
TaskService taskService = taskanaEngine.getTaskService();
List<TaskSummary> results = taskService.createTaskQuery()
@ -364,7 +358,7 @@ public class QueryTasksAccTest extends AbstractAccTest {
groupNames = {"group_1"})
@Test
public void testQueryForCustom5()
throws SQLException, NotAuthorizedException, InvalidArgumentException {
throws InvalidArgumentException {
TaskService taskService = taskanaEngine.getTaskService();
List<TaskSummary> results = taskService.createTaskQuery()
@ -398,7 +392,7 @@ public class QueryTasksAccTest extends AbstractAccTest {
groupNames = {"group_1"})
@Test
public void testQueryForCustom6()
throws SQLException, NotAuthorizedException, InvalidArgumentException {
throws InvalidArgumentException {
TaskService taskService = taskanaEngine.getTaskService();
List<TaskSummary> results = taskService.createTaskQuery()
@ -432,7 +426,7 @@ public class QueryTasksAccTest extends AbstractAccTest {
groupNames = {"group_1"})
@Test
public void testQueryForCustom7()
throws SQLException, NotAuthorizedException, InvalidArgumentException {
throws InvalidArgumentException {
TaskService taskService = taskanaEngine.getTaskService();
List<TaskSummary> results = taskService.createTaskQuery()
@ -466,7 +460,7 @@ public class QueryTasksAccTest extends AbstractAccTest {
groupNames = {"group_1"})
@Test
public void testQueryForCustom8()
throws SQLException, NotAuthorizedException, InvalidArgumentException {
throws InvalidArgumentException {
TaskService taskService = taskanaEngine.getTaskService();
List<TaskSummary> results = taskService.createTaskQuery()
@ -500,7 +494,7 @@ public class QueryTasksAccTest extends AbstractAccTest {
groupNames = {"group_1"})
@Test
public void testQueryForCustom9()
throws SQLException, NotAuthorizedException, InvalidArgumentException {
throws InvalidArgumentException {
TaskService taskService = taskanaEngine.getTaskService();
List<TaskSummary> results = taskService.createTaskQuery()
@ -534,7 +528,7 @@ public class QueryTasksAccTest extends AbstractAccTest {
groupNames = {"group_1"})
@Test
public void testQueryForCustom10()
throws SQLException, NotAuthorizedException, InvalidArgumentException {
throws InvalidArgumentException {
TaskService taskService = taskanaEngine.getTaskService();
List<TaskSummary> results = taskService.createTaskQuery()
@ -568,8 +562,8 @@ public class QueryTasksAccTest extends AbstractAccTest {
groupNames = {"group_1"})
@Test
public void testQueryTaskByCustomAttributes()
throws SQLException, NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException,
WorkbasketNotFoundException, TaskAlreadyExistException, InvalidWorkbasketException, TaskNotFoundException {
throws NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException,
WorkbasketNotFoundException, TaskAlreadyExistException {
TaskService taskService = taskanaEngine.getTaskService();
Task newTask = taskService.newTask("USER_1_1", "DOMAIN_A");

View File

@ -1,6 +1,5 @@
package acceptance.task;
import java.sql.SQLException;
import java.util.List;
import org.junit.Assert;
@ -10,8 +9,6 @@ import org.junit.runner.RunWith;
import acceptance.AbstractAccTest;
import pro.taskana.TaskService;
import pro.taskana.TaskSummary;
import pro.taskana.exceptions.InvalidArgumentException;
import pro.taskana.exceptions.NotAuthorizedException;
import pro.taskana.exceptions.SystemException;
import pro.taskana.security.JAASRunner;
import pro.taskana.security.WithAccessId;
@ -31,7 +28,7 @@ public class QueryTasksByObjectReferenceAccTest extends AbstractAccTest {
groupNames = {"group_1", "group_2"})
@Test
public void testQueryTasksByExcactValueOfObjectReference()
throws SQLException, NotAuthorizedException, InvalidArgumentException, SystemException {
throws SystemException {
TaskService taskService = taskanaEngine.getTaskService();
List<TaskSummary> results = taskService.createTaskQuery()
.primaryObjectReferenceValueIn("11223344", "22334455")
@ -44,7 +41,7 @@ public class QueryTasksByObjectReferenceAccTest extends AbstractAccTest {
groupNames = {"group_1", "group_2"})
@Test
public void testQueryTasksByExcactValueAndTypeOfObjectReference()
throws SQLException, NotAuthorizedException, InvalidArgumentException, SystemException {
throws SystemException {
TaskService taskService = taskanaEngine.getTaskService();
List<TaskSummary> results = taskService.createTaskQuery()
.primaryObjectReferenceTypeIn("SDNR")
@ -58,7 +55,7 @@ public class QueryTasksByObjectReferenceAccTest extends AbstractAccTest {
groupNames = {"group_1", "group_2"})
@Test
public void testQueryTasksByValueLikeOfObjectReference()
throws SQLException, NotAuthorizedException, InvalidArgumentException, SystemException {
throws SystemException {
TaskService taskService = taskanaEngine.getTaskService();
List<TaskSummary> results = taskService.createTaskQuery()
.primaryObjectReferenceValueLike("%567%")

View File

@ -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.time.Instant;
import java.util.List;
@ -16,8 +15,6 @@ import pro.taskana.BaseQuery.SortDirection;
import pro.taskana.TaskService;
import pro.taskana.TaskSummary;
import pro.taskana.TimeInterval;
import pro.taskana.exceptions.InvalidArgumentException;
import pro.taskana.exceptions.NotAuthorizedException;
import pro.taskana.security.JAASRunner;
import pro.taskana.security.WithAccessId;
@ -38,8 +35,7 @@ public class QueryTasksByTimeIntervalsAccTest extends AbstractAccTest {
userName = "teamlead_1",
groupNames = {"group_1", "group_2"})
@Test
public void testCreatedWithin2Intervals()
throws SQLException, NotAuthorizedException, InvalidArgumentException {
public void testCreatedWithin2Intervals() {
TaskService taskService = taskanaEngine.getTaskService();
TimeInterval interval1 = new TimeInterval(
@ -71,8 +67,7 @@ public class QueryTasksByTimeIntervalsAccTest extends AbstractAccTest {
userName = "teamlead_1",
groupNames = {"group_1", "group_2"})
@Test
public void testCreatedBefore()
throws SQLException, NotAuthorizedException, InvalidArgumentException {
public void testCreatedBefore() {
TaskService taskService = taskanaEngine.getTaskService();
TimeInterval interval1 = new TimeInterval(
@ -101,8 +96,7 @@ public class QueryTasksByTimeIntervalsAccTest extends AbstractAccTest {
userName = "teamlead_1",
groupNames = {"group_1", "group_2"})
@Test
public void testCreatedAfter()
throws SQLException, NotAuthorizedException, InvalidArgumentException {
public void testCreatedAfter() {
TaskService taskService = taskanaEngine.getTaskService();
TimeInterval interval1 = new TimeInterval(
@ -130,8 +124,7 @@ public class QueryTasksByTimeIntervalsAccTest extends AbstractAccTest {
userName = "teamlead_1",
groupNames = {"group_1", "group_2"})
@Test
public void testClaimedWithin2Intervals()
throws SQLException, NotAuthorizedException, InvalidArgumentException {
public void testClaimedWithin2Intervals() {
TaskService taskService = taskanaEngine.getTaskService();
TimeInterval interval1 = new TimeInterval(
@ -163,8 +156,7 @@ public class QueryTasksByTimeIntervalsAccTest extends AbstractAccTest {
userName = "teamlead_1",
groupNames = {"group_1", "group_2"})
@Test
public void testCompletedWithin()
throws SQLException, NotAuthorizedException, InvalidArgumentException {
public void testCompletedWithin() {
TaskService taskService = taskanaEngine.getTaskService();
TimeInterval interval = new TimeInterval(
@ -192,8 +184,7 @@ public class QueryTasksByTimeIntervalsAccTest extends AbstractAccTest {
userName = "teamlead_1",
groupNames = {"group_1", "group_2"})
@Test
public void testModifiedWithin()
throws SQLException, NotAuthorizedException, InvalidArgumentException {
public void testModifiedWithin() {
TaskService taskService = taskanaEngine.getTaskService();
TimeInterval interval = new TimeInterval(
@ -221,8 +212,7 @@ public class QueryTasksByTimeIntervalsAccTest extends AbstractAccTest {
userName = "teamlead_1",
groupNames = {"group_1", "group_2"})
@Test
public void testPlannedWithin()
throws SQLException, NotAuthorizedException, InvalidArgumentException {
public void testPlannedWithin() {
TaskService taskService = taskanaEngine.getTaskService();
TimeInterval interval = new TimeInterval(
@ -250,8 +240,7 @@ public class QueryTasksByTimeIntervalsAccTest extends AbstractAccTest {
userName = "teamlead_1",
groupNames = {"group_1", "group_2"})
@Test
public void testDueWithin()
throws SQLException, NotAuthorizedException, InvalidArgumentException {
public void testDueWithin() {
TaskService taskService = taskanaEngine.getTaskService();
TimeInterval interval = new TimeInterval(

View File

@ -1,7 +1,5 @@
package acceptance.task;
import java.sql.SQLException;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
@ -9,8 +7,6 @@ import org.junit.runner.RunWith;
import acceptance.AbstractAccTest;
import pro.taskana.KeyDomain;
import pro.taskana.TaskService;
import pro.taskana.exceptions.InvalidArgumentException;
import pro.taskana.exceptions.NotAuthorizedException;
import pro.taskana.exceptions.NotAuthorizedToQueryWorkbasketException;
import pro.taskana.security.JAASRunner;
import pro.taskana.security.WithAccessId;
@ -30,8 +26,7 @@ public class QueryTasksByWorkbasketAccTest extends AbstractAccTest {
userName = "user_1_1",
groupNames = {"group_1"})
@Test(expected = NotAuthorizedToQueryWorkbasketException.class)
public void testThrowsExceptionIfNoOpenerPermissionOnQueriedWorkbasket()
throws SQLException, NotAuthorizedException, InvalidArgumentException {
public void testThrowsExceptionIfNoOpenerPermissionOnQueriedWorkbasket() {
TaskService taskService = taskanaEngine.getTaskService();
taskService.createTaskQuery()
.workbasketKeyDomainIn(new KeyDomain("USER_2_1", "DOMAIN_A"))
@ -43,8 +38,7 @@ public class QueryTasksByWorkbasketAccTest extends AbstractAccTest {
userName = "user_1_1",
groupNames = {"group_1"})
@Test(expected = NotAuthorizedToQueryWorkbasketException.class)
public void testThrowsExceptionIfNoOpenerPermissionOnAtLeastOneQueriedWorkbasket()
throws SQLException, NotAuthorizedException, InvalidArgumentException {
public void testThrowsExceptionIfNoOpenerPermissionOnAtLeastOneQueriedWorkbasket() {
TaskService taskService = taskanaEngine.getTaskService();
taskService.createTaskQuery()
.workbasketKeyDomainIn(new KeyDomain("USER_1_1", "DOMAIN_A"), new KeyDomain("USER_2_1", "DOMAIN_A"))

View File

@ -34,8 +34,7 @@ public class QueryTasksWithPaginationAccTest extends AbstractAccTest {
userName = "teamlead_1",
groupNames = {"group_1"})
@Test
public void testGetFirstPageOfTaskQueryWithOffset()
throws SQLException, NotAuthorizedException, InvalidArgumentException {
public void testGetFirstPageOfTaskQueryWithOffset() {
TaskService taskService = taskanaEngine.getTaskService();
List<TaskSummary> results = taskService.createTaskQuery()
.workbasketKeyDomainIn(new KeyDomain("GPK_KSC", "DOMAIN_A"))
@ -47,8 +46,7 @@ public class QueryTasksWithPaginationAccTest extends AbstractAccTest {
userName = "teamlead_1",
groupNames = {"group_1"})
@Test
public void testSecondPageOfTaskQueryWithOffset()
throws SQLException, NotAuthorizedException, InvalidArgumentException {
public void testSecondPageOfTaskQueryWithOffset() {
TaskService taskService = taskanaEngine.getTaskService();
List<TaskSummary> results = taskService.createTaskQuery()
.workbasketKeyDomainIn(new KeyDomain("GPK_KSC", "DOMAIN_A"))
@ -60,8 +58,7 @@ public class QueryTasksWithPaginationAccTest extends AbstractAccTest {
userName = "teamlead_1",
groupNames = {"group_1"})
@Test
public void testListOffsetAndLimitOutOfBounds()
throws SQLException, NotAuthorizedException, InvalidArgumentException {
public void testListOffsetAndLimitOutOfBounds() {
TaskService taskService = taskanaEngine.getTaskService();
// both will be 0, working
@ -87,8 +84,7 @@ public class QueryTasksWithPaginationAccTest extends AbstractAccTest {
userName = "teamlead_1",
groupNames = {"group_1"})
@Test
public void testPaginationWithPages()
throws SQLException, NotAuthorizedException, InvalidArgumentException {
public void testPaginationWithPages() {
TaskService taskService = taskanaEngine.getTaskService();
// Getting full page
@ -128,8 +124,7 @@ public class QueryTasksWithPaginationAccTest extends AbstractAccTest {
userName = "teamlead_1",
groupNames = {"group_1"})
@Test
public void testPaginationNullAndNegativeLimitsIgnoring()
throws SQLException, NotAuthorizedException, InvalidArgumentException {
public void testPaginationNullAndNegativeLimitsIgnoring() {
TaskService taskService = taskanaEngine.getTaskService();
// 0 limit/size = 0 results
@ -186,8 +181,7 @@ public class QueryTasksWithPaginationAccTest extends AbstractAccTest {
userName = "teamlead_1",
groupNames = {"group_1"})
@Test
public void testCountOfTaskQuery()
throws SQLException, NotAuthorizedException, InvalidArgumentException {
public void testCountOfTaskQuery() {
TaskService taskService = taskanaEngine.getTaskService();
long count = taskService.createTaskQuery()
.workbasketKeyDomainIn(new KeyDomain("GPK_KSC", "DOMAIN_A"))

View File

@ -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.Assert;
@ -16,8 +15,6 @@ import pro.taskana.KeyDomain;
import pro.taskana.TaskService;
import pro.taskana.TaskState;
import pro.taskana.TaskSummary;
import pro.taskana.exceptions.InvalidArgumentException;
import pro.taskana.exceptions.NotAuthorizedException;
import pro.taskana.security.JAASRunner;
import pro.taskana.security.WithAccessId;
@ -38,8 +35,7 @@ public class QueryTasksWithSortingAccTest extends AbstractAccTest {
userName = "teamlead_1",
groupNames = {"group_1", "group_2"})
@Test
public void testSortByModifiedAndDomain()
throws SQLException, NotAuthorizedException, InvalidArgumentException {
public void testSortByModifiedAndDomain() {
TaskService taskService = taskanaEngine.getTaskService();
List<TaskSummary> results = taskService.createTaskQuery()
.workbasketKeyDomainIn(new KeyDomain("USER_3_2", "DOMAIN_B"))
@ -61,8 +57,7 @@ public class QueryTasksWithSortingAccTest extends AbstractAccTest {
userName = "teamlead_1",
groupNames = {"group_1", "group_2"})
@Test
public void testSortByDomainNameAndCreated()
throws SQLException, NotAuthorizedException, InvalidArgumentException {
public void testSortByDomainNameAndCreated() {
TaskService taskService = taskanaEngine.getTaskService();
List<TaskSummary> results = taskService.createTaskQuery()
.workbasketKeyDomainIn(new KeyDomain("USER_3_2", "DOMAIN_B"))
@ -93,8 +88,7 @@ public class QueryTasksWithSortingAccTest extends AbstractAccTest {
userName = "teamlead_1",
groupNames = {"group_1", "group_2"})
@Test
public void testSortByPorSystemNoteDueAndOwner()
throws SQLException, NotAuthorizedException, InvalidArgumentException {
public void testSortByPorSystemNoteDueAndOwner() {
TaskService taskService = taskanaEngine.getTaskService();
List<TaskSummary> results = taskService.createTaskQuery()
.workbasketKeyDomainIn(new KeyDomain("USER_3_2", "DOMAIN_B"))
@ -119,8 +113,7 @@ public class QueryTasksWithSortingAccTest extends AbstractAccTest {
userName = "teamlead_1",
groupNames = {"group_1", "group_2"})
@Test
public void testSortByPorSystemInstanceParentProcPlannedAndState()
throws SQLException, NotAuthorizedException, InvalidArgumentException {
public void testSortByPorSystemInstanceParentProcPlannedAndState() {
TaskService taskService = taskanaEngine.getTaskService();
List<TaskSummary> results = taskService.createTaskQuery()
.workbasketKeyDomainIn(new KeyDomain("USER_3_2", "DOMAIN_B"))
@ -145,8 +138,7 @@ public class QueryTasksWithSortingAccTest extends AbstractAccTest {
userName = "teamlead_1",
groupNames = {"group_1", "group_2"})
@Test
public void testSortByPorCompanyAndClaimed()
throws SQLException, NotAuthorizedException, InvalidArgumentException {
public void testSortByPorCompanyAndClaimed() {
TaskService taskService = taskanaEngine.getTaskService();
List<TaskSummary> results = taskService.createTaskQuery()
.workbasketKeyDomainIn(new KeyDomain("USER_3_2", "DOMAIN_B"))
@ -171,8 +163,7 @@ public class QueryTasksWithSortingAccTest extends AbstractAccTest {
userName = "teamlead_1",
groupNames = {"group_1", "group_2"})
@Test
public void testSortByWbKeyPrioPorValueAndCompleted()
throws SQLException, NotAuthorizedException, InvalidArgumentException {
public void testSortByWbKeyPrioPorValueAndCompleted() {
TaskService taskService = taskanaEngine.getTaskService();
List<TaskSummary> results = taskService.createTaskQuery()
.stateIn(TaskState.READY)
@ -198,8 +189,7 @@ public class QueryTasksWithSortingAccTest extends AbstractAccTest {
userName = "teamlead_1",
groupNames = {"group_1", "group_2"})
@Test
public void testSortBpIdClassificationIdDescriptionAndPorType()
throws SQLException, NotAuthorizedException, InvalidArgumentException {
public void testSortBpIdClassificationIdDescriptionAndPorType() {
TaskService taskService = taskanaEngine.getTaskService();
List<TaskSummary> results = taskService.createTaskQuery()
.stateIn(TaskState.READY)

View File

@ -241,7 +241,7 @@ public class TransferTaskAccTest extends AbstractAccTest {
@WithAccessId(userName = "teamlead_1")
@Test(expected = NotAuthorizedException.class)
public void testBulkTransferTaskWithoutAppendPermissionOnTarget()
throws InvalidArgumentException, WorkbasketNotFoundException, TaskNotFoundException, NotAuthorizedException {
throws InvalidArgumentException, WorkbasketNotFoundException, NotAuthorizedException {
TaskService taskService = taskanaEngine.getTaskService();
ArrayList<String> taskIdList = new ArrayList<>();
taskIdList.add("TKI:000000000000000000000000000000000006"); // working

View File

@ -11,7 +11,6 @@ import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import java.sql.SQLException;
import java.time.Instant;
import java.util.HashMap;
import java.util.List;
@ -54,8 +53,8 @@ public class UpdateTaskAccTest extends AbstractAccTest {
groupNames = {"group_1"})
@Test
public void testUpdatePrimaryObjectReferenceOfTask()
throws SQLException, NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException,
WorkbasketNotFoundException, TaskAlreadyExistException, InvalidWorkbasketException, TaskNotFoundException,
throws NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException,
WorkbasketNotFoundException, InvalidWorkbasketException, TaskNotFoundException,
ConcurrencyException, AttachmentPersistenceException {
TaskService taskService = taskanaEngine.getTaskService();
@ -84,8 +83,8 @@ public class UpdateTaskAccTest extends AbstractAccTest {
groupNames = {"group_1"})
@Test
public void testThrowsExceptionIfMandatoryPrimaryObjectReferenceIsNotSetOrIncomplete()
throws SQLException, NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException,
WorkbasketNotFoundException, TaskAlreadyExistException, InvalidWorkbasketException, TaskNotFoundException,
throws NotAuthorizedException, ClassificationNotFoundException,
WorkbasketNotFoundException, InvalidWorkbasketException, TaskNotFoundException,
ConcurrencyException, AttachmentPersistenceException {
TaskService taskService = taskanaEngine.getTaskService();
@ -141,8 +140,8 @@ public class UpdateTaskAccTest extends AbstractAccTest {
groupNames = {"group_1"})
@Test
public void testThrowsExceptionIfTaskHasAlreadyBeenUpdated()
throws SQLException, NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException,
WorkbasketNotFoundException, TaskAlreadyExistException, InvalidWorkbasketException, TaskNotFoundException,
throws NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException,
WorkbasketNotFoundException, InvalidWorkbasketException, TaskNotFoundException,
ConcurrencyException, AttachmentPersistenceException {
TaskService taskService = taskanaEngine.getTaskService();
@ -193,9 +192,7 @@ public class UpdateTaskAccTest extends AbstractAccTest {
groupNames = {"group_1"})
@Test
public void testUpdateReadFlagOfTask()
throws TaskNotFoundException, WorkbasketNotFoundException, ClassificationNotFoundException,
InvalidArgumentException, ConcurrencyException, InvalidWorkbasketException, NotAuthorizedException,
AttachmentPersistenceException {
throws TaskNotFoundException, NotAuthorizedException {
TaskService taskService = taskanaEngine.getTaskService();
@ -235,8 +232,8 @@ public class UpdateTaskAccTest extends AbstractAccTest {
groupNames = {"group_1"})
@Test(expected = InvalidArgumentException.class)
public void testUpdateOfWorkbasketKeyWhatIsNotAllowed()
throws SQLException, NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException,
WorkbasketNotFoundException, TaskAlreadyExistException, InvalidWorkbasketException, TaskNotFoundException,
throws NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException,
WorkbasketNotFoundException, InvalidWorkbasketException, TaskNotFoundException,
ConcurrencyException, AttachmentPersistenceException {
TaskService taskService = taskanaEngine.getTaskService();

View File

@ -8,7 +8,6 @@ import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import java.sql.SQLException;
import java.time.Duration;
import java.time.Instant;
import java.util.ArrayList;
@ -59,7 +58,7 @@ public class UpdateTaskAttachmentsAccTest extends AbstractAccTest {
// since only @Test and not @Before methods are run by JAASRunner, we call this method explicitely at
// the begin of each testcase....
private void setUpMethod()
throws TaskNotFoundException, ClassificationNotFoundException, NotAuthorizedException, SQLException,
throws TaskNotFoundException, ClassificationNotFoundException, NotAuthorizedException,
WorkbasketNotFoundException, InvalidArgumentException, ConcurrencyException, InvalidWorkbasketException,
AttachmentPersistenceException {
taskService = taskanaEngine.getTaskService();
@ -81,7 +80,7 @@ public class UpdateTaskAttachmentsAccTest extends AbstractAccTest {
public void testAddNewAttachment()
throws TaskNotFoundException, ClassificationNotFoundException, NotAuthorizedException,
WorkbasketNotFoundException, InvalidArgumentException, ConcurrencyException, InvalidWorkbasketException,
AttachmentPersistenceException, SQLException {
AttachmentPersistenceException {
setUpMethod();
int attachmentCount = task.getAttachments().size();
assertTrue(task.getPriority() == 1);
@ -104,7 +103,7 @@ public class UpdateTaskAttachmentsAccTest extends AbstractAccTest {
public void testAddNewAttachmentTwiceWithoutTaskanaMethodWillThrowAttachmentPersistenceException()
throws TaskNotFoundException, WorkbasketNotFoundException, ClassificationNotFoundException,
InvalidArgumentException, ConcurrencyException, InvalidWorkbasketException, NotAuthorizedException,
AttachmentPersistenceException, SQLException {
AttachmentPersistenceException {
setUpMethod();
int attachmentCount = 0;
task.getAttachments().clear();
@ -127,7 +126,7 @@ public class UpdateTaskAttachmentsAccTest extends AbstractAccTest {
public void testAddExistingAttachmentAgainWillUpdateWhenNotEqual()
throws TaskNotFoundException, ClassificationNotFoundException, NotAuthorizedException,
WorkbasketNotFoundException, InvalidArgumentException, ConcurrencyException, InvalidWorkbasketException,
AttachmentPersistenceException, SQLException {
AttachmentPersistenceException {
setUpMethod();
// Add attachment before
task = taskService.getTask(task.getId());
@ -162,7 +161,7 @@ public class UpdateTaskAttachmentsAccTest extends AbstractAccTest {
public void testAddExistingAttachmentAgainWillDoNothingWhenEqual()
throws TaskNotFoundException, ClassificationNotFoundException, NotAuthorizedException,
WorkbasketNotFoundException, InvalidArgumentException, ConcurrencyException, InvalidWorkbasketException,
AttachmentPersistenceException, SQLException {
AttachmentPersistenceException {
setUpMethod();
// Add Attachment before
int attachmentCount = task.getAttachments().size();
@ -189,7 +188,7 @@ public class UpdateTaskAttachmentsAccTest extends AbstractAccTest {
public void testAddAttachmentAsNullValueWillBeIgnored()
throws TaskNotFoundException, WorkbasketNotFoundException, ClassificationNotFoundException,
InvalidArgumentException, ConcurrencyException, InvalidWorkbasketException, NotAuthorizedException,
AttachmentPersistenceException, SQLException {
AttachmentPersistenceException {
setUpMethod();
// Try to add a single NULL-Element
int attachmentCount = task.getAttachments().size();
@ -226,7 +225,7 @@ public class UpdateTaskAttachmentsAccTest extends AbstractAccTest {
public void testRemoveAttachment()
throws TaskNotFoundException, WorkbasketNotFoundException, ClassificationNotFoundException,
InvalidArgumentException, ConcurrencyException, InvalidWorkbasketException, NotAuthorizedException,
AttachmentPersistenceException, SQLException {
AttachmentPersistenceException {
setUpMethod();
task.addAttachment(attachment);
task = taskService.updateTask(task);
@ -250,7 +249,7 @@ public class UpdateTaskAttachmentsAccTest extends AbstractAccTest {
public void testRemoveAttachmentWithNullAndNotAddedId()
throws TaskNotFoundException, WorkbasketNotFoundException, ClassificationNotFoundException,
InvalidArgumentException, ConcurrencyException, InvalidWorkbasketException, NotAuthorizedException,
AttachmentPersistenceException, SQLException {
AttachmentPersistenceException {
setUpMethod();
task.addAttachment(attachment);
task = taskService.updateTask(task);
@ -276,7 +275,7 @@ public class UpdateTaskAttachmentsAccTest extends AbstractAccTest {
public void testUpdateAttachment()
throws TaskNotFoundException, WorkbasketNotFoundException, ClassificationNotFoundException,
InvalidArgumentException, ConcurrencyException, InvalidWorkbasketException, NotAuthorizedException,
AttachmentPersistenceException, SQLException {
AttachmentPersistenceException {
setUpMethod();
((TaskImpl) task).setAttachments(new ArrayList<>());
task = taskService.updateTask(task);
@ -312,7 +311,7 @@ public class UpdateTaskAttachmentsAccTest extends AbstractAccTest {
public void modifyExistingAttachment()
throws TaskNotFoundException, ClassificationNotFoundException, NotAuthorizedException,
WorkbasketNotFoundException, InvalidArgumentException, ConcurrencyException, InvalidWorkbasketException,
AttachmentPersistenceException, SQLException {
AttachmentPersistenceException {
setUpMethod();
// setup test
assertThat(task.getAttachments().size(), equalTo(0));
@ -396,7 +395,7 @@ public class UpdateTaskAttachmentsAccTest extends AbstractAccTest {
public void replaceExistingAttachments()
throws TaskNotFoundException, ClassificationNotFoundException, NotAuthorizedException,
WorkbasketNotFoundException, InvalidArgumentException, ConcurrencyException, InvalidWorkbasketException,
AttachmentPersistenceException, SQLException {
AttachmentPersistenceException {
setUpMethod();
// setup test
assertThat(task.getAttachments().size(), equalTo(0));
@ -441,7 +440,7 @@ public class UpdateTaskAttachmentsAccTest extends AbstractAccTest {
groupNames = {"group_1"})
@Test
public void testPrioDurationOfTaskFromAttachmentsAtUpdate()
throws SQLException, NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException,
throws NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException,
WorkbasketNotFoundException, TaskAlreadyExistException, InvalidWorkbasketException, TaskNotFoundException,
ConcurrencyException, AttachmentPersistenceException {
@ -491,7 +490,7 @@ public class UpdateTaskAttachmentsAccTest extends AbstractAccTest {
public void testAddCustomAttributeToAttachment()
throws TaskNotFoundException, ClassificationNotFoundException, NotAuthorizedException,
WorkbasketNotFoundException, InvalidArgumentException, ConcurrencyException, InvalidWorkbasketException,
AttachmentPersistenceException, SQLException {
AttachmentPersistenceException {
TaskService taskService = taskanaEngine.getTaskService();
task = taskService.getTask("TKI:000000000000000000000000000000000000"); // class T2000, prio 1, SL P1D

View File

@ -9,7 +9,6 @@ import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
import java.sql.SQLException;
import java.time.Duration;
import java.time.Instant;
import java.util.ArrayList;
@ -23,18 +22,12 @@ import pro.taskana.BulkOperationResults;
import pro.taskana.Task;
import pro.taskana.TaskService;
import pro.taskana.TaskState;
import pro.taskana.exceptions.AttachmentPersistenceException;
import pro.taskana.exceptions.ClassificationNotFoundException;
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;
import pro.taskana.exceptions.TaskanaException;
import pro.taskana.exceptions.WorkbasketNotFoundException;
import pro.taskana.security.JAASRunner;
import pro.taskana.security.WithAccessId;
@ -53,8 +46,7 @@ public class WorkOnTaskAccTest extends AbstractAccTest {
groupNames = {"group_1"})
@Test
public void testClaimTask()
throws SQLException, NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException,
WorkbasketNotFoundException, TaskAlreadyExistException, InvalidWorkbasketException, TaskNotFoundException,
throws NotAuthorizedException, TaskNotFoundException,
InvalidStateException, InvalidOwnerException {
TaskService taskService = taskanaEngine.getTaskService();
Task task = taskService.getTask("TKI:000000000000000000000000000000000025");
@ -76,8 +68,7 @@ public class WorkOnTaskAccTest extends AbstractAccTest {
groupNames = {"group_1"})
@Test(expected = InvalidOwnerException.class)
public void testThrowsExceptionIfTaskIsAlreadyClaimed()
throws SQLException, NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException,
WorkbasketNotFoundException, TaskAlreadyExistException, InvalidWorkbasketException, TaskNotFoundException,
throws NotAuthorizedException, TaskNotFoundException,
InvalidStateException, InvalidOwnerException {
TaskService taskService = taskanaEngine.getTaskService();
Task task = taskService.getTask("TKI:000000000000000000000000000000000026");
@ -90,8 +81,7 @@ public class WorkOnTaskAccTest extends AbstractAccTest {
groupNames = {"group_1"})
@Test
public void testClaimAlreadyClaimedByCallerTask()
throws SQLException, NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException,
WorkbasketNotFoundException, TaskAlreadyExistException, InvalidWorkbasketException, TaskNotFoundException,
throws NotAuthorizedException, TaskNotFoundException,
InvalidStateException, InvalidOwnerException {
TaskService taskService = taskanaEngine.getTaskService();
Task task = taskService.getTask("TKI:000000000000000000000000000000000027");
@ -104,8 +94,7 @@ public class WorkOnTaskAccTest extends AbstractAccTest {
groupNames = {"group_1"})
@Test(expected = InvalidOwnerException.class)
public void testForceClaimTaskWhichIsAlreadyClaimedByAnotherUser()
throws SQLException, NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException,
WorkbasketNotFoundException, TaskAlreadyExistException, InvalidWorkbasketException, TaskNotFoundException,
throws NotAuthorizedException, TaskNotFoundException,
InvalidStateException, InvalidOwnerException {
TaskService taskService = taskanaEngine.getTaskService();
Task task = taskService.getTask("TKI:000000000000000000000000000000000028");
@ -118,8 +107,7 @@ public class WorkOnTaskAccTest extends AbstractAccTest {
groupNames = {"group_1"})
@Test
public void testCancelClaimTask()
throws SQLException, NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException,
WorkbasketNotFoundException, TaskAlreadyExistException, InvalidWorkbasketException, TaskNotFoundException,
throws NotAuthorizedException, TaskNotFoundException,
InvalidStateException, InvalidOwnerException {
TaskService taskService = taskanaEngine.getTaskService();
Task claimedTask = taskService.getTask("TKI:000000000000000000000000000000000029");
@ -139,8 +127,7 @@ public class WorkOnTaskAccTest extends AbstractAccTest {
groupNames = {"group_1"})
@Test(expected = InvalidOwnerException.class)
public void testThrowsExceptionIfCancelClaimOfTaskFromAnotherUser()
throws SQLException, NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException,
WorkbasketNotFoundException, TaskAlreadyExistException, InvalidWorkbasketException, TaskNotFoundException,
throws NotAuthorizedException, TaskNotFoundException,
InvalidStateException, InvalidOwnerException {
TaskService taskService = taskanaEngine.getTaskService();
Task claimedTask = taskService.getTask("TKI:000000000000000000000000000000000030");
@ -153,8 +140,7 @@ public class WorkOnTaskAccTest extends AbstractAccTest {
groupNames = {"group_1"})
@Test
public void testForceCancelClaimOfTaskFromAnotherUser()
throws SQLException, NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException,
WorkbasketNotFoundException, TaskAlreadyExistException, InvalidWorkbasketException, TaskNotFoundException,
throws NotAuthorizedException, TaskNotFoundException,
InvalidStateException, InvalidOwnerException {
TaskService taskService = taskanaEngine.getTaskService();
Task claimedTask = taskService.getTask("TKI:000000000000000000000000000000000031");
@ -174,8 +160,7 @@ public class WorkOnTaskAccTest extends AbstractAccTest {
groupNames = {"group_1"})
@Test
public void testCompleteTask()
throws SQLException, NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException,
WorkbasketNotFoundException, TaskAlreadyExistException, InvalidWorkbasketException, TaskNotFoundException,
throws NotAuthorizedException, TaskNotFoundException,
InvalidStateException, InvalidOwnerException {
Instant before = Instant.now().minus(Duration.ofSeconds(3L));
TaskService taskService = taskanaEngine.getTaskService();
@ -199,8 +184,7 @@ public class WorkOnTaskAccTest extends AbstractAccTest {
groupNames = {"group_1"})
@Test
public void testForceCompleteUnclaimedTask()
throws SQLException, NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException,
WorkbasketNotFoundException, TaskAlreadyExistException, InvalidWorkbasketException, TaskNotFoundException,
throws NotAuthorizedException, TaskNotFoundException,
InvalidStateException, InvalidOwnerException {
TaskService taskService = taskanaEngine.getTaskService();
Task claimedTask = taskService.getTask("TKI:000000000000000000000000000000000033");
@ -221,8 +205,7 @@ public class WorkOnTaskAccTest extends AbstractAccTest {
groupNames = {"group_1"})
@Test(expected = InvalidOwnerException.class)
public void testThrowsExceptionIfCompletingClaimedTaskOfAnotherUser()
throws SQLException, NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException,
WorkbasketNotFoundException, TaskAlreadyExistException, InvalidWorkbasketException, TaskNotFoundException,
throws NotAuthorizedException, TaskNotFoundException,
InvalidStateException, InvalidOwnerException {
TaskService taskService = taskanaEngine.getTaskService();
Task claimedTask = taskService.getTask("TKI:000000000000000000000000000000000034");
@ -235,8 +218,7 @@ public class WorkOnTaskAccTest extends AbstractAccTest {
groupNames = {"group_1"})
@Test
public void testForceCompleteClaimedTaskOfAnotherUser()
throws SQLException, NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException,
WorkbasketNotFoundException, TaskAlreadyExistException, InvalidWorkbasketException, TaskNotFoundException,
throws NotAuthorizedException, TaskNotFoundException,
InvalidStateException, InvalidOwnerException {
TaskService taskService = taskanaEngine.getTaskService();
Task claimedTask = taskService.getTask("TKI:000000000000000000000000000000000035");
@ -257,9 +239,7 @@ public class WorkOnTaskAccTest extends AbstractAccTest {
groupNames = {"group_1"})
@Test
public void testBulkCompleteTasks()
throws SQLException, NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException,
WorkbasketNotFoundException, TaskAlreadyExistException, InvalidWorkbasketException, TaskNotFoundException,
ConcurrencyException, AttachmentPersistenceException {
throws NotAuthorizedException, InvalidArgumentException, TaskNotFoundException {
TaskService taskService = taskanaEngine.getTaskService();
List<String> taskIdList = new ArrayList<>();
@ -282,9 +262,7 @@ public class WorkOnTaskAccTest extends AbstractAccTest {
groupNames = {"group_1"})
@Test
public void testBulkDeleteTasksWithException()
throws SQLException, NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException,
WorkbasketNotFoundException, TaskAlreadyExistException, InvalidWorkbasketException, TaskNotFoundException,
ConcurrencyException, AttachmentPersistenceException {
throws InvalidArgumentException {
TaskService taskService = taskanaEngine.getTaskService();
List<String> taskIdList = new ArrayList<>();

View File

@ -4,7 +4,6 @@ import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.fail;
import java.sql.SQLException;
import java.util.List;
import org.junit.Test;
@ -39,7 +38,7 @@ public class CreateWorkbasketAccTest extends AbstractAccTest {
groupNames = {"businessadmin"})
@Test
public void testCreateWorkbasket()
throws SQLException, NotAuthorizedException, InvalidArgumentException, WorkbasketNotFoundException,
throws NotAuthorizedException, InvalidArgumentException, WorkbasketNotFoundException,
InvalidWorkbasketException, WorkbasketAlreadyExistException, DomainNotFoundException {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
int before = workbasketService.createWorkbasketQuery().domainIn("DOMAIN_A").list().size();
@ -67,8 +66,8 @@ public class CreateWorkbasketAccTest extends AbstractAccTest {
userName = "dummy")
@Test(expected = NotAuthorizedException.class)
public void testCreateWorkbasketNotAuthorized()
throws SQLException, NotAuthorizedException, InvalidArgumentException, WorkbasketNotFoundException,
InvalidWorkbasketException, WorkbasketAlreadyExistException, DomainNotFoundException {
throws NotAuthorizedException, InvalidWorkbasketException, WorkbasketAlreadyExistException,
DomainNotFoundException {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
Workbasket workbasket = workbasketService.newWorkbasket("key3", "DOMAIN_A");
@ -85,8 +84,8 @@ public class CreateWorkbasketAccTest extends AbstractAccTest {
groupNames = {"businessadmin"})
@Test(expected = DomainNotFoundException.class)
public void testCreateWorkbasketWithInvalidDomain()
throws SQLException, NotAuthorizedException, InvalidArgumentException, WorkbasketNotFoundException,
InvalidWorkbasketException, WorkbasketAlreadyExistException, DomainNotFoundException {
throws NotAuthorizedException, InvalidWorkbasketException, WorkbasketAlreadyExistException,
DomainNotFoundException {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
Workbasket workbasket = workbasketService.newWorkbasket("key3", "UNKNOWN_DOMAIN");
@ -103,7 +102,7 @@ public class CreateWorkbasketAccTest extends AbstractAccTest {
groupNames = {"businessadmin"})
@Test
public void testCreateWorkbasketWithMissingRequiredField()
throws WorkbasketNotFoundException, NotAuthorizedException, WorkbasketAlreadyExistException,
throws NotAuthorizedException, WorkbasketAlreadyExistException,
DomainNotFoundException {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
@ -151,7 +150,7 @@ public class CreateWorkbasketAccTest extends AbstractAccTest {
groupNames = {"businessadmin"})
@Test
public void testWorkbasketAccessItemSetName()
throws SQLException, NotAuthorizedException, InvalidArgumentException, WorkbasketNotFoundException,
throws NotAuthorizedException, InvalidArgumentException, WorkbasketNotFoundException,
InvalidWorkbasketException, WorkbasketAlreadyExistException, DomainNotFoundException {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
int before = workbasketService.createWorkbasketQuery().domainIn("DOMAIN_A").list().size();

View File

@ -6,7 +6,6 @@ import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import java.sql.SQLException;
import java.util.List;
import org.junit.Before;
@ -140,8 +139,8 @@ public class DeleteWorkbasketAccTest extends AbstractAccTest {
groupNames = {"businessadmin"})
@Test
public void testCreateAndDeleteWorkbasket()
throws SQLException, NotAuthorizedException, InvalidArgumentException, WorkbasketNotFoundException,
InvalidWorkbasketException, WorkbasketAlreadyExistException, DomainNotFoundException {
throws NotAuthorizedException, InvalidWorkbasketException, WorkbasketAlreadyExistException,
DomainNotFoundException {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
int before = workbasketService.createWorkbasketQuery().domainIn("DOMAIN_A").list().size();

View File

@ -18,7 +18,6 @@ import acceptance.AbstractAccTest;
import pro.taskana.Workbasket;
import pro.taskana.WorkbasketService;
import pro.taskana.WorkbasketSummary;
import pro.taskana.exceptions.InvalidWorkbasketException;
import pro.taskana.exceptions.NotAuthorizedException;
import pro.taskana.exceptions.WorkbasketNotFoundException;
import pro.taskana.security.JAASRunner;
@ -127,7 +126,7 @@ public class DistributionTargetsAccTest extends AbstractAccTest {
userName = "user_3_1", groupNames = {"group_1"})
@Test
public void testDistributionTargetCallsFailWithNotAuthorizedException()
throws NotAuthorizedException, WorkbasketNotFoundException {
throws WorkbasketNotFoundException {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
String existingWb = "WBI:100000000000000000000000000000000001";
@ -170,7 +169,7 @@ public class DistributionTargetsAccTest extends AbstractAccTest {
groupNames = {"group_1", "group_2", "businessadmin"})
@Test
public void testAddAndRemoveDistributionTargets()
throws NotAuthorizedException, WorkbasketNotFoundException, InvalidWorkbasketException {
throws NotAuthorizedException, WorkbasketNotFoundException {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
Workbasket workbasket = workbasketService.getWorkbasket("GPK_KSC_1", "DOMAIN_A");
@ -201,7 +200,7 @@ public class DistributionTargetsAccTest extends AbstractAccTest {
groupNames = {"businessadmin"})
@Test
public void testAddAndRemoveDistributionTargetsOnWorkbasketWithoutReadPermission()
throws NotAuthorizedException, WorkbasketNotFoundException, InvalidWorkbasketException {
throws NotAuthorizedException, WorkbasketNotFoundException {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
Workbasket workbasket = workbasketService.getWorkbasket("GPK_B_KSC_2", "DOMAIN_B");
@ -227,7 +226,7 @@ public class DistributionTargetsAccTest extends AbstractAccTest {
groupNames = {"group_1", "group_2"})
@Test(expected = NotAuthorizedException.class)
public void testAddDistributionTargetsFailsNotAuthorized()
throws NotAuthorizedException, WorkbasketNotFoundException, InvalidWorkbasketException {
throws NotAuthorizedException, WorkbasketNotFoundException {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
Workbasket workbasket = workbasketService.getWorkbasket("GPK_KSC_1", "DOMAIN_A");
@ -277,7 +276,7 @@ public class DistributionTargetsAccTest extends AbstractAccTest {
groupNames = {"group_1", "group_2"})
@Test
public void testGetDistributionSourcesById()
throws NotAuthorizedException, WorkbasketNotFoundException, InvalidWorkbasketException, SQLException {
throws NotAuthorizedException, WorkbasketNotFoundException {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
List<WorkbasketSummary> distributionSources = workbasketService
@ -298,7 +297,7 @@ public class DistributionTargetsAccTest extends AbstractAccTest {
groupNames = {"group_1", "group_2"})
@Test
public void testGetDistributionSourcesByKeyDomain()
throws NotAuthorizedException, WorkbasketNotFoundException, InvalidWorkbasketException, SQLException {
throws NotAuthorizedException, WorkbasketNotFoundException {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
List<WorkbasketSummary> distributionSources = workbasketService
@ -318,7 +317,7 @@ public class DistributionTargetsAccTest extends AbstractAccTest {
groupNames = {"undefinedgroup"})
@Test(expected = NotAuthorizedException.class)
public void testQueryDistributionSourcesThrowsNotAuthorized()
throws NotAuthorizedException, WorkbasketNotFoundException, InvalidWorkbasketException, SQLException {
throws NotAuthorizedException, WorkbasketNotFoundException {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
List<WorkbasketSummary> distributionSources = workbasketService
@ -332,7 +331,7 @@ public class DistributionTargetsAccTest extends AbstractAccTest {
groupNames = {"group_1", "group_2"})
@Test(expected = WorkbasketNotFoundException.class)
public void testQueryDistributionSourcesThrowsWorkbasketNotFound()
throws NotAuthorizedException, WorkbasketNotFoundException, InvalidWorkbasketException, SQLException {
throws NotAuthorizedException, WorkbasketNotFoundException {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
List<WorkbasketSummary> distributionSources = workbasketService

View File

@ -1,6 +1,5 @@
package acceptance.workbasket;
import java.sql.SQLException;
import java.util.List;
import org.junit.Assert;
@ -12,8 +11,6 @@ import pro.taskana.Workbasket;
import pro.taskana.WorkbasketPermission;
import pro.taskana.WorkbasketService;
import pro.taskana.WorkbasketType;
import pro.taskana.exceptions.InvalidArgumentException;
import pro.taskana.exceptions.InvalidWorkbasketException;
import pro.taskana.exceptions.NotAuthorizedException;
import pro.taskana.exceptions.WorkbasketNotFoundException;
import pro.taskana.security.JAASRunner;
@ -34,8 +31,7 @@ public class GetWorkbasketAccTest extends AbstractAccTest {
groupNames = {"group_1"})
@Test
public void testGetWorkbasket()
throws SQLException, NotAuthorizedException, InvalidArgumentException, WorkbasketNotFoundException,
InvalidWorkbasketException {
throws NotAuthorizedException, WorkbasketNotFoundException {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
Workbasket workbasket = workbasketService.getWorkbasket("WBI:100000000000000000000000000000000007");
@ -67,16 +63,14 @@ public class GetWorkbasketAccTest extends AbstractAccTest {
@Test(expected = WorkbasketNotFoundException.class)
public void testThrowsExceptionIfIdIsInvalid()
throws SQLException, NotAuthorizedException, InvalidArgumentException, WorkbasketNotFoundException,
InvalidWorkbasketException {
throws NotAuthorizedException, WorkbasketNotFoundException {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
workbasketService.getWorkbasket("INVALID_ID");
}
@Test(expected = NotAuthorizedException.class)
public void testThrowsExceptionIfNotAuthorized()
throws SQLException, NotAuthorizedException, InvalidArgumentException, WorkbasketNotFoundException,
InvalidWorkbasketException {
throws NotAuthorizedException, WorkbasketNotFoundException {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
workbasketService.getWorkbasket("WBI:100000000000000000000000000000000001");
}

View File

@ -4,7 +4,6 @@ import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import java.sql.SQLException;
import java.util.List;
import org.junit.Assert;
@ -91,7 +90,7 @@ public class QueryWorkbasketAccTest extends AbstractAccTest {
userName = "teamlead_1",
groupNames = {"group_1"})
@Test
public void testQueryWorkbasketValuesForColumnName() throws NotAuthorizedException {
public void testQueryWorkbasketValuesForColumnName() {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
List<String> columnValueList = workbasketService.createWorkbasketQuery()
.listValues("NAME", null);
@ -110,8 +109,7 @@ public class QueryWorkbasketAccTest extends AbstractAccTest {
userName = "teamlead_1",
groupNames = {"group_1"})
@Test
public void testQueryWorkbasketByDomain()
throws SQLException, NotAuthorizedException, InvalidArgumentException {
public void testQueryWorkbasketByDomain() {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
List<WorkbasketSummary> results = workbasketService.createWorkbasketQuery()
.domainIn("DOMAIN_B")
@ -123,8 +121,7 @@ public class QueryWorkbasketAccTest extends AbstractAccTest {
userName = "teamlead_1",
groupNames = {"group_1"})
@Test
public void testQueryWorkbasketByDomainAndType()
throws SQLException, NotAuthorizedException, InvalidArgumentException {
public void testQueryWorkbasketByDomainAndType() {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
List<WorkbasketSummary> results = workbasketService.createWorkbasketQuery()
.domainIn("DOMAIN_A")
@ -137,8 +134,7 @@ public class QueryWorkbasketAccTest extends AbstractAccTest {
userName = "teamlead_1",
groupNames = {"group_1"})
@Test
public void testQueryWorkbasketByName()
throws SQLException, NotAuthorizedException, InvalidArgumentException {
public void testQueryWorkbasketByName() {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
List<WorkbasketSummary> results = workbasketService.createWorkbasketQuery()
.nameIn("Gruppenpostkorb KSC")
@ -151,8 +147,7 @@ public class QueryWorkbasketAccTest extends AbstractAccTest {
userName = "teamlead_1",
groupNames = {"group_1"})
@Test
public void testQueryWorkbasketByNameStartsWith()
throws SQLException, NotAuthorizedException, InvalidArgumentException {
public void testQueryWorkbasketByNameStartsWith() {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
List<WorkbasketSummary> results = workbasketService.createWorkbasketQuery()
.nameLike("%Gruppenpostkorb KSC%")
@ -164,8 +159,7 @@ public class QueryWorkbasketAccTest extends AbstractAccTest {
userName = "teamlead_1",
groupNames = {"group_1"})
@Test
public void testQueryWorkbasketByNameContains()
throws SQLException, NotAuthorizedException, InvalidArgumentException {
public void testQueryWorkbasketByNameContains() {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
List<WorkbasketSummary> results = workbasketService.createWorkbasketQuery()
.nameLike("%Teamlead%", "%Gruppenpostkorb KSC%")
@ -177,8 +171,7 @@ public class QueryWorkbasketAccTest extends AbstractAccTest {
userName = "teamlead_1",
groupNames = {"group_1"})
@Test
public void testQueryWorkbasketByNameContainsCaseInsensitive()
throws SQLException, NotAuthorizedException, InvalidArgumentException {
public void testQueryWorkbasketByNameContainsCaseInsensitive() {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
List<WorkbasketSummary> results = workbasketService.createWorkbasketQuery()
.nameLike("%TEAMLEAD%")
@ -190,8 +183,7 @@ public class QueryWorkbasketAccTest extends AbstractAccTest {
userName = "teamlead_1",
groupNames = {"group_1"})
@Test
public void testQueryWorkbasketByDescription()
throws SQLException, NotAuthorizedException, InvalidArgumentException {
public void testQueryWorkbasketByDescription() {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
List<WorkbasketSummary> results = workbasketService.createWorkbasketQuery()
.descriptionLike("%ppk%", "%gruppen%")
@ -205,8 +197,7 @@ public class QueryWorkbasketAccTest extends AbstractAccTest {
userName = "teamlead_1",
groupNames = {"group_1"})
@Test
public void testQueryWorkbasketByOwnerLike()
throws SQLException, NotAuthorizedException, InvalidArgumentException {
public void testQueryWorkbasketByOwnerLike() {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
List<WorkbasketSummary> results = workbasketService.createWorkbasketQuery()
.ownerLike("%an%", "%te%")
@ -219,8 +210,7 @@ public class QueryWorkbasketAccTest extends AbstractAccTest {
userName = "teamlead_1",
groupNames = {"group_1"})
@Test
public void testQueryWorkbasketByKey()
throws SQLException, NotAuthorizedException, InvalidArgumentException {
public void testQueryWorkbasketByKey() {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
List<WorkbasketSummary> results = workbasketService.createWorkbasketQuery()
.keyIn("GPK_KSC")
@ -232,8 +222,7 @@ public class QueryWorkbasketAccTest extends AbstractAccTest {
userName = "teamlead_1",
groupNames = {"group_1"})
@Test
public void testQueryWorkbasketByMultipleKeys()
throws SQLException, NotAuthorizedException, InvalidArgumentException {
public void testQueryWorkbasketByMultipleKeys() {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
List<WorkbasketSummary> results = workbasketService.createWorkbasketQuery()
.keyIn("GPK_KSC_1", "GPK_KSC")
@ -245,8 +234,7 @@ public class QueryWorkbasketAccTest extends AbstractAccTest {
userName = "teamlead_1",
groupNames = {"group_1"})
@Test
public void testQueryWorkbasketByMultipleKeysWithUnknownKey()
throws SQLException, NotAuthorizedException, InvalidArgumentException {
public void testQueryWorkbasketByMultipleKeysWithUnknownKey() {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
List<WorkbasketSummary> results = workbasketService.createWorkbasketQuery()
.keyIn("GPK_KSC_1", "GPK_Ksc", "GPK_KSC_3")
@ -258,8 +246,7 @@ public class QueryWorkbasketAccTest extends AbstractAccTest {
userName = "teamlead_1",
groupNames = {"group_1"})
@Test
public void testQueryWorkbasketByKeyContains()
throws SQLException, NotAuthorizedException, InvalidArgumentException {
public void testQueryWorkbasketByKeyContains() {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
List<WorkbasketSummary> results = workbasketService.createWorkbasketQuery()
.keyLike("%KSC%")
@ -271,8 +258,7 @@ public class QueryWorkbasketAccTest extends AbstractAccTest {
userName = "teamlead_1",
groupNames = {"group_1"})
@Test
public void testQueryWorkbasketByKeyContainsIgnoreCase()
throws SQLException, NotAuthorizedException, InvalidArgumentException {
public void testQueryWorkbasketByKeyContainsIgnoreCase() {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
List<WorkbasketSummary> results = workbasketService.createWorkbasketQuery()
.keyLike("%kSc%")
@ -284,8 +270,7 @@ public class QueryWorkbasketAccTest extends AbstractAccTest {
userName = "teamlead_1",
groupNames = {"group_1"})
@Test
public void testQueryWorkbasketByKeyOrNameContainsIgnoreCase()
throws SQLException, NotAuthorizedException, InvalidArgumentException {
public void testQueryWorkbasketByKeyOrNameContainsIgnoreCase() {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
List<WorkbasketSummary> results = workbasketService.createWorkbasketQuery()
.keyOrNameLike("%kSc%")
@ -297,8 +282,7 @@ public class QueryWorkbasketAccTest extends AbstractAccTest {
userName = "teamlead_1",
groupNames = {"group_1"})
@Test
public void testQueryWorkbasketByNameStartsWithSortedByNameAscending()
throws SQLException, NotAuthorizedException, InvalidArgumentException {
public void testQueryWorkbasketByNameStartsWithSortedByNameAscending() {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
List<WorkbasketSummary> results = workbasketService.createWorkbasketQuery()
.nameLike("%Gruppenpostkorb KSC%")
@ -322,8 +306,7 @@ public class QueryWorkbasketAccTest extends AbstractAccTest {
@WithAccessId(
userName = "max")
@Test
public void testQueryWorkbasketByNameStartsWithSortedByNameDescending()
throws SQLException, NotAuthorizedException, InvalidArgumentException {
public void testQueryWorkbasketByNameStartsWithSortedByNameDescending() {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
List<WorkbasketSummary> results = workbasketService.createWorkbasketQuery()
.nameLike("basxet%")
@ -344,8 +327,7 @@ public class QueryWorkbasketAccTest extends AbstractAccTest {
@WithAccessId(
userName = "max")
@Test
public void testQueryWorkbasketByNameStartsWithSortedByKeyAscending()
throws SQLException, NotAuthorizedException, InvalidArgumentException {
public void testQueryWorkbasketByNameStartsWithSortedByKeyAscending() {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
List<WorkbasketSummary> results = workbasketService.createWorkbasketQuery()
.nameLike("basxet%")
@ -366,8 +348,7 @@ public class QueryWorkbasketAccTest extends AbstractAccTest {
@WithAccessId(
userName = "max")
@Test
public void testQueryWorkbasketByNameStartsWithSortedByKeyDescending()
throws SQLException, NotAuthorizedException, InvalidArgumentException {
public void testQueryWorkbasketByNameStartsWithSortedByKeyDescending() {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
List<WorkbasketSummary> results = workbasketService.createWorkbasketQuery()
.nameLike("basxet%")
@ -389,8 +370,7 @@ public class QueryWorkbasketAccTest extends AbstractAccTest {
userName = "teamlead_1",
groupNames = {"group_1"})
@Test
public void testQueryWorkbasketByCreated()
throws SQLException, NotAuthorizedException, InvalidArgumentException {
public void testQueryWorkbasketByCreated() {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
List<WorkbasketSummary> results = workbasketService.createWorkbasketQuery()
.createdWithin(todaysInterval())
@ -402,8 +382,7 @@ public class QueryWorkbasketAccTest extends AbstractAccTest {
userName = "teamlead_1",
groupNames = {"group_1"})
@Test
public void testQueryWorkbasketByModified()
throws SQLException, NotAuthorizedException, InvalidArgumentException {
public void testQueryWorkbasketByModified() {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
List<WorkbasketSummary> results = workbasketService.createWorkbasketQuery()
.modifiedWithin(todaysInterval())
@ -416,7 +395,7 @@ public class QueryWorkbasketAccTest extends AbstractAccTest {
groupNames = "admin")
@Test
public void testQueryWorkbasketByAdmin()
throws SQLException, NotAuthorizedException, InvalidArgumentException {
throws NotAuthorizedException, InvalidArgumentException {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
List<WorkbasketSummary> results = workbasketService.createWorkbasketQuery()
.nameLike("%")

View File

@ -5,7 +5,6 @@ import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import java.sql.SQLException;
import java.util.List;
import org.junit.Assert;
@ -17,7 +16,6 @@ import pro.taskana.BaseQuery.SortDirection;
import pro.taskana.WorkbasketAccessItem;
import pro.taskana.WorkbasketAccessItemQuery;
import pro.taskana.WorkbasketService;
import pro.taskana.exceptions.InvalidArgumentException;
import pro.taskana.exceptions.NotAuthorizedException;
import pro.taskana.security.JAASRunner;
import pro.taskana.security.WithAccessId;
@ -60,7 +58,7 @@ public class QueryWorkbasketAccessItemsAccTest extends AbstractAccTest {
groupNames = {"businessadmin"})
@Test
public void testQueryAccessItemsForAccessIds()
throws SQLException, NotAuthorizedException, InvalidArgumentException {
throws NotAuthorizedException {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
List<WorkbasketAccessItem> results = workbasketService.createWorkbasketAccessItemQuery()
.accessIdIn("user_1_1", "group_1")
@ -72,7 +70,7 @@ public class QueryWorkbasketAccessItemsAccTest extends AbstractAccTest {
userName = "dummy")
@Test(expected = NotAuthorizedException.class)
public void testQueryAccessItemsForAccessIdsNotAuthorized()
throws SQLException, NotAuthorizedException, InvalidArgumentException {
throws NotAuthorizedException {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
workbasketService.createWorkbasketAccessItemQuery()
.accessIdIn("user_1_1", "group_1")
@ -85,7 +83,7 @@ public class QueryWorkbasketAccessItemsAccTest extends AbstractAccTest {
groupNames = {"businessadmin"})
@Test
public void testQueryAccessItemsForAccessIdsOrderedAscending()
throws SQLException, NotAuthorizedException, InvalidArgumentException {
throws NotAuthorizedException {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
WorkbasketAccessItemQuery query = workbasketService.createWorkbasketAccessItemQuery()
.accessIdIn("user_1_1", "group_1")
@ -103,7 +101,7 @@ public class QueryWorkbasketAccessItemsAccTest extends AbstractAccTest {
groupNames = {"businessadmin"})
@Test
public void testQueryAccessItemsForAccessIdsAndWorkbasketKey()
throws SQLException, NotAuthorizedException, InvalidArgumentException {
throws NotAuthorizedException {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
List<WorkbasketAccessItem> results = workbasketService.createWorkbasketAccessItemQuery()
.accessIdIn("user_1_1", "group_1")
@ -117,7 +115,7 @@ public class QueryWorkbasketAccessItemsAccTest extends AbstractAccTest {
groupNames = {"businessadmin"})
@Test
public void testQueryAccessItemsByWorkbasketKey()
throws SQLException, NotAuthorizedException, InvalidArgumentException {
throws NotAuthorizedException {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
List<WorkbasketAccessItem> results = workbasketService.createWorkbasketAccessItemQuery()
.workbasketIdIn("WBI:100000000000000000000000000000000006")
@ -130,7 +128,7 @@ public class QueryWorkbasketAccessItemsAccTest extends AbstractAccTest {
groupNames = {"businessadmin"})
@Test
public void testQueryAccessItemsByWorkbasketKeyOrderedDescending()
throws SQLException, NotAuthorizedException, InvalidArgumentException {
throws NotAuthorizedException {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
List<WorkbasketAccessItem> results = workbasketService.createWorkbasketAccessItemQuery()
.workbasketIdIn("WBI:100000000000000000000000000000000006")

View File

@ -2,7 +2,6 @@ package acceptance.workbasket;
import static org.junit.Assert.fail;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@ -40,7 +39,7 @@ public class QueryWorkbasketByPermissionAccTest extends AbstractAccTest {
groupNames = {"businessadmin"})
@Test
public void testQueryAllTransferTargetsForUser()
throws SQLException, NotAuthorizedException, InvalidArgumentException {
throws NotAuthorizedException, InvalidArgumentException {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
List<WorkbasketSummary> results = workbasketService.createWorkbasketQuery()
.accessIdsHavePermission(WorkbasketPermission.APPEND, "user_1_1")
@ -53,7 +52,7 @@ public class QueryWorkbasketByPermissionAccTest extends AbstractAccTest {
userName = "dummy")
@Test(expected = NotAuthorizedException.class)
public void testQueryAllTransferTargetsForUserNotAuthorized()
throws SQLException, NotAuthorizedException, InvalidArgumentException {
throws NotAuthorizedException, InvalidArgumentException {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
workbasketService.createWorkbasketQuery()
.accessIdsHavePermission(WorkbasketPermission.APPEND, "user_1_1")
@ -66,7 +65,7 @@ public class QueryWorkbasketByPermissionAccTest extends AbstractAccTest {
groupNames = {"businessadmin"})
@Test
public void testQueryAllTransferTargetsForUserAndGroup()
throws SQLException, NotAuthorizedException, InvalidArgumentException, SystemException {
throws NotAuthorizedException, InvalidArgumentException, SystemException {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
List<WorkbasketSummary> results = workbasketService.createWorkbasketQuery()
.accessIdsHavePermission(WorkbasketPermission.APPEND, "user_1_1", "group_1")
@ -79,7 +78,7 @@ public class QueryWorkbasketByPermissionAccTest extends AbstractAccTest {
groupNames = {"businessadmin"})
@Test
public void testQueryAllTransferTargetsForUserAndGroupSortedByNameAscending()
throws SQLException, NotAuthorizedException, InvalidArgumentException, SystemException {
throws NotAuthorizedException, InvalidArgumentException, SystemException {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
List<WorkbasketSummary> results = workbasketService.createWorkbasketQuery()
.accessIdsHavePermission(WorkbasketPermission.APPEND, "user_1_1", "group_1")
@ -94,7 +93,7 @@ public class QueryWorkbasketByPermissionAccTest extends AbstractAccTest {
groupNames = {"businessadmin"})
@Test
public void testQueryAllTransferTargetsForUserAndGroupSortedByNameDescending()
throws SQLException, NotAuthorizedException, InvalidArgumentException, SystemException {
throws NotAuthorizedException, InvalidArgumentException, SystemException {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
List<WorkbasketSummary> results = workbasketService.createWorkbasketQuery()
.accessIdsHavePermission(WorkbasketPermission.APPEND, "user_1_1", "group_1")
@ -110,7 +109,7 @@ public class QueryWorkbasketByPermissionAccTest extends AbstractAccTest {
groupNames = {"businessadmin"})
@Test
public void testQueryAllTransferSourcesForUserAndGroup()
throws SQLException, NotAuthorizedException, InvalidArgumentException, SystemException {
throws NotAuthorizedException, InvalidArgumentException, SystemException {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
List<WorkbasketSummary> results = workbasketService.createWorkbasketQuery()
.accessIdsHavePermission(WorkbasketPermission.DISTRIBUTE, "user_1_1", "group_1")
@ -127,7 +126,7 @@ public class QueryWorkbasketByPermissionAccTest extends AbstractAccTest {
groupNames = {"group_1"})
@Test
public void testQueryAllTransferTargetsForUserAndGroupFromSubject()
throws SQLException, NotAuthorizedException, SystemException {
throws SystemException {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
List<WorkbasketSummary> results = workbasketService.createWorkbasketQuery()
.callerHasPermission(WorkbasketPermission.APPEND)
@ -137,8 +136,7 @@ public class QueryWorkbasketByPermissionAccTest extends AbstractAccTest {
@WithAccessId(userName = "user_1_1")
@Test
public void testQueryAllAvailableWorkbasketForOpeningForUserAndGroupFromSubject()
throws SQLException, NotAuthorizedException {
public void testQueryAllAvailableWorkbasketForOpeningForUserAndGroupFromSubject() {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
List<WorkbasketSummary> results = workbasketService.createWorkbasketQuery()
.callerHasPermission(WorkbasketPermission.READ)

View File

@ -3,7 +3,6 @@ package acceptance.workbasket;
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;
@ -13,7 +12,6 @@ import org.junit.runner.RunWith;
import acceptance.AbstractAccTest;
import pro.taskana.WorkbasketService;
import pro.taskana.WorkbasketSummary;
import pro.taskana.exceptions.InvalidArgumentException;
import pro.taskana.exceptions.NotAuthorizedException;
import pro.taskana.exceptions.TaskanaRuntimeException;
import pro.taskana.security.JAASRunner;
@ -33,8 +31,7 @@ public class QueryWorkbasketsWithPaginationAccTest extends AbstractAccTest {
userName = "teamlead_1",
groupNames = {"group_1"})
@Test
public void testGetFirstPageOfWorkbasketQueryWithOffset()
throws NotAuthorizedException {
public void testGetFirstPageOfWorkbasketQueryWithOffset() {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
List<WorkbasketSummary> results = workbasketService.createWorkbasketQuery()
.domainIn("DOMAIN_A")
@ -46,8 +43,7 @@ public class QueryWorkbasketsWithPaginationAccTest extends AbstractAccTest {
userName = "teamlead_1",
groupNames = {"group_1"})
@Test
public void testGetSecondPageOfWorkbasketQueryWithOffset()
throws NotAuthorizedException {
public void testGetSecondPageOfWorkbasketQueryWithOffset() {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
List<WorkbasketSummary> results = workbasketService.createWorkbasketQuery()
.domainIn("DOMAIN_A")
@ -59,7 +55,7 @@ public class QueryWorkbasketsWithPaginationAccTest extends AbstractAccTest {
userName = "teamlead_1",
groupNames = {"group_1"})
@Test
public void testListOffsetAndLimitOutOfBounds() throws NotAuthorizedException {
public void testListOffsetAndLimitOutOfBounds() {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
// both will be 0, working
@ -85,7 +81,7 @@ public class QueryWorkbasketsWithPaginationAccTest extends AbstractAccTest {
userName = "teamlead_1",
groupNames = {"group_1"})
@Test
public void testPaginationWithPages() throws NotAuthorizedException {
public void testPaginationWithPages() {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
// Getting full page
@ -125,8 +121,7 @@ public class QueryWorkbasketsWithPaginationAccTest extends AbstractAccTest {
userName = "teamlead_1",
groupNames = {"group_1"})
@Test
public void testPaginationNullAndNegativeLimitsIgnoring()
throws NotAuthorizedException {
public void testPaginationNullAndNegativeLimitsIgnoring() {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
// 0 limit/size = 0 results
@ -163,7 +158,7 @@ public class QueryWorkbasketsWithPaginationAccTest extends AbstractAccTest {
@Ignore
@Test(expected = TaskanaRuntimeException.class)
public void testPaginationThrowingExceptionWhenPageOutOfBounds()
throws SQLException, NotAuthorizedException, InvalidArgumentException {
throws NotAuthorizedException {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
// entrypoint set outside result amount
@ -178,8 +173,7 @@ public class QueryWorkbasketsWithPaginationAccTest extends AbstractAccTest {
userName = "teamlead_1",
groupNames = {"group_1"})
@Test
public void testCountOfWorkbasketQuery()
throws SQLException, NotAuthorizedException, InvalidArgumentException {
public void testCountOfWorkbasketQuery() {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
long count = workbasketService.createWorkbasketQuery()
.domainIn("DOMAIN_A")
@ -191,8 +185,7 @@ public class QueryWorkbasketsWithPaginationAccTest extends AbstractAccTest {
userName = "teamlead_1",
groupNames = {"group_1"})
@Test
public void testWorkbasketQueryDomA()
throws SQLException, NotAuthorizedException, InvalidArgumentException {
public void testWorkbasketQueryDomA() {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
List<WorkbasketSummary> result = workbasketService.createWorkbasketQuery()
.domainIn("DOMAIN_A")

View File

@ -1,6 +1,5 @@
package acceptance.workbasket;
import java.sql.SQLException;
import java.time.Instant;
import org.junit.Assert;
@ -11,7 +10,6 @@ import acceptance.AbstractAccTest;
import pro.taskana.Workbasket;
import pro.taskana.WorkbasketService;
import pro.taskana.WorkbasketType;
import pro.taskana.exceptions.InvalidArgumentException;
import pro.taskana.exceptions.InvalidWorkbasketException;
import pro.taskana.exceptions.NotAuthorizedException;
import pro.taskana.exceptions.WorkbasketNotFoundException;
@ -33,8 +31,7 @@ public class UpdateWorkbasketAccTest extends AbstractAccTest {
groupNames = {"group_1", "businessadmin"})
@Test
public void testUpdateWorkbasket()
throws SQLException, NotAuthorizedException, InvalidArgumentException, WorkbasketNotFoundException,
InvalidWorkbasketException {
throws NotAuthorizedException, WorkbasketNotFoundException, InvalidWorkbasketException {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
Workbasket workbasket = workbasketService.getWorkbasket("GPK_KSC", "DOMAIN_A");
Instant modified = workbasket.getModified();
@ -66,8 +63,7 @@ public class UpdateWorkbasketAccTest extends AbstractAccTest {
groupNames = {"group_1"})
@Test(expected = NotAuthorizedException.class)
public void testCheckAuthorizationToUpdateWorkbasket()
throws SQLException, NotAuthorizedException, InvalidArgumentException, WorkbasketNotFoundException,
InvalidWorkbasketException {
throws NotAuthorizedException, WorkbasketNotFoundException, InvalidWorkbasketException {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
Workbasket workbasket = workbasketService.getWorkbasket("USER_1_1", "DOMAIN_A");

View File

@ -7,7 +7,6 @@ import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import java.sql.SQLException;
import java.util.List;
import org.junit.Assert;
@ -23,7 +22,6 @@ import pro.taskana.WorkbasketAccessItem;
import pro.taskana.WorkbasketService;
import pro.taskana.exceptions.ClassificationNotFoundException;
import pro.taskana.exceptions.InvalidArgumentException;
import pro.taskana.exceptions.InvalidWorkbasketException;
import pro.taskana.exceptions.NotAuthorizedException;
import pro.taskana.exceptions.NotAuthorizedToQueryWorkbasketException;
import pro.taskana.exceptions.TaskAlreadyExistException;
@ -83,8 +81,7 @@ public class UpdateWorkbasketAuthorizationsAccTest extends AbstractAccTest {
groupNames = {"group_1", "businessadmin"})
@Test
public void testUpdateWorkbasketAccessItemRejected()
throws SQLException, NotAuthorizedException, InvalidArgumentException, WorkbasketNotFoundException,
InvalidWorkbasketException {
throws NotAuthorizedException, InvalidArgumentException, WorkbasketNotFoundException {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
WorkbasketAccessItem accessItem = workbasketService
.newWorkbasketAccessItem("WBI:100000000000000000000000000000000001", "user1");
@ -125,8 +122,8 @@ public class UpdateWorkbasketAuthorizationsAccTest extends AbstractAccTest {
groupNames = {"group_2", "businessadmin"})
@Test
public void testUpdatedAccessItemLeadsToNotAuthorizedException()
throws SQLException, NotAuthorizedException, InvalidArgumentException, WorkbasketNotFoundException,
ClassificationNotFoundException, TaskAlreadyExistException, InvalidWorkbasketException {
throws NotAuthorizedException, InvalidArgumentException, WorkbasketNotFoundException,
ClassificationNotFoundException, TaskAlreadyExistException {
TaskService taskService = taskanaEngine.getTaskService();
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();

View File

@ -13,7 +13,6 @@ import acceptance.AbstractAccTest;
import pro.taskana.BaseQuery.SortDirection;
import pro.taskana.WorkbasketService;
import pro.taskana.WorkbasketSummary;
import pro.taskana.exceptions.NotAuthorizedException;
import pro.taskana.security.JAASRunner;
/**
@ -31,8 +30,7 @@ public class WorkbasketQueryWithOrderedPaginationAccTest extends AbstractAccTest
@Ignore
@Test
public void testGetFirstPageOfTaskQueryWithOffset()
throws NotAuthorizedException {
public void testGetFirstPageOfTaskQueryWithOffset() {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
List<WorkbasketSummary> results = workbasketService.createWorkbasketQuery()
.domainIn("DOMAIN_A")
@ -53,8 +51,7 @@ public class WorkbasketQueryWithOrderedPaginationAccTest extends AbstractAccTest
@Ignore
@Test
public void testGetSecondPageOfTaskQueryWithOffset()
throws NotAuthorizedException {
public void testGetSecondPageOfTaskQueryWithOffset() {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
List<WorkbasketSummary> results = workbasketService.createWorkbasketQuery()
.domainIn("DOMAIN_A")

View File

@ -15,8 +15,6 @@ import org.mockito.Mock;
import org.mockito.junit.MockitoJUnitRunner;
import pro.taskana.ClassificationSummary;
import pro.taskana.exceptions.InvalidArgumentException;
import pro.taskana.exceptions.NotAuthorizedException;
/**
* Test for ClassificationQueryImpl.
@ -40,7 +38,7 @@ public class ClassificationQueryImplTest {
}
@Test
public void should_ReturnList_when_BuilderIsUsed() throws NotAuthorizedException, InvalidArgumentException {
public void should_ReturnList_when_BuilderIsUsed() {
when(taskanaEngine.getSqlSession()).thenReturn(sqlSession);
when(sqlSession.selectList(any(), any())).thenReturn(new ArrayList<>());
@ -53,8 +51,7 @@ public class ClassificationQueryImplTest {
}
@Test
public void should_ReturnListWithOffset_when_BuilderIsUsed()
throws NotAuthorizedException, InvalidArgumentException {
public void should_ReturnListWithOffset_when_BuilderIsUsed() {
when(taskanaEngine.getSqlSession()).thenReturn(sqlSession);
when(sqlSession.selectList(any(), any(), any())).thenReturn(new ArrayList<>());
@ -67,7 +64,7 @@ public class ClassificationQueryImplTest {
}
@Test
public void should_ReturnOneItem_when_BuilderIsUsed() throws NotAuthorizedException, InvalidArgumentException {
public void should_ReturnOneItem_when_BuilderIsUsed() {
when(taskanaEngine.getSqlSession()).thenReturn(sqlSession);
when(sqlSession.selectOne(any(), any())).thenReturn(new ClassificationSummaryImpl());

View File

@ -215,7 +215,7 @@ public class ClassificationServiceImplTest {
@Test(expected = ClassificationNotFoundException.class)
public void testUpdateClassificationParentNotExisting()
throws ClassificationAlreadyExistException, ClassificationNotFoundException, NotAuthorizedException,
throws ClassificationNotFoundException, NotAuthorizedException,
ConcurrencyException, InvalidArgumentException {
Instant now = Instant.now();
ClassificationImpl oldClassification = (ClassificationImpl) createDummyClassification();

View File

@ -15,9 +15,6 @@ import org.mockito.Mock;
import org.mockito.junit.MockitoJUnitRunner;
import pro.taskana.ObjectReference;
import pro.taskana.exceptions.InvalidArgumentException;
import pro.taskana.exceptions.NotAuthorizedException;
/**
* Test for ObjectReferenceQueryImpl.
*
@ -40,7 +37,7 @@ public class ObjectReferenceQueryImplTest {
}
@Test
public void should_ReturnList_when_BuilderIsUsed() throws NotAuthorizedException, InvalidArgumentException {
public void should_ReturnList_when_BuilderIsUsed() {
when(taskanaEngine.getSqlSession()).thenReturn(sqlSession);
when(sqlSession.selectList(any(), any())).thenReturn(new ArrayList<>());
@ -53,8 +50,7 @@ public class ObjectReferenceQueryImplTest {
}
@Test
public void should_ReturnListWithOffset_when_BuilderIsUsed()
throws NotAuthorizedException, InvalidArgumentException {
public void should_ReturnListWithOffset_when_BuilderIsUsed() {
when(taskanaEngine.getSqlSession()).thenReturn(sqlSession);
when(sqlSession.selectList(any(), any(), any())).thenReturn(new ArrayList<>());
@ -67,7 +63,7 @@ public class ObjectReferenceQueryImplTest {
}
@Test
public void should_ReturnOneItem_when_BuilderIsUsed() throws NotAuthorizedException, InvalidArgumentException {
public void should_ReturnOneItem_when_BuilderIsUsed() {
when(taskanaEngine.getSqlSession()).thenReturn(sqlSession);
when(sqlSession.selectOne(any(), any())).thenReturn(new ObjectReference());

View File

@ -18,8 +18,6 @@ import org.mockito.junit.MockitoJUnitRunner;
import pro.taskana.TaskState;
import pro.taskana.TaskSummary;
import pro.taskana.exceptions.InvalidArgumentException;
import pro.taskana.exceptions.NotAuthorizedException;
/**
* Test for TaskQueryImpl.
@ -51,7 +49,7 @@ public class TaskQueryImplTest {
}
@Test
public void should_ReturnList_when_BuilderIsUsed() throws NotAuthorizedException, InvalidArgumentException {
public void should_ReturnList_when_BuilderIsUsed() {
when(taskanaEngine.getSqlSession()).thenReturn(sqlSession);
when(sqlSession.selectList(any(), any())).thenReturn(new ArrayList<>());
List<TaskSummary> intermediate = new ArrayList<>();
@ -66,8 +64,7 @@ public class TaskQueryImplTest {
}
@Test
public void should_ReturnListWithOffset_when_BuilderIsUsed()
throws NotAuthorizedException, InvalidArgumentException {
public void should_ReturnListWithOffset_when_BuilderIsUsed() {
when(taskanaEngine.getSqlSession()).thenReturn(sqlSession);
when(sqlSession.selectList(any(), any(), any())).thenReturn(new ArrayList<>());
List<TaskSummary> intermediate = new ArrayList<>();
@ -82,7 +79,7 @@ public class TaskQueryImplTest {
}
@Test
public void should_ReturnOneItem_when_BuilderIsUsed() throws NotAuthorizedException, InvalidArgumentException {
public void should_ReturnOneItem_when_BuilderIsUsed() {
when(taskanaEngine.getSqlSession()).thenReturn(sqlSession);
when(sqlSession.selectOne(any(), any())).thenReturn(new TaskSummaryImpl());
List<TaskSummary> intermediate = new ArrayList<>();

View File

@ -47,13 +47,11 @@ import pro.taskana.WorkbasketService;
import pro.taskana.WorkbasketSummary;
import pro.taskana.configuration.TaskanaEngineConfiguration;
import pro.taskana.exceptions.AttachmentPersistenceException;
import pro.taskana.exceptions.ClassificationAlreadyExistException;
import pro.taskana.exceptions.ClassificationNotFoundException;
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.SystemException;
import pro.taskana.exceptions.TaskAlreadyExistException;
@ -123,8 +121,7 @@ public class TaskServiceImplTest {
@Test
public void testCreateSimpleTask() throws NotAuthorizedException, WorkbasketNotFoundException,
ClassificationNotFoundException, ClassificationAlreadyExistException, TaskAlreadyExistException,
TaskNotFoundException, InvalidWorkbasketException, InvalidArgumentException {
ClassificationNotFoundException, TaskAlreadyExistException, TaskNotFoundException, InvalidArgumentException {
TaskServiceImpl cutSpy = Mockito.spy(cut);
Classification dummyClassification = createDummyClassification();
TaskImpl expectedTask = createUnitTestTask("", "DUMMYTASK", "k1", dummyClassification);
@ -170,8 +167,7 @@ public class TaskServiceImplTest {
@Test(expected = SystemException.class)
public void testCreateTaskWithSecurityButNoUserId()
throws TaskNotFoundException, WorkbasketNotFoundException, NotAuthorizedException,
ClassificationNotFoundException, TaskAlreadyExistException, InvalidWorkbasketException,
InvalidArgumentException {
ClassificationNotFoundException, TaskAlreadyExistException, InvalidArgumentException {
TaskServiceImpl cutSpy = Mockito.spy(cut);
Classification dummyClassification = createDummyClassification();
TaskImpl expectedTask = createUnitTestTask("", "DUMMYTASK", "k1", dummyClassification);
@ -195,8 +191,7 @@ public class TaskServiceImplTest {
@Test
public void testCreateSimpleTaskWithObjectReference() throws NotAuthorizedException, WorkbasketNotFoundException,
ClassificationNotFoundException, ClassificationAlreadyExistException, TaskAlreadyExistException,
TaskNotFoundException, InvalidWorkbasketException, InvalidArgumentException {
ClassificationNotFoundException, TaskAlreadyExistException, TaskNotFoundException, InvalidArgumentException {
TaskServiceImpl cutSpy = Mockito.spy(cut);
ObjectReference expectedObjectReference = JunitHelper.createDefaultObjRef();
WorkbasketImpl wb = new WorkbasketImpl();
@ -248,8 +243,8 @@ public class TaskServiceImplTest {
@Test
public void testCreateSimpleTaskWithObjectReferenceIsNull() throws NotAuthorizedException,
WorkbasketNotFoundException, ClassificationNotFoundException, ClassificationAlreadyExistException,
TaskAlreadyExistException, TaskNotFoundException, InvalidWorkbasketException, InvalidArgumentException {
WorkbasketNotFoundException, ClassificationNotFoundException, TaskAlreadyExistException, TaskNotFoundException,
InvalidArgumentException {
TaskServiceImpl cutSpy = Mockito.spy(cut);
ObjectReference expectedObjectReference = JunitHelper.createDefaultObjRef();
WorkbasketImpl wb = new WorkbasketImpl();
@ -303,7 +298,7 @@ public class TaskServiceImplTest {
@Test
public void testCreateTaskWithPlanned()
throws NotAuthorizedException, WorkbasketNotFoundException, ClassificationNotFoundException,
TaskAlreadyExistException, TaskNotFoundException, InvalidWorkbasketException, InvalidArgumentException {
TaskAlreadyExistException, TaskNotFoundException, InvalidArgumentException {
TaskServiceImpl cutSpy = Mockito.spy(cut);
ObjectReference expectedObjectReference = JunitHelper.createDefaultObjRef();
@ -376,7 +371,7 @@ public class TaskServiceImplTest {
@Test(expected = TaskAlreadyExistException.class)
public void testCreateTaskThrowingAlreadyExistException() throws WorkbasketNotFoundException,
ClassificationNotFoundException, NotAuthorizedException, TaskAlreadyExistException, TaskNotFoundException,
InvalidWorkbasketException, InvalidArgumentException {
InvalidArgumentException {
TaskServiceImpl cutSpy = Mockito.spy(cut);
Classification dummyClassification = createDummyClassification();
TaskImpl task = createUnitTestTask("12", "Task Name", "1", dummyClassification);
@ -399,7 +394,7 @@ public class TaskServiceImplTest {
@Test(expected = NotAuthorizedException.class)
public void testCreateThrowingAuthorizedOnWorkbasket()
throws NotAuthorizedException, WorkbasketNotFoundException, ClassificationNotFoundException,
TaskAlreadyExistException, TaskNotFoundException, InvalidWorkbasketException, InvalidArgumentException {
TaskAlreadyExistException, TaskNotFoundException, InvalidArgumentException {
TaskServiceImpl cutSpy = Mockito.spy(cut);
Classification dummyClassification = createDummyClassification();
TaskImpl task = createUnitTestTask("", "dummyTask", "1", dummyClassification);
@ -430,7 +425,7 @@ public class TaskServiceImplTest {
@Test(expected = WorkbasketNotFoundException.class)
public void testCreateThrowsWorkbasketNotFoundException()
throws NotAuthorizedException, WorkbasketNotFoundException, ClassificationNotFoundException,
InvalidWorkbasketException, TaskAlreadyExistException, TaskNotFoundException, InvalidArgumentException {
TaskAlreadyExistException, TaskNotFoundException, InvalidArgumentException {
TaskServiceImpl cutSpy = Mockito.spy(cut);
Classification dummyClassification = createDummyClassification();
TaskImpl task = createUnitTestTask("", "dumma-task", "1", dummyClassification);
@ -679,7 +674,7 @@ public class TaskServiceImplTest {
@Test
public void testCompleteTaskDefault()
throws TaskNotFoundException, InvalidOwnerException, InvalidStateException, InterruptedException,
ClassificationNotFoundException, NotAuthorizedException {
NotAuthorizedException {
TaskServiceImpl cutSpy = Mockito.spy(cut);
final long sleepTime = 100L;
Classification dummyClassification = createDummyClassification();
@ -733,7 +728,7 @@ public class TaskServiceImplTest {
@Test
public void testCompleteTaskNotForcedWorking()
throws TaskNotFoundException, InvalidStateException, InvalidOwnerException, InterruptedException,
ClassificationNotFoundException, NotAuthorizedException {
NotAuthorizedException {
TaskServiceImpl cutSpy = Mockito.spy(cut);
final long sleepTime = 100L;
Classification dummyClassification = createDummyClassification();
@ -764,8 +759,7 @@ public class TaskServiceImplTest {
@Test(expected = InvalidStateException.class)
public void testCompleteTaskNotForcedNotClaimedBefore()
throws TaskNotFoundException, InvalidStateException, InvalidOwnerException, ClassificationNotFoundException,
NotAuthorizedException {
throws TaskNotFoundException, InvalidStateException, InvalidOwnerException, NotAuthorizedException {
TaskServiceImpl cutSpy = Mockito.spy(cut);
Classification dummyClassification = createDummyClassification();
TaskImpl task = createUnitTestTask("1", "Unit Test Task 1", "1", dummyClassification);
@ -789,8 +783,7 @@ public class TaskServiceImplTest {
@Test(expected = InvalidOwnerException.class)
public void testCompleteTaskNotForcedInvalidOwnerException()
throws TaskNotFoundException, InvalidStateException, InvalidOwnerException, ClassificationNotFoundException,
NotAuthorizedException {
throws TaskNotFoundException, InvalidStateException, InvalidOwnerException, NotAuthorizedException {
TaskServiceImpl cutSpy = Mockito.spy(cut);
Classification dummyClassification = createDummyClassification();
TaskImpl task = createUnitTestTask("1", "Unit Test Task 1", "1", dummyClassification);
@ -815,8 +808,7 @@ public class TaskServiceImplTest {
@Test(expected = TaskNotFoundException.class)
public void testCompleteTaskTaskNotFound()
throws TaskNotFoundException, InvalidStateException, InvalidOwnerException, ClassificationNotFoundException,
NotAuthorizedException {
throws TaskNotFoundException, InvalidStateException, InvalidOwnerException, NotAuthorizedException {
TaskServiceImpl cutSpy = Mockito.spy(cut);
String taskId = "1";
doThrow(TaskNotFoundException.class).when(cutSpy).getTask(taskId);
@ -837,7 +829,7 @@ public class TaskServiceImplTest {
@Test
public void testCompleteForcedAndAlreadyClaimed()
throws TaskNotFoundException, InvalidStateException, InvalidOwnerException, InterruptedException,
ClassificationNotFoundException, NotAuthorizedException {
NotAuthorizedException {
final long sleepTime = 100L;
TaskServiceImpl cutSpy = Mockito.spy(cut);
Classification dummyClassification = createDummyClassification();
@ -868,7 +860,7 @@ public class TaskServiceImplTest {
@Test
public void testCompleteForcedNotClaimed()
throws TaskNotFoundException, InvalidStateException, InvalidOwnerException, InterruptedException,
ClassificationNotFoundException, NotAuthorizedException {
NotAuthorizedException {
TaskServiceImpl cutSpy = Mockito.spy(cut);
final long sleepTime = 100L;
Classification dummyClassification = createDummyClassification();
@ -902,9 +894,7 @@ public class TaskServiceImplTest {
@Test
public void testTransferTaskToDestinationWorkbasketWithoutSecurity()
throws TaskNotFoundException, WorkbasketNotFoundException, NotAuthorizedException,
ClassificationAlreadyExistException, InvalidWorkbasketException, ClassificationNotFoundException,
InvalidStateException {
throws TaskNotFoundException, WorkbasketNotFoundException, NotAuthorizedException, InvalidStateException {
TaskServiceImpl cutSpy = Mockito.spy(cut);
Workbasket destinationWorkbasket = createWorkbasket("2", "k1");
Workbasket sourceWorkbasket = createWorkbasket("47", "key47");
@ -945,9 +935,7 @@ public class TaskServiceImplTest {
@Test
public void testTransferTaskToDestinationWorkbasketUsingSecurityTrue()
throws TaskNotFoundException, WorkbasketNotFoundException, NotAuthorizedException,
ClassificationAlreadyExistException, InvalidWorkbasketException, ClassificationNotFoundException,
InvalidStateException {
throws TaskNotFoundException, WorkbasketNotFoundException, NotAuthorizedException, InvalidStateException {
TaskServiceImpl cutSpy = Mockito.spy(cut);
Workbasket destinationWorkbasket = createWorkbasket("2", "k2");
Classification dummyClassification = createDummyClassification();
@ -1088,8 +1076,7 @@ public class TaskServiceImplTest {
@Test
public void testSetTaskReadWIthExistingTask()
throws TaskNotFoundException, ClassificationAlreadyExistException, ClassificationNotFoundException,
NotAuthorizedException {
throws TaskNotFoundException, NotAuthorizedException {
TaskServiceImpl cutSpy = Mockito.spy(cut);
Classification dummyClassification = createDummyClassification();
TaskImpl task = createUnitTestTask("1", "Unit Test Task 1", "1", dummyClassification);
@ -1132,8 +1119,7 @@ public class TaskServiceImplTest {
@Test
public void testGetTaskByIdWithExistingTask()
throws TaskNotFoundException, ClassificationAlreadyExistException, ClassificationNotFoundException,
NotAuthorizedException {
throws TaskNotFoundException, NotAuthorizedException {
Classification dummyClassification = createDummyClassification();
Task expectedTask = createUnitTestTask("1", "DUMMY-TASK", "1", dummyClassification);
doReturn(expectedTask).when(taskMapperMock).findById(expectedTask.getId());
@ -1196,7 +1182,7 @@ public class TaskServiceImplTest {
@Test
public void testUpdateTaskAddingValidAttachment() throws TaskNotFoundException, SystemException,
WorkbasketNotFoundException, ClassificationNotFoundException, InvalidArgumentException, ConcurrencyException,
InvalidWorkbasketException, NotAuthorizedException, AttachmentPersistenceException {
NotAuthorizedException, AttachmentPersistenceException {
Classification classification = createDummyClassification();
Workbasket wb = createWorkbasket("WB-ID", "WB-Key");
Attachment attachment = JunitHelper.createDefaultAttachment();
@ -1224,7 +1210,7 @@ public class TaskServiceImplTest {
@Test
public void testUpdateTaskAddingValidAttachmentTwice() throws TaskNotFoundException, SystemException,
WorkbasketNotFoundException, ClassificationNotFoundException, InvalidArgumentException, ConcurrencyException,
InvalidWorkbasketException, NotAuthorizedException, AttachmentPersistenceException {
NotAuthorizedException, AttachmentPersistenceException {
Classification classification = createDummyClassification();
Workbasket wb = createWorkbasket("WB-ID", "WB-Key");
Attachment attachment = JunitHelper.createDefaultAttachment();
@ -1254,7 +1240,7 @@ public class TaskServiceImplTest {
public void testUpdateTaskAddingAttachmentWithSameIdForcedUsingingListMethod()
throws TaskNotFoundException, SystemException,
WorkbasketNotFoundException, ClassificationNotFoundException, InvalidArgumentException, ConcurrencyException,
InvalidWorkbasketException, NotAuthorizedException, AttachmentPersistenceException {
NotAuthorizedException, AttachmentPersistenceException {
Classification classification = createDummyClassification();
Workbasket wb = createWorkbasket("WB-ID", "WB-Key");
Attachment attachment = JunitHelper.createDefaultAttachment();
@ -1287,7 +1273,7 @@ public class TaskServiceImplTest {
@Test
public void testUpdateTaskUpdateAttachment() throws TaskNotFoundException, SystemException,
WorkbasketNotFoundException, ClassificationNotFoundException, InvalidArgumentException, ConcurrencyException,
InvalidWorkbasketException, NotAuthorizedException, AttachmentPersistenceException {
NotAuthorizedException, AttachmentPersistenceException {
String channelUpdate = "OTHER CHANNEL";
Classification classification = createDummyClassification();
Workbasket wb = createWorkbasket("WB-ID", "WB-Key");
@ -1321,7 +1307,7 @@ public class TaskServiceImplTest {
@Test
public void testUpdateTaskRemovingAttachment() throws TaskNotFoundException, SystemException,
WorkbasketNotFoundException, ClassificationNotFoundException, InvalidArgumentException, ConcurrencyException,
InvalidWorkbasketException, NotAuthorizedException, AttachmentPersistenceException {
NotAuthorizedException, AttachmentPersistenceException {
Classification classification = createDummyClassification();
Workbasket wb = createWorkbasket("WB-ID", "WB-Key");
Attachment attachment = JunitHelper.createDefaultAttachment();

View File

@ -87,7 +87,7 @@ public class WorkbasketServiceImplTest {
private TaskanaEngineConfiguration taskanaEngineConfigurationMock;
@Before
public void setup() throws NotAuthorizedException {
public void setup() {
MockitoAnnotations.initMocks(this);
}
@ -222,7 +222,7 @@ public class WorkbasketServiceImplTest {
@Test
public void testCreateWorkbasket_InvalidWorkbasketCases()
throws WorkbasketNotFoundException, NotAuthorizedException, WorkbasketAlreadyExistException,
throws NotAuthorizedException, WorkbasketAlreadyExistException,
DomainNotFoundException {
WorkbasketImpl wb = new WorkbasketImpl();
int serviceCalls = 1;
@ -464,7 +464,7 @@ public class WorkbasketServiceImplTest {
@Test
public void testDeleteWorkbasketWithNullOrEmptyParam()
throws WorkbasketNotFoundException, NotAuthorizedException, WorkbasketInUseException, InvalidArgumentException {
throws WorkbasketNotFoundException, NotAuthorizedException, WorkbasketInUseException {
// null param
try {
cutSpy.deleteWorkbasket(null);
@ -579,7 +579,7 @@ public class WorkbasketServiceImplTest {
}
private List<String> createTestDistributionTargets(int amount)
throws WorkbasketNotFoundException, InvalidWorkbasketException, NotAuthorizedException,
throws InvalidWorkbasketException, NotAuthorizedException,
WorkbasketAlreadyExistException, DomainNotFoundException {
List<String> distributionsTargets = new ArrayList<>();
amount = (amount < 0) ? 0 : amount;

View File

@ -8,7 +8,6 @@ import java.io.InputStream;
import java.sql.SQLException;
import java.util.Properties;
import javax.security.auth.login.LoginException;
import javax.sql.DataSource;
import org.apache.ibatis.datasource.pooled.PooledDataSource;
@ -32,7 +31,7 @@ public class TaskanaEngineConfigurationTest {
private static final int POOL_TIME_TO_WAIT = 50;
@Test
public void testCreateTaskanaEngine() throws FileNotFoundException, SQLException, LoginException {
public void testCreateTaskanaEngine() throws SQLException {
DataSource ds = getDataSource();
TaskanaEngineConfiguration taskEngineConfiguration = new TaskanaEngineConfiguration(ds, false);
@ -45,13 +44,8 @@ public class TaskanaEngineConfigurationTest {
* returns the Datasource used for Junit test. If the file {user.home}/taskanaUnitTest.properties is present, the
* Datasource is created according to the properties jdbcDriver, jdbcUrl, dbUserName and dbPassword. Assuming, the
* database has the name tskdb, a sample properties file for DB2 looks as follows:
*
* jdbcDriver=com.ibm.db2.jcc.DB2Driver
* jdbcUrl=jdbc:db2://localhost:50000/tskdb
* dbUserName=db2user
* dbPassword=db2password
*
* If any of these properties is missing, or the file doesn't exist, the default Datasource
* jdbcDriver=com.ibm.db2.jcc.DB2Driver jdbcUrl=jdbc:db2://localhost:50000/tskdb dbUserName=db2user
* dbPassword=db2password If any of these properties is missing, or the file doesn't exist, the default Datasource
* for h2 in-memory db is created.
*
* @return dataSource for unit test

View File

@ -6,7 +6,6 @@ import static org.hamcrest.core.StringStartsWith.startsWith;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.fail;
import java.io.FileNotFoundException;
import java.sql.SQLException;
import java.time.Instant;
import java.time.LocalDate;
@ -15,7 +14,6 @@ import java.time.LocalTime;
import java.time.ZoneId;
import java.util.List;
import javax.security.auth.login.LoginException;
import javax.sql.DataSource;
import org.junit.Assert;
@ -64,7 +62,7 @@ public class ClassificationServiceImplIntAutoCommitTest {
}
@Before
public void setup() throws FileNotFoundException, SQLException, LoginException {
public void setup() throws SQLException {
dataSource = TaskanaEngineConfigurationTest.getDataSource();
taskanaEngineConfiguration = new TaskanaEngineConfiguration(dataSource, false, false);
taskanaEngine = taskanaEngineConfiguration.buildTaskanaEngine();
@ -401,8 +399,7 @@ public class ClassificationServiceImplIntAutoCommitTest {
return new TimeInterval(begin, end);
}
private Classification createDummyClassificationWithUniqueKey(String domain, String type)
throws NotAuthorizedException {
private Classification createDummyClassificationWithUniqueKey(String domain, String type) {
Classification classification = classificationService.newClassification("TEST" + counter, domain, type);
counter++;
return classification;

View File

@ -440,8 +440,7 @@ public class ClassificationServiceImplIntExplicitTest {
taskanaEngineImpl.setConnection(null);
}
private Classification createNewClassificationWithUniqueKey(String domain, String type)
throws NotAuthorizedException {
private Classification createNewClassificationWithUniqueKey(String domain, String type) {
Classification classification = classificationService.newClassification("TEST" + counter, domain, type);
counter++;
return classification;

View File

@ -5,12 +5,10 @@ import static org.hamcrest.CoreMatchers.not;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.fail;
import java.io.FileNotFoundException;
import java.sql.SQLException;
import java.util.List;
import java.util.UUID;
import javax.security.auth.login.LoginException;
import javax.sql.DataSource;
import org.junit.Assert;
@ -81,7 +79,7 @@ public class TaskServiceImplIntAutocommitTest {
}
@Before
public void setup() throws FileNotFoundException, SQLException, LoginException {
public void setup() throws SQLException {
dataSource = TaskanaEngineConfigurationTest.getDataSource();
taskanaEngineConfiguration = new TaskanaEngineConfiguration(dataSource, false, false);
@ -96,7 +94,7 @@ public class TaskServiceImplIntAutocommitTest {
}
@Test
public void testStart() throws FileNotFoundException, SQLException, TaskNotFoundException,
public void testStart() throws TaskNotFoundException,
WorkbasketNotFoundException, NotAuthorizedException, ClassificationNotFoundException,
ClassificationAlreadyExistException, TaskAlreadyExistException, InvalidWorkbasketException,
InvalidArgumentException, WorkbasketAlreadyExistException, DomainNotFoundException {
@ -123,7 +121,7 @@ public class TaskServiceImplIntAutocommitTest {
@Test(expected = TaskNotFoundException.class)
public void testStartTransactionFail()
throws FileNotFoundException, SQLException, TaskNotFoundException, NotAuthorizedException,
throws TaskNotFoundException, NotAuthorizedException,
WorkbasketNotFoundException, ClassificationNotFoundException, ClassificationAlreadyExistException,
TaskAlreadyExistException, InvalidWorkbasketException, InvalidArgumentException,
WorkbasketAlreadyExistException, DomainNotFoundException {
@ -153,7 +151,7 @@ public class TaskServiceImplIntAutocommitTest {
@Test
public void testCreateTaskInTaskanaWithDefaultDb()
throws FileNotFoundException, SQLException, TaskNotFoundException, NotAuthorizedException,
throws SQLException, NotAuthorizedException,
WorkbasketNotFoundException, ClassificationNotFoundException, ClassificationAlreadyExistException,
TaskAlreadyExistException, InvalidWorkbasketException, InvalidArgumentException,
WorkbasketAlreadyExistException, DomainNotFoundException {
@ -182,7 +180,7 @@ public class TaskServiceImplIntAutocommitTest {
}
@Test
public void should_ReturnList_when_BuilderIsUsed() throws SQLException, NotAuthorizedException,
public void should_ReturnList_when_BuilderIsUsed() throws NotAuthorizedException,
WorkbasketNotFoundException, ClassificationNotFoundException, ClassificationAlreadyExistException,
TaskAlreadyExistException, InvalidWorkbasketException, InvalidArgumentException, SystemException,
WorkbasketAlreadyExistException, DomainNotFoundException {
@ -279,8 +277,7 @@ public class TaskServiceImplIntAutocommitTest {
@Test(expected = TaskNotFoundException.class)
public void shouldNotTransferAnyTask()
throws WorkbasketNotFoundException, NotAuthorizedException, TaskNotFoundException, InvalidWorkbasketException,
ClassificationNotFoundException, InvalidStateException {
throws WorkbasketNotFoundException, NotAuthorizedException, TaskNotFoundException, InvalidStateException {
taskServiceImpl.transfer(UUID.randomUUID() + "_X", "1");
}
@ -373,7 +370,7 @@ public class TaskServiceImplIntAutocommitTest {
}
@Test
public void testWithPrimaryObjectRef() throws FileNotFoundException, SQLException, TaskNotFoundException,
public void testWithPrimaryObjectRef() throws TaskNotFoundException,
WorkbasketNotFoundException, NotAuthorizedException, ClassificationNotFoundException,
ClassificationAlreadyExistException, TaskAlreadyExistException, InvalidWorkbasketException,
InvalidArgumentException, WorkbasketAlreadyExistException, DomainNotFoundException {

View File

@ -5,13 +5,11 @@ import static org.hamcrest.CoreMatchers.not;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.fail;
import java.io.FileNotFoundException;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.List;
import java.util.UUID;
import javax.security.auth.login.LoginException;
import javax.sql.DataSource;
import org.junit.After;
@ -85,7 +83,7 @@ public class TaskServiceImplIntExplicitTest {
}
@Before
public void setup() throws FileNotFoundException, SQLException, LoginException {
public void setup() throws SQLException {
dataSource = TaskanaEngineConfigurationTest.getDataSource();
taskanaEngineConfiguration = new TaskanaEngineConfiguration(dataSource, false);
taskanaEngine = taskanaEngineConfiguration.buildTaskanaEngine();
@ -101,8 +99,8 @@ public class TaskServiceImplIntExplicitTest {
@WithAccessId(userName = "Elena", groupNames = {"businessadmin"})
@Test(expected = TaskNotFoundException.class)
public void testStartTransactionFail()
throws FileNotFoundException, SQLException, TaskNotFoundException, NotAuthorizedException,
WorkbasketNotFoundException, ClassificationNotFoundException, ClassificationAlreadyExistException,
throws SQLException, TaskNotFoundException, NotAuthorizedException, WorkbasketNotFoundException,
ClassificationNotFoundException, ClassificationAlreadyExistException,
TaskAlreadyExistException, InvalidWorkbasketException, InvalidArgumentException,
WorkbasketAlreadyExistException, DomainNotFoundException {
Connection connection = dataSource.getConnection();
@ -141,7 +139,7 @@ public class TaskServiceImplIntExplicitTest {
@WithAccessId(userName = "Elena", groupNames = {"businessadmin"})
@Test
public void testCreateTask()
throws FileNotFoundException, SQLException, TaskNotFoundException, NotAuthorizedException,
throws SQLException, TaskNotFoundException, NotAuthorizedException,
WorkbasketNotFoundException, ClassificationNotFoundException, ClassificationAlreadyExistException,
TaskAlreadyExistException, InvalidWorkbasketException, InvalidArgumentException,
WorkbasketAlreadyExistException, DomainNotFoundException {
@ -171,7 +169,7 @@ public class TaskServiceImplIntExplicitTest {
@WithAccessId(userName = "Elena", groupNames = {"businessadmin"})
@Test
public void testCreateTaskInTaskanaWithDefaultDb()
throws FileNotFoundException, SQLException, TaskNotFoundException, NotAuthorizedException,
throws SQLException, NotAuthorizedException,
WorkbasketNotFoundException, ClassificationNotFoundException, ClassificationAlreadyExistException,
TaskAlreadyExistException, InvalidWorkbasketException, InvalidArgumentException,
WorkbasketAlreadyExistException, DomainNotFoundException {
@ -368,7 +366,7 @@ public class TaskServiceImplIntExplicitTest {
@Test(expected = TaskNotFoundException.class)
public void shouldNotTransferAnyTask()
throws WorkbasketNotFoundException, NotAuthorizedException, TaskNotFoundException, SQLException,
InvalidWorkbasketException, ClassificationNotFoundException, InvalidStateException {
InvalidStateException {
Connection connection = dataSource.getConnection();
taskanaEngineImpl.setConnection(connection);
taskServiceImpl.transfer(UUID.randomUUID() + "_X", "1");
@ -462,7 +460,7 @@ public class TaskServiceImplIntExplicitTest {
}
private Task generateDummyTask() throws ClassificationAlreadyExistException, ClassificationNotFoundException,
WorkbasketNotFoundException, InvalidWorkbasketException, NotAuthorizedException,
InvalidWorkbasketException, NotAuthorizedException,
WorkbasketAlreadyExistException, DomainNotFoundException, InvalidArgumentException {
WorkbasketImpl workbasket = (WorkbasketImpl) workbasketService.newWorkbasket("wb", "DOMAIN_A");
workbasket.setName("wb");

View File

@ -1,6 +1,5 @@
package pro.taskana.impl.integration;
import java.io.FileNotFoundException;
import java.sql.SQLException;
import java.time.Duration;
import java.time.Instant;
@ -12,7 +11,6 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import javax.security.auth.login.LoginException;
import javax.sql.DataSource;
import org.apache.ibatis.session.SqlSession;
@ -73,7 +71,7 @@ public class WorkbasketServiceImplIntAutocommitTest {
}
@Before
public void setup() throws FileNotFoundException, SQLException, LoginException {
public void setup() throws SQLException {
dataSource = TaskanaEngineConfigurationTest.getDataSource();
taskanaEngineConfiguration = new TaskanaEngineConfiguration(dataSource, false);
taskanaEngine = taskanaEngineConfiguration.buildTaskanaEngine();
@ -87,7 +85,7 @@ public class WorkbasketServiceImplIntAutocommitTest {
@Test(expected = WorkbasketNotFoundException.class)
public void testGetWorkbasketFail()
throws WorkbasketNotFoundException, InvalidWorkbasketException, NotAuthorizedException {
throws WorkbasketNotFoundException, NotAuthorizedException {
workBasketService.getWorkbasket("fail");
}
@ -224,8 +222,7 @@ public class WorkbasketServiceImplIntAutocommitTest {
workBasketService.createWorkbasketAccessItem(accessItem);
}
private Workbasket createTestWorkbasket(String id, String key, String domain, String name, WorkbasketType type)
throws NotAuthorizedException {
private Workbasket createTestWorkbasket(String id, String key, String domain, String name, WorkbasketType type) {
WorkbasketImpl wb = (WorkbasketImpl) workBasketService.newWorkbasket(key, domain);
wb.setId(id);
wb.setName(name);

View File

@ -1,13 +1,11 @@
package pro.taskana.impl.integration;
import java.io.FileNotFoundException;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import javax.security.auth.login.LoginException;
import javax.sql.DataSource;
import org.junit.After;
@ -63,7 +61,7 @@ public class WorkbasketServiceImplIntExplicitTest {
}
@Before
public void setup() throws FileNotFoundException, SQLException, LoginException {
public void setup() throws SQLException {
dataSource = TaskanaEngineConfigurationTest.getDataSource();
taskanaEngineConfiguration = new TaskanaEngineConfiguration(dataSource, false);
taskanaEngine = taskanaEngineConfiguration.buildTaskanaEngine();
@ -178,8 +176,7 @@ public class WorkbasketServiceImplIntExplicitTest {
workBasketService.createWorkbasketAccessItem(accessItem);
}
private Workbasket createTestWorkbasket(String id, String key, String domain, String name, WorkbasketType type)
throws NotAuthorizedException {
private Workbasket createTestWorkbasket(String id, String key, String domain, String name, WorkbasketType type) {
WorkbasketImpl wb = (WorkbasketImpl) workBasketService.newWorkbasket(key, domain);
wb.setId(id);
wb.setName(name);

View File

@ -10,7 +10,6 @@ import pro.taskana.exceptions.ClassificationNotFoundException;
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;
@ -25,8 +24,8 @@ public class ExampleBootstrap {
@PostConstruct
public void test() throws TaskNotFoundException, NotAuthorizedException, WorkbasketNotFoundException,
ClassificationNotFoundException, InvalidStateException, InvalidOwnerException, InvalidWorkbasketException,
TaskAlreadyExistException, InvalidArgumentException {
ClassificationNotFoundException, InvalidStateException, InvalidOwnerException, TaskAlreadyExistException,
InvalidArgumentException {
System.out.println("---------------------------> Start App");
Task task = taskService.newTask("1");
task.setName("Spring example task");

View File

@ -67,8 +67,7 @@ public class TaskanaConfig {
}
@Bean
public TaskanaEngine taskanaEngine(SpringTaskanaEngineConfiguration taskanaEngineConfiguration)
throws SQLException {
public TaskanaEngine taskanaEngine(SpringTaskanaEngineConfiguration taskanaEngineConfiguration) {
TaskanaEngine taskanaEngine = taskanaEngineConfiguration.buildTaskanaEngine();
// taskanaEngine.setConnectionManagementMode(TaskanaEngine.ConnectionManagementMode.EXPLICIT);
return taskanaEngine;

View File

@ -15,7 +15,6 @@ import pro.taskana.exceptions.DomainNotFoundException;
import pro.taskana.exceptions.InvalidWorkbasketException;
import pro.taskana.exceptions.NotAuthorizedException;
import pro.taskana.exceptions.WorkbasketAlreadyExistException;
import pro.taskana.exceptions.WorkbasketNotFoundException;
import pro.taskana.impl.WorkbasketImpl;
import pro.taskana.impl.util.IdGenerator;
@ -54,7 +53,7 @@ public class TaskanaTestController {
@Transactional(rollbackFor = Exception.class)
@RequestMapping("/transaction")
public @ResponseBody String transaction(@RequestParam(value = "rollback", defaultValue = "false") String rollback)
throws WorkbasketNotFoundException, InvalidWorkbasketException, NotAuthorizedException,
throws InvalidWorkbasketException, NotAuthorizedException,
WorkbasketAlreadyExistException, DomainNotFoundException {
taskanaEngine.getWorkbasketService().createWorkbasket(createWorkBasket("key", "workbasket"));
@ -70,7 +69,7 @@ public class TaskanaTestController {
@RequestMapping("/transaction-many")
public @ResponseBody String transactionMany(
@RequestParam(value = "rollback", defaultValue = "false") String rollback)
throws WorkbasketNotFoundException, InvalidWorkbasketException, NotAuthorizedException,
throws InvalidWorkbasketException, NotAuthorizedException,
WorkbasketAlreadyExistException, DomainNotFoundException {
taskanaEngine.getWorkbasketService().createWorkbasket(createWorkBasket("key1", "workbasket1"));
taskanaEngine.getWorkbasketService().createWorkbasket(createWorkBasket("key2", "workbasket2"));
@ -87,7 +86,7 @@ public class TaskanaTestController {
@RequestMapping("/geschbuch")
public @ResponseBody String transactionGeschbuch(
@RequestParam(value = "rollback", defaultValue = "false") String rollback)
throws WorkbasketNotFoundException, InvalidWorkbasketException, NotAuthorizedException,
throws InvalidWorkbasketException, NotAuthorizedException,
WorkbasketAlreadyExistException, DomainNotFoundException {
taskanaEngine.getWorkbasketService().createWorkbasket(createWorkBasket("key1", "workbasket1"));
taskanaEngine.getWorkbasketService().createWorkbasket(createWorkBasket("key2", "workbasket2"));
@ -120,7 +119,7 @@ public class TaskanaTestController {
return jdbcTemplate.queryForObject("SELECT COUNT(*) FROM GESCHBUCH.TEST", Integer.class);
}
private Workbasket createWorkBasket(String key, String name) throws NotAuthorizedException {
private Workbasket createWorkBasket(String key, String name) {
WorkbasketImpl workbasket = (WorkbasketImpl) taskanaEngine.getWorkbasketService().newWorkbasket(key,
"DOMAIN_A");
String id1 = IdGenerator.generateWithPrefix("TWB");

View File

@ -1,7 +1,5 @@
package pro.taskana;
import java.sql.SQLException;
import javax.annotation.PostConstruct;
import org.mybatis.spring.transaction.SpringManagedTransactionFactory;
@ -19,7 +17,7 @@ public class SpringTaskanaEngineImpl extends TaskanaEngineImpl {
}
@PostConstruct
public void init() throws SQLException {
public void init() {
this.transactionFactory = new SpringManagedTransactionFactory();
this.sessionManager = createSqlSessionManager();
}

View File

@ -6,7 +6,6 @@ import org.springframework.transaction.annotation.Transactional;
import pro.taskana.exceptions.ClassificationNotFoundException;
import pro.taskana.exceptions.InvalidArgumentException;
import pro.taskana.exceptions.InvalidWorkbasketException;
import pro.taskana.exceptions.NotAuthorizedException;
import pro.taskana.exceptions.TaskAlreadyExistException;
import pro.taskana.exceptions.WorkbasketNotFoundException;
@ -23,8 +22,7 @@ public class TaskanaComponent {
}
public void triggerRollback() throws NotAuthorizedException, WorkbasketNotFoundException,
ClassificationNotFoundException, InvalidWorkbasketException, TaskAlreadyExistException,
InvalidArgumentException {
ClassificationNotFoundException, TaskAlreadyExistException, InvalidArgumentException {
Task task = taskService.newTask("1");
task.setName("Unit Test Task");
ObjectReference objRef = new ObjectReference();

View File

@ -37,7 +37,7 @@ public class SampleDataGenerator {
runner = new ScriptRunner(dataSource.getConnection());
}
public void generateSampleData() throws SQLException {
public void generateSampleData() {
StringWriter outWriter = new StringWriter();
PrintWriter logWriter = new PrintWriter(outWriter);

View File

@ -120,7 +120,6 @@ public class LdapClient {
message += " taskana.ldap.groupNameAttribute is not configured.";
}
if (!message.equals(emptyMessage)) {
LOGGER.error("Ldap configuration error detected: {}", message);
throw new SystemException(message);
}
active = true;
@ -130,7 +129,6 @@ public class LdapClient {
public List<AccessIdResource> searchUsersAndGroups(final String name) throws InvalidArgumentException {
LOGGER.debug("entry to searchUsersAndGroups(name = {})", name);
if (!active) {
LOGGER.error("LdapClient was called but is not active due to missing configuration: " + message);
throw new SystemException(
"LdapClient was called but is not active due to missing configuration: " + message);
}
@ -155,7 +153,6 @@ public class LdapClient {
public List<AccessIdResource> searchUsersByName(final String name) throws InvalidArgumentException {
LOGGER.debug("entry to searchUsersByName(name = {}).", name);
if (!active) {
LOGGER.error("LdapClient was called but is not active due to missing configuration: " + message);
throw new SystemException(
"LdapClient was called but is not active due to missing configuration: " + message);
}
@ -176,22 +173,17 @@ public class LdapClient {
String[] userAttributesToReturn = {getUserFirstnameAttribute(), getUserLastnameAttribute(),
getUserIdAttribute()};
try {
final List<AccessIdResource> accessIds = ldapTemplate.search(getUserSearchBase(), andFilter.encode(),
SearchControls.SUBTREE_SCOPE, userAttributesToReturn, new UserContextMapper());
LOGGER.debug("exit from searchUsersByName. Retrieved the following users: {}.",
LoggerUtils.listToString(accessIds));
return accessIds;
} catch (Exception e) {
LOGGER.error("caught Exception {} ", e.getMessage());
throw e;
}
}
public List<AccessIdResource> searchGroupsByName(final String name) throws InvalidArgumentException {
LOGGER.debug("entry to searchGroupsByName(name = {}).", name);
if (!active) {
LOGGER.error("LdapClient was called but is not active due to missing configuration: " + message);
throw new SystemException(
"LdapClient was called but is not active due to missing configuration: " + message);
}
@ -216,16 +208,11 @@ public class LdapClient {
groupAttributesToReturn = new String[] {getGroupNameAttribute(), CN};
}
try {
final List<AccessIdResource> accessIds = ldapTemplate.search(getGroupSearchBase(), andFilter.encode(),
SearchControls.SUBTREE_SCOPE, groupAttributesToReturn, new GroupContextMapper());
LOGGER.debug("Exit from searchGroupsByName. Retrieved the following groups: {}",
LoggerUtils.listToString(accessIds));
return accessIds;
} catch (Exception e) {
LOGGER.error("caught Exception {} ", e.getMessage());
throw e;
}
}

View File

@ -22,7 +22,7 @@ public abstract class AbstractPagingController {
pagesize = Long.valueOf(pagesizeParam);
page = Long.valueOf(pageParam);
} catch (NumberFormatException e) {
throw new InvalidArgumentException("page and pagesize must be a integer value.");
throw new InvalidArgumentException("page and pagesize must be a integer value.", e.getCause());
}
PageMetadata pageMetadata = new PageMetadata(pagesize, page, totalElements);
if (pageMetadata.getNumber() > pageMetadata.getTotalPages()) {

View File

@ -194,7 +194,7 @@ public class ClassificationController extends AbstractPagingController {
}
private ClassificationQuery applyFilterParams(ClassificationQuery query,
MultiValueMap<String, String> params) throws InvalidArgumentException {
MultiValueMap<String, String> params) {
if (params.containsKey(NAME)) {
String[] names = extractCommaSeparatedFields(params.get(NAME));
query.nameIn(names);

View File

@ -91,7 +91,7 @@ public class TaskController extends AbstractPagingController {
@GetMapping
@Transactional(readOnly = true, rollbackFor = Exception.class)
public ResponseEntity<PagedResources<TaskSummaryResource>> getTasks(
@RequestParam MultiValueMap<String, String> params) throws InvalidArgumentException, NotAuthorizedException {
@RequestParam MultiValueMap<String, String> params) throws InvalidArgumentException {
TaskQuery query = taskService.createTaskQuery();
query = applyFilterParams(query, params);
@ -171,7 +171,7 @@ public class TaskController extends AbstractPagingController {
@Transactional(rollbackFor = Exception.class)
public ResponseEntity<TaskResource> createTask(@RequestBody TaskResource taskResource)
throws WorkbasketNotFoundException, ClassificationNotFoundException, NotAuthorizedException,
TaskAlreadyExistException, InvalidWorkbasketException, InvalidArgumentException {
TaskAlreadyExistException, InvalidArgumentException {
Task createdTask = taskService.createTask(taskResourceAssembler.toModel(taskResource));
ResponseEntity<TaskResource> result = new ResponseEntity<>(taskResourceAssembler.toResource(createdTask),
HttpStatus.CREATED);
@ -212,7 +212,7 @@ public class TaskController extends AbstractPagingController {
}
private TaskQuery applyFilterParams(TaskQuery taskQuery, MultiValueMap<String, String> params)
throws NotAuthorizedException, InvalidArgumentException {
throws InvalidArgumentException {
// apply filters
if (params.containsKey(NAME)) {
@ -292,7 +292,7 @@ public class TaskController extends AbstractPagingController {
}
private TaskQuery applySortingParams(TaskQuery taskQuery, MultiValueMap<String, String> params)
throws NotAuthorizedException, InvalidArgumentException {
throws InvalidArgumentException {
// sorting
String sortBy = params.getFirst(SORT_BY);

View File

@ -13,7 +13,6 @@ import pro.taskana.TaskService;
import pro.taskana.TaskState;
import pro.taskana.TaskSummary;
import pro.taskana.exceptions.InvalidArgumentException;
import pro.taskana.exceptions.NotAuthorizedException;
/**
* TODO.
@ -51,12 +50,12 @@ public class TaskFilter {
@Autowired
private TaskService taskService;
public List<TaskSummary> getAll() throws NotAuthorizedException {
public List<TaskSummary> getAll() {
return taskService.createTaskQuery().list();
}
public List<TaskSummary> inspectParams(MultiValueMap<String, String> params)
throws NotAuthorizedException, InvalidArgumentException {
throws InvalidArgumentException {
TaskQuery taskQuery = taskService.createTaskQuery();
// apply filters

View File

@ -42,7 +42,7 @@ public class ClassificationResourceAssembler {
return addLinks(resource, classification);
}
public Classification toModel(ClassificationResource classificationResource) throws NotAuthorizedException {
public Classification toModel(ClassificationResource classificationResource) {
ClassificationImpl classification = (ClassificationImpl) classificationService.newClassification(
classificationResource.domain, classificationResource.key, classificationResource.type);
BeanUtils.copyProperties(classificationResource, classification);

View File

@ -108,7 +108,7 @@ public class TaskResourceAssembler
resource.setCustom16(task.getCustomAttribute("16"));
}
} catch (InvalidArgumentException e) {
throw new SystemException("caught unexpected Exception " + e);
throw new SystemException("caught unexpected Exception.", e.getCause());
}
return resource;

View File

@ -94,7 +94,7 @@ public class TaskSummaryResourceAssembler
resource.setCustom16(taskSummary.getCustomAttribute("16"));
}
} catch (InvalidArgumentException e) {
throw new SystemException("caught unexpected Exception " + e);
throw new SystemException("caught unexpected Exception.", e.getCause());
}
return resource;

View File

@ -37,7 +37,7 @@ public class WorkbasketAssembler {
return addLinks(resource, wb);
}
public Workbasket toModel(WorkbasketResource wbResource) throws NotAuthorizedException {
public Workbasket toModel(WorkbasketResource wbResource) {
WorkbasketImpl workbasket = (WorkbasketImpl) workbasketService.newWorkbasket(wbResource.key, wbResource.domain);
BeanUtils.copyProperties(wbResource, workbasket);
@ -55,7 +55,8 @@ public class WorkbasketAssembler {
resource.add(linkTo(methodOn(WorkbasketController.class).getWorkbasketAccessItems(wb.getId()))
.withRel("accessItems"));
resource.add(linkTo(WorkbasketController.class).withRel("allWorkbaskets"));
resource.add(linkTo(methodOn(WorkbasketController.class).removeDistributionTargetForWorkbasketId(wb.getId())).withRel("removeDistributionTargets"));
resource.add(linkTo(methodOn(WorkbasketController.class).removeDistributionTargetForWorkbasketId(wb.getId()))
.withRel("removeDistributionTargets"));
return resource;
}
}

View File

@ -68,7 +68,7 @@ public class ClassificationAssemblerTest {
}
@Test
public void resourceToClassification() throws NotAuthorizedException {
public void resourceToClassification() {
// given
ClassificationResource classificationResource = new ClassificationResource();
classificationResource.setClassificationId("1");
@ -95,7 +95,8 @@ public class ClassificationAssemblerTest {
classificationResource.setServiceLevel("P1D");
classificationResource.setDescription("Test");
// when
ClassificationImpl classification = (ClassificationImpl) classificationResourceAssembler.toModel(classificationResource);
ClassificationImpl classification = (ClassificationImpl) classificationResourceAssembler
.toModel(classificationResource);
// then
testEquality(classification, classificationResource);
}

View File

@ -58,7 +58,7 @@ public class WorkbasketAssemblerTest {
}
@Test
public void resourceToWorkbasket() throws NotAuthorizedException {
public void resourceToWorkbasket() {
// given
WorkbasketResource workbasketResource = new WorkbasketResource();
workbasketResource.setWorkbasketId("1");