From f753ef6767c7e5ebf47ca73462d1034932ec77aa Mon Sep 17 00:00:00 2001 From: BerndBreier <33351391+BerndBreier@users.noreply.github.com> Date: Thu, 30 Nov 2017 15:39:13 +0100 Subject: [PATCH] TSK-15-fixedNotAuthorizedException-in-TaskServiceImplIntExplicitTest.testCreateManualTask --- .../main/java/pro/taskana/impl/TaskServiceImpl.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/taskana-core/src/main/java/pro/taskana/impl/TaskServiceImpl.java b/lib/taskana-core/src/main/java/pro/taskana/impl/TaskServiceImpl.java index 339316fca..a9cc82c05 100644 --- a/lib/taskana-core/src/main/java/pro/taskana/impl/TaskServiceImpl.java +++ b/lib/taskana-core/src/main/java/pro/taskana/impl/TaskServiceImpl.java @@ -33,6 +33,7 @@ public class TaskServiceImpl implements TaskService { private static final String ID_PREFIX_OBJECTR_EFERENCE = "ORI"; private static final String ID_PREFIX_TASK = "TKI"; private static final String ID_PREFIX_BUSINESS_PROCESS = "BPI"; + private static final String TYPE_MANUAL = "MANUAL"; private TaskanaEngine taskanaEngine; private TaskanaEngineImpl taskanaEngineImpl; @@ -124,7 +125,7 @@ public class TaskServiceImpl implements TaskService { taskanaEngine.getWorkbasketService().getWorkbasket(workbasketId); Classification classification = taskanaEngine.getClassificationService().getClassification(classificationId, domain); - if (classification.getCategory() != "MANUAL") { + if (!TYPE_MANUAL.equals(classification.getCategory())) { throw new NotAuthorizedException("You're not allowed to add a task manually to a '" + classification.getCategory() + "'- Classification!"); } @@ -139,7 +140,7 @@ public class TaskServiceImpl implements TaskService { task.setDescription(description); this.standardSettings(task); - this.setCustomers(task); + this.setCustomAttributes(task); this.taskMapper.insert(task); @@ -263,9 +264,9 @@ public class TaskServiceImpl implements TaskService { taskanaEngineImpl.returnConnection(); } return (resultList == null) ? new ArrayList<>() : resultList; - } - - private void standardSettings(Task task) { + } + + private void standardSettings(Task task) { Timestamp now = new Timestamp(System.currentTimeMillis()); task.setId(IdGenerator.generateWithPrefix(ID_PREFIX_TASK)); task.setState(TaskState.READY); @@ -313,7 +314,7 @@ public class TaskServiceImpl implements TaskService { } } - private void setCustomers(Task task) { + private void setCustomAttributes(Task task) { if (task.getCustomAttributes() != null) { for (String custom : task.getCustomAttributes().keySet()) { if (task.getCustom1() == null) {