TSK-130 Update Task
This commit is contained in:
parent
4044b8f8b3
commit
252d36a13d
|
|
@ -29,7 +29,7 @@ public class ExampleBootstrap {
|
||||||
ClassificationNotFoundException, InvalidStateException, InvalidOwnerException, InvalidWorkbasketException,
|
ClassificationNotFoundException, InvalidStateException, InvalidOwnerException, InvalidWorkbasketException,
|
||||||
TaskAlreadyExistException, InvalidArgumentException {
|
TaskAlreadyExistException, InvalidArgumentException {
|
||||||
System.out.println("---------------------------> Start App");
|
System.out.println("---------------------------> Start App");
|
||||||
Task task = taskanaEjb.getTaskService().newTask();
|
Task task = taskanaEjb.getTaskService().newTask(null);
|
||||||
ObjectReference objRef = new ObjectReference();
|
ObjectReference objRef = new ObjectReference();
|
||||||
objRef.setCompany("aCompany");
|
objRef.setCompany("aCompany");
|
||||||
objRef.setSystem("aSystem");
|
objRef.setSystem("aSystem");
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ public class TaskanaEjb {
|
||||||
public void triggerRollback() throws NotAuthorizedException, WorkbasketNotFoundException,
|
public void triggerRollback() throws NotAuthorizedException, WorkbasketNotFoundException,
|
||||||
ClassificationNotFoundException, TaskAlreadyExistException, InvalidWorkbasketException,
|
ClassificationNotFoundException, TaskAlreadyExistException, InvalidWorkbasketException,
|
||||||
InvalidArgumentException {
|
InvalidArgumentException {
|
||||||
Task task = taskService.newTask();
|
Task task = taskService.newTask(null);
|
||||||
ObjectReference objRef = new ObjectReference();
|
ObjectReference objRef = new ObjectReference();
|
||||||
objRef.setCompany("aCompany");
|
objRef.setCompany("aCompany");
|
||||||
objRef.setSystem("aSystem");
|
objRef.setSystem("aSystem");
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,6 @@ import pro.taskana.exceptions.NotAuthorizedException;
|
||||||
import pro.taskana.exceptions.TaskAlreadyExistException;
|
import pro.taskana.exceptions.TaskAlreadyExistException;
|
||||||
import pro.taskana.exceptions.TaskNotFoundException;
|
import pro.taskana.exceptions.TaskNotFoundException;
|
||||||
import pro.taskana.exceptions.WorkbasketNotFoundException;
|
import pro.taskana.exceptions.WorkbasketNotFoundException;
|
||||||
import pro.taskana.impl.ClassificationImpl;
|
|
||||||
import pro.taskana.model.ObjectReference;
|
import pro.taskana.model.ObjectReference;
|
||||||
import pro.taskana.model.WorkbasketType;
|
import pro.taskana.model.WorkbasketType;
|
||||||
|
|
||||||
|
|
@ -50,9 +49,8 @@ public class TaskanaRestTest {
|
||||||
Classification classification = classificationService.newClassification("cdiDomain", "TEST", "t1");
|
Classification classification = classificationService.newClassification("cdiDomain", "TEST", "t1");
|
||||||
taskanaEjb.getClassificationService().createClassification(classification);
|
taskanaEjb.getClassificationService().createClassification(classification);
|
||||||
|
|
||||||
Task task = taskanaEjb.getTaskService().newTask();
|
Task task = taskanaEjb.getTaskService().newTask(workbasket.getKey());
|
||||||
task.setClassificationKey(classification.getKey());
|
task.setClassificationKey(classification.getKey());
|
||||||
task.setWorkbasketKey(workbasket.getKey());
|
|
||||||
ObjectReference objRef = new ObjectReference();
|
ObjectReference objRef = new ObjectReference();
|
||||||
objRef.setCompany("aCompany");
|
objRef.setCompany("aCompany");
|
||||||
objRef.setSystem("aSystem");
|
objRef.setSystem("aSystem");
|
||||||
|
|
|
||||||
|
|
@ -136,14 +136,6 @@ public interface Task {
|
||||||
*/
|
*/
|
||||||
String getWorkbasketKey();
|
String getWorkbasketKey();
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the key of the Workbasket where the task should be stored in.
|
|
||||||
*
|
|
||||||
* @param workbasketKey
|
|
||||||
* the key of the workbasket
|
|
||||||
*/
|
|
||||||
void setWorkbasketKey(String workbasketKey);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the the Summary of the workbasket where the task is stored in.
|
* Returns the the Summary of the workbasket where the task is stored in.
|
||||||
*
|
*
|
||||||
|
|
@ -151,14 +143,6 @@ public interface Task {
|
||||||
*/
|
*/
|
||||||
WorkbasketSummary getWorkbasketSummary();
|
WorkbasketSummary getWorkbasketSummary();
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the Summary of the Workbasket where the task should be stored in.
|
|
||||||
*
|
|
||||||
* @param workbasket
|
|
||||||
* the WorkbasketSummary
|
|
||||||
*/
|
|
||||||
void setWorkbasketSummary(WorkbasketSummary workbasket);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the Domain, to which the Task belongs at this moment.
|
* Returns the Domain, to which the Task belongs at this moment.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -199,9 +199,11 @@ public interface TaskService {
|
||||||
/**
|
/**
|
||||||
* Returns a not persisted instance of {@link Task}.
|
* Returns a not persisted instance of {@link Task}.
|
||||||
*
|
*
|
||||||
|
* @param workbasketKey
|
||||||
|
* the key of the workbasket to which the task belongs
|
||||||
* @return an empty new Task
|
* @return an empty new Task
|
||||||
*/
|
*/
|
||||||
Task newTask();
|
Task newTask(String workbasketKey);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a not persisted instance of {@link Attachment}.
|
* Returns a not persisted instance of {@link Attachment}.
|
||||||
|
|
|
||||||
|
|
@ -188,7 +188,6 @@ public class TaskImpl implements Task {
|
||||||
return workbasketKey;
|
return workbasketKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setWorkbasketKey(String workbasketKey) {
|
public void setWorkbasketKey(String workbasketKey) {
|
||||||
this.workbasketKey = workbasketKey;
|
this.workbasketKey = workbasketKey;
|
||||||
}
|
}
|
||||||
|
|
@ -198,7 +197,6 @@ public class TaskImpl implements Task {
|
||||||
return workbasketSummary;
|
return workbasketSummary;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setWorkbasketSummary(WorkbasketSummary workbasket) {
|
public void setWorkbasketSummary(WorkbasketSummary workbasket) {
|
||||||
this.workbasketSummary = workbasket;
|
this.workbasketSummary = workbasket;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -55,6 +55,7 @@ public class TaskServiceImpl implements TaskService {
|
||||||
private static final String ID_PREFIX_ATTACHMENT = "TAI";
|
private static final String ID_PREFIX_ATTACHMENT = "TAI";
|
||||||
private static final String ID_PREFIX_TASK = "TKI";
|
private static final String ID_PREFIX_TASK = "TKI";
|
||||||
private static final String ID_PREFIX_BUSINESS_PROCESS = "BPI";
|
private static final String ID_PREFIX_BUSINESS_PROCESS = "BPI";
|
||||||
|
private static final String MUST_NOT_BE_EMPTY = " must not be empty";
|
||||||
private TaskanaEngine taskanaEngine;
|
private TaskanaEngine taskanaEngine;
|
||||||
private TaskanaEngineImpl taskanaEngineImpl;
|
private TaskanaEngineImpl taskanaEngineImpl;
|
||||||
private WorkbasketService workbasketService;
|
private WorkbasketService workbasketService;
|
||||||
|
|
@ -201,7 +202,7 @@ public class TaskServiceImpl implements TaskService {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Task getTask(String id) throws TaskNotFoundException, SystemException {
|
public Task getTask(String id) throws TaskNotFoundException {
|
||||||
LOGGER.debug("entry to getTaskById(id = {})", id);
|
LOGGER.debug("entry to getTaskById(id = {})", id);
|
||||||
TaskImpl resultTask = null;
|
TaskImpl resultTask = null;
|
||||||
try {
|
try {
|
||||||
|
|
@ -402,16 +403,6 @@ public class TaskServiceImpl implements TaskService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// insert ObjectReference if needed. Comment this out for the scope of tsk-123
|
|
||||||
// if (task.getPrimaryObjRef() != null) {
|
|
||||||
// ObjectReference objectReference = this.objectReferenceMapper.findByObjectReference(task.getPrimaryObjRef());
|
|
||||||
// if (objectReference == null) {
|
|
||||||
// objectReference = task.getPrimaryObjRef();
|
|
||||||
// objectReference.setId(IdGenerator.generateWithPrefix(ID_PREFIX_OBJECT_REFERENCE));
|
|
||||||
// this.objectReferenceMapper.insert(objectReference);
|
|
||||||
// }
|
|
||||||
// // task.setPrimaryObjRef(objectReference);
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -427,9 +418,7 @@ public class TaskServiceImpl implements TaskService {
|
||||||
// list<attachmentsummary>
|
// list<attachmentsummary>
|
||||||
results = augmentTaskSummariesByContainedSummaries(taskSummaries);
|
results = augmentTaskSummariesByContainedSummaries(taskSummaries);
|
||||||
|
|
||||||
} catch (WorkbasketNotFoundException ex) {
|
} catch (WorkbasketNotFoundException | NotAuthorizedException ex) {
|
||||||
throw ex;
|
|
||||||
} catch (NotAuthorizedException ex) {
|
|
||||||
throw ex;
|
throw ex;
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
LOGGER.error("Getting TASKSUMMARY failed internally.", ex);
|
LOGGER.error("Getting TASKSUMMARY failed internally.", ex);
|
||||||
|
|
@ -538,7 +527,7 @@ public class TaskServiceImpl implements TaskService {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Set<String> taskIdSet = taskSummaries.stream().map(t -> t.getTaskId()).collect(Collectors.toSet());
|
Set<String> taskIdSet = taskSummaries.stream().map(TaskSummaryImpl::getTaskId).collect(Collectors.toSet());
|
||||||
String[] taskIdArray = taskIdSet.toArray(new String[0]);
|
String[] taskIdArray = taskIdSet.toArray(new String[0]);
|
||||||
|
|
||||||
List<AttachmentSummaryImpl> attachmentSummaries = attachmentMapper
|
List<AttachmentSummaryImpl> attachmentSummaries = attachmentMapper
|
||||||
|
|
@ -566,7 +555,7 @@ public class TaskServiceImpl implements TaskService {
|
||||||
|| taskSummaries.isEmpty()) {
|
|| taskSummaries.isEmpty()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Set<String> classificationDomainSet = taskSummaries.stream().map(t -> t.getDomain()).collect(
|
Set<String> classificationDomainSet = taskSummaries.stream().map(TaskSummaryImpl::getDomain).collect(
|
||||||
Collectors.toSet());
|
Collectors.toSet());
|
||||||
Set<String> classificationKeySet = attachmentSummaries.stream()
|
Set<String> classificationKeySet = attachmentSummaries.stream()
|
||||||
.map(t -> t.getClassificationSummary().getKey())
|
.map(t -> t.getClassificationSummary().getKey())
|
||||||
|
|
@ -650,8 +639,10 @@ public class TaskServiceImpl implements TaskService {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Task newTask() {
|
public Task newTask(String workbasketKey) {
|
||||||
return new TaskImpl();
|
TaskImpl task = new TaskImpl();
|
||||||
|
task.setWorkbasketKey(workbasketKey);
|
||||||
|
return task;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -666,17 +657,17 @@ public class TaskServiceImpl implements TaskService {
|
||||||
throw new InvalidArgumentException(objRefType + " of " + objName + " must not be null");
|
throw new InvalidArgumentException(objRefType + " of " + objName + " must not be null");
|
||||||
} else if (objRef.getCompany() == null || objRef.getCompany().length() == 0) {
|
} else if (objRef.getCompany() == null || objRef.getCompany().length() == 0) {
|
||||||
throw new InvalidArgumentException(
|
throw new InvalidArgumentException(
|
||||||
"Company of " + objRefType + " of " + objName + " must not be empty");
|
"Company of " + objRefType + " of " + objName + MUST_NOT_BE_EMPTY);
|
||||||
} else if (objRef.getSystem() == null || objRef.getSystem().length() == 0) {
|
} else if (objRef.getSystem() == null || objRef.getSystem().length() == 0) {
|
||||||
throw new InvalidArgumentException(
|
throw new InvalidArgumentException(
|
||||||
"System of " + objRefType + " of " + objName + " must not be empty");
|
"System of " + objRefType + " of " + objName + MUST_NOT_BE_EMPTY);
|
||||||
} else if (objRef.getSystemInstance() == null || objRef.getSystemInstance().length() == 0) {
|
} else if (objRef.getSystemInstance() == null || objRef.getSystemInstance().length() == 0) {
|
||||||
throw new InvalidArgumentException(
|
throw new InvalidArgumentException(
|
||||||
"SystemInstance of " + objRefType + " of " + objName + " must not be empty");
|
"SystemInstance of " + objRefType + " of " + objName + MUST_NOT_BE_EMPTY);
|
||||||
} else if (objRef.getType() == null || objRef.getType().length() == 0) {
|
} else if (objRef.getType() == null || objRef.getType().length() == 0) {
|
||||||
throw new InvalidArgumentException("Type of " + objRefType + " of " + objName + " must not be empty");
|
throw new InvalidArgumentException("Type of " + objRefType + " of " + objName + MUST_NOT_BE_EMPTY);
|
||||||
} else if (objRef.getValue() == null || objRef.getValue().length() == 0) {
|
} else if (objRef.getValue() == null || objRef.getValue().length() == 0) {
|
||||||
throw new InvalidArgumentException("Value of" + objRefType + " of " + objName + " must not be empty");
|
throw new InvalidArgumentException("Value of" + objRefType + " of " + objName + MUST_NOT_BE_EMPTY);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -702,7 +693,7 @@ public class TaskServiceImpl implements TaskService {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void standardUpdateActions(TaskImpl oldTaskImpl, TaskImpl newTaskImpl)
|
private void standardUpdateActions(TaskImpl oldTaskImpl, TaskImpl newTaskImpl)
|
||||||
throws InvalidArgumentException, ConcurrencyException, WorkbasketNotFoundException, InvalidWorkbasketException,
|
throws InvalidArgumentException, ConcurrencyException, WorkbasketNotFoundException,
|
||||||
ClassificationNotFoundException, NotAuthorizedException {
|
ClassificationNotFoundException, NotAuthorizedException {
|
||||||
validateObjectReference(newTaskImpl.getPrimaryObjRef(), "primary ObjectReference", "Task");
|
validateObjectReference(newTaskImpl.getPrimaryObjRef(), "primary ObjectReference", "Task");
|
||||||
if (oldTaskImpl.getModified() != null && !oldTaskImpl.getModified().equals(newTaskImpl.getModified())
|
if (oldTaskImpl.getModified() != null && !oldTaskImpl.getModified().equals(newTaskImpl.getModified())
|
||||||
|
|
@ -773,20 +764,18 @@ public class TaskServiceImpl implements TaskService {
|
||||||
boolean wasAlreadyRepresented = false;
|
boolean wasAlreadyRepresented = false;
|
||||||
if (attachment.getId() != null) {
|
if (attachment.getId() != null) {
|
||||||
for (Attachment oldAttachment : oldTaskImpl.getAttachments()) {
|
for (Attachment oldAttachment : oldTaskImpl.getAttachments()) {
|
||||||
if (oldAttachment != null) {
|
if (oldAttachment != null && attachment.getId().equals(oldAttachment.getId())) {
|
||||||
// UPDATE when id is represented but objects are not equal
|
wasAlreadyRepresented = true;
|
||||||
if (attachment.getId().equals(oldAttachment.getId())) {
|
if (!attachment.equals(oldAttachment)) {
|
||||||
wasAlreadyRepresented = true;
|
AttachmentImpl temp = (AttachmentImpl) attachment;
|
||||||
if (!attachment.equals(oldAttachment)) {
|
temp.setModified(Instant.now());
|
||||||
AttachmentImpl temp = (AttachmentImpl) attachment;
|
attachmentMapper.update(temp);
|
||||||
temp.setModified(Instant.now());
|
LOGGER.debug("TaskService.updateTask() for TaskId={} UPDATED an Attachment={}.",
|
||||||
attachmentMapper.update(temp);
|
newTaskImpl.getId(),
|
||||||
LOGGER.debug("TaskService.updateTask() for TaskId={} UPDATED an Attachment={}.",
|
attachment);
|
||||||
newTaskImpl.getId(),
|
break;
|
||||||
attachment);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -818,11 +807,9 @@ public class TaskServiceImpl implements TaskService {
|
||||||
if (oldAttachment != null) {
|
if (oldAttachment != null) {
|
||||||
boolean isRepresented = false;
|
boolean isRepresented = false;
|
||||||
for (Attachment newAttachment : newTaskImpl.getAttachments()) {
|
for (Attachment newAttachment : newTaskImpl.getAttachments()) {
|
||||||
if (newAttachment != null) {
|
if (newAttachment != null && oldAttachment.getId().equals(newAttachment.getId())) {
|
||||||
if (oldAttachment.getId().equals(newAttachment.getId())) {
|
isRepresented = true;
|
||||||
isRepresented = true;
|
break;
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!isRepresented) {
|
if (!isRepresented) {
|
||||||
|
|
|
||||||
|
|
@ -38,19 +38,15 @@ public class DeleteClassificationAccTest extends AbstractAccTest {
|
||||||
Classification classification = classificationService.getClassification("L140101", "DOMAIN_A");
|
Classification classification = classificationService.getClassification("L140101", "DOMAIN_A");
|
||||||
assertNotNull(classification);
|
assertNotNull(classification);
|
||||||
assertEquals("", classification.getDomain());
|
assertEquals("", classification.getDomain());
|
||||||
|
|
||||||
classification = classificationService.getClassification("L140101", "DOMAIN_A");
|
|
||||||
assertTrue(classification.getDomain() == "");
|
|
||||||
assertTrue("DOMAIN_A" != classification.getDomain());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test (expected = ClassificationInUseException.class)
|
@Test(expected = ClassificationInUseException.class)
|
||||||
public void testThrowExeptionIfDeleteClassificationWithExistingTasks()
|
public void testThrowExeptionIfDeleteClassificationWithExistingTasks()
|
||||||
throws SQLException, ClassificationNotFoundException, NotAuthorizedException, ClassificationInUseException {
|
throws SQLException, ClassificationNotFoundException, NotAuthorizedException, ClassificationInUseException {
|
||||||
classificationService.deleteClassification("L1050", "DOMAIN_A");
|
classificationService.deleteClassification("L1050", "DOMAIN_A");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test (expected = ClassificationInUseException.class)
|
@Test(expected = ClassificationInUseException.class)
|
||||||
public void testThrowExeptionIfDeleteMasterClassificationWithExistingTasks()
|
public void testThrowExeptionIfDeleteMasterClassificationWithExistingTasks()
|
||||||
throws SQLException, ClassificationNotFoundException, NotAuthorizedException, ClassificationInUseException {
|
throws SQLException, ClassificationNotFoundException, NotAuthorizedException, ClassificationInUseException {
|
||||||
classificationService.deleteClassification("L1050", "");
|
classificationService.deleteClassification("L1050", "");
|
||||||
|
|
@ -85,7 +81,7 @@ public class DeleteClassificationAccTest extends AbstractAccTest {
|
||||||
|
|
||||||
classificationInUse = false;
|
classificationInUse = false;
|
||||||
try {
|
try {
|
||||||
classificationService.deleteClassification("L11010", "");
|
classificationService.deleteClassification("L11010", "");
|
||||||
} catch (ClassificationInUseException e) {
|
} catch (ClassificationInUseException e) {
|
||||||
classificationInUse = true;
|
classificationInUse = true;
|
||||||
}
|
}
|
||||||
|
|
@ -97,12 +93,14 @@ public class DeleteClassificationAccTest extends AbstractAccTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expected = ClassificationNotFoundException.class)
|
@Test(expected = ClassificationNotFoundException.class)
|
||||||
public void testThrowClassificationNotFoundIfClassificationNotExists() throws ClassificationNotFoundException, ClassificationInUseException {
|
public void testThrowClassificationNotFoundIfClassificationNotExists()
|
||||||
|
throws ClassificationNotFoundException, ClassificationInUseException {
|
||||||
classificationService.deleteClassification("not existing classification key", "");
|
classificationService.deleteClassification("not existing classification key", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expected = ClassificationNotFoundException.class)
|
@Test(expected = ClassificationNotFoundException.class)
|
||||||
public void testThrowClassificationNotFoundIfClassificationNotExistsInDomain() throws ClassificationNotFoundException, ClassificationInUseException {
|
public void testThrowClassificationNotFoundIfClassificationNotExistsInDomain()
|
||||||
|
throws ClassificationNotFoundException, ClassificationInUseException {
|
||||||
classificationService.deleteClassification("L10000", "DOMAIN_B");
|
classificationService.deleteClassification("L10000", "DOMAIN_B");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ package acceptance.task;
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
import static org.junit.Assert.assertNotNull;
|
import static org.junit.Assert.assertNotNull;
|
||||||
|
import static org.junit.Assert.fail;
|
||||||
|
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
|
|
||||||
|
|
@ -39,17 +40,16 @@ public class CreateTaskAccTest extends AbstractAccTest {
|
||||||
|
|
||||||
@WithAccessId(
|
@WithAccessId(
|
||||||
userName = "user_1_1",
|
userName = "user_1_1",
|
||||||
groupNames = { "group_1" })
|
groupNames = {"group_1"})
|
||||||
@Test
|
@Test
|
||||||
public void testCreateSimpleManualTask()
|
public void testCreateSimpleManualTask()
|
||||||
throws SQLException, NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException,
|
throws SQLException, NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException,
|
||||||
WorkbasketNotFoundException, TaskAlreadyExistException, InvalidWorkbasketException {
|
WorkbasketNotFoundException, TaskAlreadyExistException, InvalidWorkbasketException {
|
||||||
|
|
||||||
TaskService taskService = taskanaEngine.getTaskService();
|
TaskService taskService = taskanaEngine.getTaskService();
|
||||||
Task newTask = taskService.newTask();
|
Task newTask = taskService.newTask("USER_1_1");
|
||||||
newTask.setClassificationKey("T2100");
|
newTask.setClassificationKey("T2100");
|
||||||
newTask.setPrimaryObjRef(createObjectReference("COMPANY_A", "SYSTEM_A", "INSTANCE_A", "VNR", "1234567"));
|
newTask.setPrimaryObjRef(createObjectReference("COMPANY_A", "SYSTEM_A", "INSTANCE_A", "VNR", "1234567"));
|
||||||
newTask.setWorkbasketKey("USER_1_1");
|
|
||||||
Task createdTask = taskService.createTask(newTask);
|
Task createdTask = taskService.createTask(newTask);
|
||||||
|
|
||||||
assertNotNull(createdTask);
|
assertNotNull(createdTask);
|
||||||
|
|
@ -71,7 +71,7 @@ public class CreateTaskAccTest extends AbstractAccTest {
|
||||||
|
|
||||||
@WithAccessId(
|
@WithAccessId(
|
||||||
userName = "user_1_1",
|
userName = "user_1_1",
|
||||||
groupNames = { "group_1" })
|
groupNames = {"group_1"})
|
||||||
@Test
|
@Test
|
||||||
public void testCreateExternalTaskWithAttachment()
|
public void testCreateExternalTaskWithAttachment()
|
||||||
throws SQLException, NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException,
|
throws SQLException, NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException,
|
||||||
|
|
@ -79,14 +79,13 @@ public class CreateTaskAccTest extends AbstractAccTest {
|
||||||
ConcurrencyException {
|
ConcurrencyException {
|
||||||
|
|
||||||
TaskService taskService = taskanaEngine.getTaskService();
|
TaskService taskService = taskanaEngine.getTaskService();
|
||||||
Task newTask = taskService.newTask();
|
Task newTask = taskService.newTask("USER_1_1");
|
||||||
newTask.setClassificationKey("L12010");
|
newTask.setClassificationKey("L12010");
|
||||||
newTask.addAttachment(createAttachment("DOCTYPE_DEFAULT",
|
newTask.addAttachment(createAttachment("DOCTYPE_DEFAULT",
|
||||||
createObjectReference("COMPANY_A", "SYSTEM_B", "INSTANCE_B", "ArchiveId",
|
createObjectReference("COMPANY_A", "SYSTEM_B", "INSTANCE_B", "ArchiveId",
|
||||||
"12345678901234567890123456789012345678901234567890"),
|
"12345678901234567890123456789012345678901234567890"),
|
||||||
"E-MAIL", "2018-01-15", createSimpleCustomProperties(3)));
|
"E-MAIL", "2018-01-15", createSimpleCustomProperties(3)));
|
||||||
newTask.setPrimaryObjRef(createObjectReference("COMPANY_A", "SYSTEM_A", "INSTANCE_A", "VNR", "1234567"));
|
newTask.setPrimaryObjRef(createObjectReference("COMPANY_A", "SYSTEM_A", "INSTANCE_A", "VNR", "1234567"));
|
||||||
newTask.setWorkbasketKey("USER_1_1");
|
|
||||||
Task createdTask = taskService.createTask(newTask);
|
Task createdTask = taskService.createTask(newTask);
|
||||||
assertNotNull(createdTask.getId());
|
assertNotNull(createdTask.getId());
|
||||||
|
|
||||||
|
|
@ -103,17 +102,16 @@ public class CreateTaskAccTest extends AbstractAccTest {
|
||||||
|
|
||||||
@WithAccessId(
|
@WithAccessId(
|
||||||
userName = "user_1_1",
|
userName = "user_1_1",
|
||||||
groupNames = { "group_1" })
|
groupNames = {"group_1"})
|
||||||
@Test
|
@Test
|
||||||
public void testCreateExternalTaskWithMultipleAttachments()
|
public void testCreateExternalTaskWithMultipleAttachments()
|
||||||
throws SQLException, NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException,
|
throws SQLException, NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException,
|
||||||
WorkbasketNotFoundException, TaskAlreadyExistException, InvalidWorkbasketException, TaskNotFoundException {
|
WorkbasketNotFoundException, TaskAlreadyExistException, InvalidWorkbasketException, TaskNotFoundException {
|
||||||
|
|
||||||
TaskService taskService = taskanaEngine.getTaskService();
|
TaskService taskService = taskanaEngine.getTaskService();
|
||||||
Task newTask = taskService.newTask();
|
Task newTask = taskService.newTask("USER_1_1");
|
||||||
newTask.setClassificationKey("L12010");
|
newTask.setClassificationKey("L12010");
|
||||||
newTask.setPrimaryObjRef(createObjectReference("COMPANY_A", "SYSTEM_A", "INSTANCE_A", "VNR", "1234567"));
|
newTask.setPrimaryObjRef(createObjectReference("COMPANY_A", "SYSTEM_A", "INSTANCE_A", "VNR", "1234567"));
|
||||||
newTask.setWorkbasketKey("USER_1_1");
|
|
||||||
newTask.addAttachment(createAttachment("DOCTYPE_DEFAULT",
|
newTask.addAttachment(createAttachment("DOCTYPE_DEFAULT",
|
||||||
createObjectReference("COMPANY_A", "SYSTEM_B", "INSTANCE_B", "ArchiveId",
|
createObjectReference("COMPANY_A", "SYSTEM_B", "INSTANCE_B", "ArchiveId",
|
||||||
"12345678901234567890123456789012345678901234567890"),
|
"12345678901234567890123456789012345678901234567890"),
|
||||||
|
|
@ -140,7 +138,7 @@ public class CreateTaskAccTest extends AbstractAccTest {
|
||||||
|
|
||||||
@WithAccessId(
|
@WithAccessId(
|
||||||
userName = "user_1_1",
|
userName = "user_1_1",
|
||||||
groupNames = { "group_1" })
|
groupNames = {"group_1"})
|
||||||
@Test
|
@Test
|
||||||
public void testThrowsExceptionIfAttachmentIsInvalid()
|
public void testThrowsExceptionIfAttachmentIsInvalid()
|
||||||
throws SQLException, NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException,
|
throws SQLException, NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException,
|
||||||
|
|
@ -154,6 +152,7 @@ public class CreateTaskAccTest extends AbstractAccTest {
|
||||||
"E-MAIL", "2018-01-15", createSimpleCustomProperties(3)));
|
"E-MAIL", "2018-01-15", createSimpleCustomProperties(3)));
|
||||||
try {
|
try {
|
||||||
createdTask = taskService.createTask(newTask);
|
createdTask = taskService.createTask(newTask);
|
||||||
|
fail("taskService should have thrown InvalidArgumentException.");
|
||||||
} catch (InvalidArgumentException ex) {
|
} catch (InvalidArgumentException ex) {
|
||||||
// nothing to do
|
// nothing to do
|
||||||
}
|
}
|
||||||
|
|
@ -164,6 +163,7 @@ public class CreateTaskAccTest extends AbstractAccTest {
|
||||||
"E-MAIL", "2018-01-15", createSimpleCustomProperties(3)));
|
"E-MAIL", "2018-01-15", createSimpleCustomProperties(3)));
|
||||||
try {
|
try {
|
||||||
createdTask = taskService.createTask(newTask);
|
createdTask = taskService.createTask(newTask);
|
||||||
|
fail("taskService should have thrown InvalidArgumentException.");
|
||||||
} catch (InvalidArgumentException ex) {
|
} catch (InvalidArgumentException ex) {
|
||||||
// nothing to do
|
// nothing to do
|
||||||
}
|
}
|
||||||
|
|
@ -175,6 +175,7 @@ public class CreateTaskAccTest extends AbstractAccTest {
|
||||||
"E-MAIL", "2018-01-15", createSimpleCustomProperties(3)));
|
"E-MAIL", "2018-01-15", createSimpleCustomProperties(3)));
|
||||||
try {
|
try {
|
||||||
createdTask = taskService.createTask(newTask);
|
createdTask = taskService.createTask(newTask);
|
||||||
|
fail("taskService should have thrown InvalidArgumentException.");
|
||||||
} catch (InvalidArgumentException ex) {
|
} catch (InvalidArgumentException ex) {
|
||||||
// nothing to do
|
// nothing to do
|
||||||
}
|
}
|
||||||
|
|
@ -185,6 +186,7 @@ public class CreateTaskAccTest extends AbstractAccTest {
|
||||||
"E-MAIL", "2018-01-15", createSimpleCustomProperties(3)));
|
"E-MAIL", "2018-01-15", createSimpleCustomProperties(3)));
|
||||||
try {
|
try {
|
||||||
createdTask = taskService.createTask(newTask);
|
createdTask = taskService.createTask(newTask);
|
||||||
|
fail("taskService should have thrown InvalidArgumentException.");
|
||||||
} catch (InvalidArgumentException ex) {
|
} catch (InvalidArgumentException ex) {
|
||||||
// nothing to do
|
// nothing to do
|
||||||
}
|
}
|
||||||
|
|
@ -195,6 +197,7 @@ public class CreateTaskAccTest extends AbstractAccTest {
|
||||||
"E-MAIL", "2018-01-15", createSimpleCustomProperties(3)));
|
"E-MAIL", "2018-01-15", createSimpleCustomProperties(3)));
|
||||||
try {
|
try {
|
||||||
createdTask = taskService.createTask(newTask);
|
createdTask = taskService.createTask(newTask);
|
||||||
|
fail("taskService should have thrown InvalidArgumentException.");
|
||||||
} catch (InvalidArgumentException ex) {
|
} catch (InvalidArgumentException ex) {
|
||||||
// nothing to do
|
// nothing to do
|
||||||
}
|
}
|
||||||
|
|
@ -205,6 +208,7 @@ public class CreateTaskAccTest extends AbstractAccTest {
|
||||||
"E-MAIL", "2018-01-15", createSimpleCustomProperties(3)));
|
"E-MAIL", "2018-01-15", createSimpleCustomProperties(3)));
|
||||||
try {
|
try {
|
||||||
createdTask = taskService.createTask(newTask);
|
createdTask = taskService.createTask(newTask);
|
||||||
|
fail("taskService should have thrown InvalidArgumentException.");
|
||||||
} catch (InvalidArgumentException ex) {
|
} catch (InvalidArgumentException ex) {
|
||||||
// nothing to do
|
// nothing to do
|
||||||
}
|
}
|
||||||
|
|
@ -212,27 +216,25 @@ public class CreateTaskAccTest extends AbstractAccTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
private Task makeNewTask(TaskService taskService) throws ClassificationNotFoundException {
|
private Task makeNewTask(TaskService taskService) throws ClassificationNotFoundException {
|
||||||
Task newTask = taskService.newTask();
|
Task newTask = taskService.newTask("USER_1_1");
|
||||||
newTask.setClassificationKey("L12010");
|
newTask.setClassificationKey("L12010");
|
||||||
newTask.setPrimaryObjRef(createObjectReference("COMPANY_A", "SYSTEM_A", "INSTANCE_A", "VNR", "1234567"));
|
newTask.setPrimaryObjRef(createObjectReference("COMPANY_A", "SYSTEM_A", "INSTANCE_A", "VNR", "1234567"));
|
||||||
newTask.setWorkbasketKey("USER_1_1");
|
|
||||||
newTask.setClassificationKey("L12010");
|
newTask.setClassificationKey("L12010");
|
||||||
return newTask;
|
return newTask;
|
||||||
}
|
}
|
||||||
|
|
||||||
@WithAccessId(
|
@WithAccessId(
|
||||||
userName = "user_1_1",
|
userName = "user_1_1",
|
||||||
groupNames = { "group_1" })
|
groupNames = {"group_1"})
|
||||||
@Test
|
@Test
|
||||||
public void testUseCustomNameIfSetForNewTask()
|
public void testUseCustomNameIfSetForNewTask()
|
||||||
throws SQLException, NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException,
|
throws SQLException, NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException,
|
||||||
WorkbasketNotFoundException, TaskAlreadyExistException, InvalidWorkbasketException {
|
WorkbasketNotFoundException, TaskAlreadyExistException, InvalidWorkbasketException {
|
||||||
|
|
||||||
TaskService taskService = taskanaEngine.getTaskService();
|
TaskService taskService = taskanaEngine.getTaskService();
|
||||||
Task newTask = taskService.newTask();
|
Task newTask = taskService.newTask("USER_1_1");
|
||||||
newTask.setClassificationKey("T2100");
|
newTask.setClassificationKey("T2100");
|
||||||
newTask.setPrimaryObjRef(createObjectReference("COMPANY_A", "SYSTEM_A", "INSTANCE_A", "VNR", "1234567"));
|
newTask.setPrimaryObjRef(createObjectReference("COMPANY_A", "SYSTEM_A", "INSTANCE_A", "VNR", "1234567"));
|
||||||
newTask.setWorkbasketKey("USER_1_1");
|
|
||||||
newTask.setName("Test Name");
|
newTask.setName("Test Name");
|
||||||
Task createdTask = taskService.createTask(newTask);
|
Task createdTask = taskService.createTask(newTask);
|
||||||
|
|
||||||
|
|
@ -242,17 +244,16 @@ public class CreateTaskAccTest extends AbstractAccTest {
|
||||||
|
|
||||||
@WithAccessId(
|
@WithAccessId(
|
||||||
userName = "user_1_1",
|
userName = "user_1_1",
|
||||||
groupNames = { "group_1" })
|
groupNames = {"group_1"})
|
||||||
@Test
|
@Test
|
||||||
public void testUseClassificationMetadataFromCorrectDomainForNewTask()
|
public void testUseClassificationMetadataFromCorrectDomainForNewTask()
|
||||||
throws SQLException, NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException,
|
throws SQLException, NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException,
|
||||||
WorkbasketNotFoundException, TaskAlreadyExistException, InvalidWorkbasketException {
|
WorkbasketNotFoundException, TaskAlreadyExistException, InvalidWorkbasketException {
|
||||||
|
|
||||||
TaskService taskService = taskanaEngine.getTaskService();
|
TaskService taskService = taskanaEngine.getTaskService();
|
||||||
Task newTask = taskService.newTask();
|
Task newTask = taskService.newTask("USER_1_1");
|
||||||
newTask.setClassificationKey("T2100");
|
newTask.setClassificationKey("T2100");
|
||||||
newTask.setPrimaryObjRef(createObjectReference("COMPANY_A", "SYSTEM_A", "INSTANCE_A", "VNR", "1234567"));
|
newTask.setPrimaryObjRef(createObjectReference("COMPANY_A", "SYSTEM_A", "INSTANCE_A", "VNR", "1234567"));
|
||||||
newTask.setWorkbasketKey("USER_1_1");
|
|
||||||
newTask.setName("Test Name");
|
newTask.setName("Test Name");
|
||||||
Task createdTask = taskService.createTask(newTask);
|
Task createdTask = taskService.createTask(newTask);
|
||||||
|
|
||||||
|
|
@ -262,48 +263,45 @@ public class CreateTaskAccTest extends AbstractAccTest {
|
||||||
|
|
||||||
@WithAccessId(
|
@WithAccessId(
|
||||||
userName = "user_1_1",
|
userName = "user_1_1",
|
||||||
groupNames = { "group_1" })
|
groupNames = {"group_1"})
|
||||||
@Test(expected = WorkbasketNotFoundException.class)
|
@Test(expected = WorkbasketNotFoundException.class)
|
||||||
public void testGetExceptionIfWorkbasketDoesNotExist()
|
public void testGetExceptionIfWorkbasketDoesNotExist()
|
||||||
throws SQLException, NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException,
|
throws SQLException, NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException,
|
||||||
WorkbasketNotFoundException, TaskAlreadyExistException, InvalidWorkbasketException {
|
WorkbasketNotFoundException, TaskAlreadyExistException, InvalidWorkbasketException {
|
||||||
|
|
||||||
TaskService taskService = taskanaEngine.getTaskService();
|
TaskService taskService = taskanaEngine.getTaskService();
|
||||||
Task newTask = taskService.newTask();
|
Task newTask = taskService.newTask("UNKNOWN");
|
||||||
newTask.setClassificationKey("T2100");
|
newTask.setClassificationKey("T2100");
|
||||||
newTask.setPrimaryObjRef(createObjectReference("COMPANY_A", "SYSTEM_A", "INSTANCE_A", "VNR", "1234567"));
|
newTask.setPrimaryObjRef(createObjectReference("COMPANY_A", "SYSTEM_A", "INSTANCE_A", "VNR", "1234567"));
|
||||||
newTask.setWorkbasketKey("UNKNOWN");
|
|
||||||
taskService.createTask(newTask);
|
taskService.createTask(newTask);
|
||||||
}
|
}
|
||||||
|
|
||||||
@WithAccessId(
|
@WithAccessId(
|
||||||
userName = "user_1_1",
|
userName = "user_1_1",
|
||||||
groupNames = { "group_1" })
|
groupNames = {"group_1"})
|
||||||
@Test(expected = NotAuthorizedException.class)
|
@Test(expected = NotAuthorizedException.class)
|
||||||
public void testGetExceptionIfAppendIsNotPermitted()
|
public void testGetExceptionIfAppendIsNotPermitted()
|
||||||
throws SQLException, NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException,
|
throws SQLException, NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException,
|
||||||
WorkbasketNotFoundException, TaskAlreadyExistException, InvalidWorkbasketException {
|
WorkbasketNotFoundException, TaskAlreadyExistException, InvalidWorkbasketException {
|
||||||
|
|
||||||
TaskService taskService = taskanaEngine.getTaskService();
|
TaskService taskService = taskanaEngine.getTaskService();
|
||||||
Task newTask = taskService.newTask();
|
Task newTask = taskService.newTask("GPK_KSC");
|
||||||
newTask.setClassificationKey("T2100");
|
newTask.setClassificationKey("T2100");
|
||||||
newTask.setPrimaryObjRef(createObjectReference("COMPANY_A", "SYSTEM_A", "INSTANCE_A", "VNR", "1234567"));
|
newTask.setPrimaryObjRef(createObjectReference("COMPANY_A", "SYSTEM_A", "INSTANCE_A", "VNR", "1234567"));
|
||||||
newTask.setWorkbasketKey("GPK_KSC");
|
|
||||||
taskService.createTask(newTask);
|
taskService.createTask(newTask);
|
||||||
}
|
}
|
||||||
|
|
||||||
@WithAccessId(
|
@WithAccessId(
|
||||||
userName = "user_1_1",
|
userName = "user_1_1",
|
||||||
groupNames = { "group_1" })
|
groupNames = {"group_1"})
|
||||||
@Test
|
@Test
|
||||||
public void testThrowsExceptionIfMandatoryPrimaryObjectReferenceIsNotSetOrIncomplete()
|
public void testThrowsExceptionIfMandatoryPrimaryObjectReferenceIsNotSetOrIncomplete()
|
||||||
throws SQLException, NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException,
|
throws SQLException, NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException,
|
||||||
WorkbasketNotFoundException, TaskAlreadyExistException, InvalidWorkbasketException {
|
WorkbasketNotFoundException, TaskAlreadyExistException, InvalidWorkbasketException {
|
||||||
|
|
||||||
TaskService taskService = taskanaEngine.getTaskService();
|
TaskService taskService = taskanaEngine.getTaskService();
|
||||||
Task newTask = taskService.newTask();
|
Task newTask = taskService.newTask("USER_1_1");
|
||||||
newTask.setClassificationKey("T2100");
|
newTask.setClassificationKey("T2100");
|
||||||
newTask.setWorkbasketKey("USER_1_1");
|
|
||||||
Task createdTask;
|
Task createdTask;
|
||||||
try {
|
try {
|
||||||
createdTask = taskService.createTask(newTask);
|
createdTask = taskService.createTask(newTask);
|
||||||
|
|
@ -313,9 +311,8 @@ public class CreateTaskAccTest extends AbstractAccTest {
|
||||||
|
|
||||||
// Exception
|
// Exception
|
||||||
|
|
||||||
newTask = taskService.newTask();
|
newTask = taskService.newTask("USER_1_1");
|
||||||
newTask.setClassificationKey("T2100");
|
newTask.setClassificationKey("T2100");
|
||||||
newTask.setWorkbasketKey("USER_1_1");
|
|
||||||
newTask.setPrimaryObjRef(createObjectReference("COMPANY_A", "SYSTEM_A", "INSTANCE_A", "VNR", null));
|
newTask.setPrimaryObjRef(createObjectReference("COMPANY_A", "SYSTEM_A", "INSTANCE_A", "VNR", null));
|
||||||
try {
|
try {
|
||||||
createdTask = taskService.createTask(newTask);
|
createdTask = taskService.createTask(newTask);
|
||||||
|
|
@ -325,9 +322,8 @@ public class CreateTaskAccTest extends AbstractAccTest {
|
||||||
|
|
||||||
// Exception
|
// Exception
|
||||||
|
|
||||||
newTask = taskService.newTask();
|
newTask = taskService.newTask("USER_1_1");
|
||||||
newTask.setClassificationKey("T2100");
|
newTask.setClassificationKey("T2100");
|
||||||
newTask.setWorkbasketKey("USER_1_1");
|
|
||||||
newTask.setPrimaryObjRef(createObjectReference("COMPANY_A", "SYSTEM_A", "INSTANCE_A", null, "1234567"));
|
newTask.setPrimaryObjRef(createObjectReference("COMPANY_A", "SYSTEM_A", "INSTANCE_A", null, "1234567"));
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
@ -338,9 +334,8 @@ public class CreateTaskAccTest extends AbstractAccTest {
|
||||||
|
|
||||||
// Exception
|
// Exception
|
||||||
|
|
||||||
newTask = taskService.newTask();
|
newTask = taskService.newTask("USER_1_1");
|
||||||
newTask.setClassificationKey("T2100");
|
newTask.setClassificationKey("T2100");
|
||||||
newTask.setWorkbasketKey("USER_1_1");
|
|
||||||
newTask.setPrimaryObjRef(createObjectReference("COMPANY_A", "SYSTEM_A", null, "VNR", "1234567"));
|
newTask.setPrimaryObjRef(createObjectReference("COMPANY_A", "SYSTEM_A", null, "VNR", "1234567"));
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
@ -351,9 +346,8 @@ public class CreateTaskAccTest extends AbstractAccTest {
|
||||||
|
|
||||||
// Exception
|
// Exception
|
||||||
|
|
||||||
newTask = taskService.newTask();
|
newTask = taskService.newTask("USER_1_1");
|
||||||
newTask.setClassificationKey("T2100");
|
newTask.setClassificationKey("T2100");
|
||||||
newTask.setWorkbasketKey("USER_1_1");
|
|
||||||
newTask.setPrimaryObjRef(createObjectReference("COMPANY_A", null, "INSTANCE_A", "VNR", "1234567"));
|
newTask.setPrimaryObjRef(createObjectReference("COMPANY_A", null, "INSTANCE_A", "VNR", "1234567"));
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
@ -364,9 +358,8 @@ public class CreateTaskAccTest extends AbstractAccTest {
|
||||||
|
|
||||||
// Exception
|
// Exception
|
||||||
|
|
||||||
newTask = taskService.newTask();
|
newTask = taskService.newTask("USER_1_1");
|
||||||
newTask.setClassificationKey("T2100");
|
newTask.setClassificationKey("T2100");
|
||||||
newTask.setWorkbasketKey("USER_1_1");
|
|
||||||
newTask.setPrimaryObjRef(createObjectReference(null, "SYSTEM_A", "INSTANCE_A", "VNR", "1234567"));
|
newTask.setPrimaryObjRef(createObjectReference(null, "SYSTEM_A", "INSTANCE_A", "VNR", "1234567"));
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
@ -381,7 +374,7 @@ public class CreateTaskAccTest extends AbstractAccTest {
|
||||||
|
|
||||||
@WithAccessId(
|
@WithAccessId(
|
||||||
userName = "user_1_1",
|
userName = "user_1_1",
|
||||||
groupNames = { "group_1" })
|
groupNames = {"group_1"})
|
||||||
@Test
|
@Test
|
||||||
public void testSetDomainFromWorkbasket()
|
public void testSetDomainFromWorkbasket()
|
||||||
throws SQLException, NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException,
|
throws SQLException, NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException,
|
||||||
|
|
@ -392,10 +385,9 @@ public class CreateTaskAccTest extends AbstractAccTest {
|
||||||
|
|
||||||
Workbasket workbasket = workbasketService.getWorkbasketByKey("USER_1_1");
|
Workbasket workbasket = workbasketService.getWorkbasketByKey("USER_1_1");
|
||||||
|
|
||||||
Task newTask = taskService.newTask();
|
Task newTask = taskService.newTask("USER_1_1");
|
||||||
newTask.setClassificationKey("T2100");
|
newTask.setClassificationKey("T2100");
|
||||||
newTask.setPrimaryObjRef(createObjectReference("COMPANY_A", "SYSTEM_A", "INSTANCE_A", "VNR", "1234567"));
|
newTask.setPrimaryObjRef(createObjectReference("COMPANY_A", "SYSTEM_A", "INSTANCE_A", "VNR", "1234567"));
|
||||||
newTask.setWorkbasketKey("USER_1_1");
|
|
||||||
Task createdTask = taskService.createTask(newTask);
|
Task createdTask = taskService.createTask(newTask);
|
||||||
|
|
||||||
assertNotNull(createdTask);
|
assertNotNull(createdTask);
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ import static org.junit.Assert.assertThat;
|
||||||
import static org.junit.Assert.fail;
|
import static org.junit.Assert.fail;
|
||||||
|
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
|
import java.time.Instant;
|
||||||
|
|
||||||
import org.h2.store.fs.FileUtils;
|
import org.h2.store.fs.FileUtils;
|
||||||
import org.junit.AfterClass;
|
import org.junit.AfterClass;
|
||||||
|
|
@ -29,6 +30,7 @@ import pro.taskana.exceptions.NotAuthorizedException;
|
||||||
import pro.taskana.exceptions.TaskAlreadyExistException;
|
import pro.taskana.exceptions.TaskAlreadyExistException;
|
||||||
import pro.taskana.exceptions.TaskNotFoundException;
|
import pro.taskana.exceptions.TaskNotFoundException;
|
||||||
import pro.taskana.exceptions.WorkbasketNotFoundException;
|
import pro.taskana.exceptions.WorkbasketNotFoundException;
|
||||||
|
import pro.taskana.impl.TaskImpl;
|
||||||
import pro.taskana.security.JAASRunner;
|
import pro.taskana.security.JAASRunner;
|
||||||
import pro.taskana.security.WithAccessId;
|
import pro.taskana.security.WithAccessId;
|
||||||
|
|
||||||
|
|
@ -44,7 +46,7 @@ public class UpdateTaskAccTest extends AbstractAccTest {
|
||||||
|
|
||||||
@WithAccessId(
|
@WithAccessId(
|
||||||
userName = "user_1_1",
|
userName = "user_1_1",
|
||||||
groupNames = { "group_1" })
|
groupNames = {"group_1"})
|
||||||
@Test
|
@Test
|
||||||
public void testUpdatePrimaryObjectReferenceOfTask()
|
public void testUpdatePrimaryObjectReferenceOfTask()
|
||||||
throws SQLException, NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException,
|
throws SQLException, NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException,
|
||||||
|
|
@ -53,6 +55,7 @@ public class UpdateTaskAccTest extends AbstractAccTest {
|
||||||
|
|
||||||
TaskService taskService = taskanaEngine.getTaskService();
|
TaskService taskService = taskanaEngine.getTaskService();
|
||||||
Task task = taskService.getTask("TKI:000000000000000000000000000000000000");
|
Task task = taskService.getTask("TKI:000000000000000000000000000000000000");
|
||||||
|
Instant modifiedOriginal = task.getModified();
|
||||||
task.setPrimaryObjRef(createObjectReference("COMPANY_A", "SYSTEM_A", "INSTANCE_A", "VNR", "7654321"));
|
task.setPrimaryObjRef(createObjectReference("COMPANY_A", "SYSTEM_A", "INSTANCE_A", "VNR", "7654321"));
|
||||||
Task updatedTask = taskService.updateTask(task);
|
Task updatedTask = taskService.updateTask(task);
|
||||||
updatedTask = taskService.getTask(updatedTask.getId());
|
updatedTask = taskService.getTask(updatedTask.getId());
|
||||||
|
|
@ -61,6 +64,7 @@ public class UpdateTaskAccTest extends AbstractAccTest {
|
||||||
Assert.assertEquals("7654321", updatedTask.getPrimaryObjRef().getValue());
|
Assert.assertEquals("7654321", updatedTask.getPrimaryObjRef().getValue());
|
||||||
Assert.assertNotNull(updatedTask.getCreated());
|
Assert.assertNotNull(updatedTask.getCreated());
|
||||||
Assert.assertNotNull(updatedTask.getModified());
|
Assert.assertNotNull(updatedTask.getModified());
|
||||||
|
Assert.assertTrue(modifiedOriginal.isBefore(updatedTask.getModified()));
|
||||||
Assert.assertNotEquals(updatedTask.getCreated(), updatedTask.getModified());
|
Assert.assertNotEquals(updatedTask.getCreated(), updatedTask.getModified());
|
||||||
Assert.assertEquals(task.getCreated(), updatedTask.getCreated());
|
Assert.assertEquals(task.getCreated(), updatedTask.getCreated());
|
||||||
Assert.assertEquals(task.isRead(), updatedTask.isRead());
|
Assert.assertEquals(task.isRead(), updatedTask.isRead());
|
||||||
|
|
@ -68,7 +72,7 @@ public class UpdateTaskAccTest extends AbstractAccTest {
|
||||||
|
|
||||||
@WithAccessId(
|
@WithAccessId(
|
||||||
userName = "user_1_1",
|
userName = "user_1_1",
|
||||||
groupNames = { "group_1" })
|
groupNames = {"group_1"})
|
||||||
@Test
|
@Test
|
||||||
public void testThrowsExceptionIfMandatoryPrimaryObjectReferenceIsNotSetOrIncomplete()
|
public void testThrowsExceptionIfMandatoryPrimaryObjectReferenceIsNotSetOrIncomplete()
|
||||||
throws SQLException, NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException,
|
throws SQLException, NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException,
|
||||||
|
|
@ -126,7 +130,7 @@ public class UpdateTaskAccTest extends AbstractAccTest {
|
||||||
|
|
||||||
@WithAccessId(
|
@WithAccessId(
|
||||||
userName = "user_1_1",
|
userName = "user_1_1",
|
||||||
groupNames = { "group_1" })
|
groupNames = {"group_1"})
|
||||||
@Test
|
@Test
|
||||||
public void testThrowsExceptionIfTaskHasAlreadyBeenUpdated()
|
public void testThrowsExceptionIfTaskHasAlreadyBeenUpdated()
|
||||||
throws SQLException, NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException,
|
throws SQLException, NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException,
|
||||||
|
|
@ -153,7 +157,7 @@ public class UpdateTaskAccTest extends AbstractAccTest {
|
||||||
|
|
||||||
@WithAccessId(
|
@WithAccessId(
|
||||||
userName = "user_1_1",
|
userName = "user_1_1",
|
||||||
groupNames = { "group_1" })
|
groupNames = {"group_1"})
|
||||||
@Test
|
@Test
|
||||||
public void testUpdateClassificationOfTask()
|
public void testUpdateClassificationOfTask()
|
||||||
throws TaskNotFoundException, WorkbasketNotFoundException, ClassificationNotFoundException,
|
throws TaskNotFoundException, WorkbasketNotFoundException, ClassificationNotFoundException,
|
||||||
|
|
@ -178,7 +182,7 @@ public class UpdateTaskAccTest extends AbstractAccTest {
|
||||||
|
|
||||||
@WithAccessId(
|
@WithAccessId(
|
||||||
userName = "user_1_1",
|
userName = "user_1_1",
|
||||||
groupNames = { "group_1" })
|
groupNames = {"group_1"})
|
||||||
@Test
|
@Test
|
||||||
public void testCustomPropertiesOfTask()
|
public void testCustomPropertiesOfTask()
|
||||||
throws TaskNotFoundException, WorkbasketNotFoundException, ClassificationNotFoundException,
|
throws TaskNotFoundException, WorkbasketNotFoundException, ClassificationNotFoundException,
|
||||||
|
|
@ -195,7 +199,7 @@ public class UpdateTaskAccTest extends AbstractAccTest {
|
||||||
|
|
||||||
@WithAccessId(
|
@WithAccessId(
|
||||||
userName = "user_1_1",
|
userName = "user_1_1",
|
||||||
groupNames = { "group_1" })
|
groupNames = {"group_1"})
|
||||||
@Test(expected = InvalidArgumentException.class)
|
@Test(expected = InvalidArgumentException.class)
|
||||||
public void testUpdateOfWorkbasketKeyWhatIsNotAllowed()
|
public void testUpdateOfWorkbasketKeyWhatIsNotAllowed()
|
||||||
throws SQLException, NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException,
|
throws SQLException, NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException,
|
||||||
|
|
@ -204,7 +208,7 @@ public class UpdateTaskAccTest extends AbstractAccTest {
|
||||||
|
|
||||||
TaskService taskService = taskanaEngine.getTaskService();
|
TaskService taskService = taskanaEngine.getTaskService();
|
||||||
Task task = taskService.getTask("TKI:000000000000000000000000000000000000");
|
Task task = taskService.getTask("TKI:000000000000000000000000000000000000");
|
||||||
task.setWorkbasketKey("USER_2_2");
|
((TaskImpl) task).setWorkbasketKey("USER_2_2");
|
||||||
Task updatedTask = taskService.updateTask(task);
|
Task updatedTask = taskService.updateTask(task);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -111,9 +111,8 @@ public class TaskServiceImplIntAutocommitTest {
|
||||||
Classification classification = classificationService.newClassification("novatec", "TEST", "t1");
|
Classification classification = classificationService.newClassification("novatec", "TEST", "t1");
|
||||||
taskanaEngine.getClassificationService().createClassification(classification);
|
taskanaEngine.getClassificationService().createClassification(classification);
|
||||||
|
|
||||||
Task task = taskServiceImpl.newTask();
|
Task task = taskServiceImpl.newTask(wb.getKey());
|
||||||
task.setName("Unit Test Task");
|
task.setName("Unit Test Task");
|
||||||
task.setWorkbasketKey(wb.getKey());
|
|
||||||
|
|
||||||
task.setClassificationKey(classification.getKey());
|
task.setClassificationKey(classification.getKey());
|
||||||
task.setPrimaryObjRef(JunitHelper.createDefaultObjRef());
|
task.setPrimaryObjRef(JunitHelper.createDefaultObjRef());
|
||||||
|
|
@ -145,9 +144,8 @@ public class TaskServiceImplIntAutocommitTest {
|
||||||
classification.getKey(),
|
classification.getKey(),
|
||||||
classification.getDomain());
|
classification.getDomain());
|
||||||
|
|
||||||
TaskImpl task = (TaskImpl) taskServiceImpl.newTask();
|
TaskImpl task = (TaskImpl) taskServiceImpl.newTask(wb.getKey());
|
||||||
task.setName("Unit Test Task");
|
task.setName("Unit Test Task");
|
||||||
task.setWorkbasketKey(wb.getKey());
|
|
||||||
task.setClassificationKey(classification.getKey());
|
task.setClassificationKey(classification.getKey());
|
||||||
task.setPrimaryObjRef(JunitHelper.createDefaultObjRef());
|
task.setPrimaryObjRef(JunitHelper.createDefaultObjRef());
|
||||||
taskServiceImpl.createTask(task);
|
taskServiceImpl.createTask(task);
|
||||||
|
|
@ -179,9 +177,8 @@ public class TaskServiceImplIntAutocommitTest {
|
||||||
Classification classification = te.getClassificationService().newClassification("novatec", "TEST", "t1");
|
Classification classification = te.getClassificationService().newClassification("novatec", "TEST", "t1");
|
||||||
te.getClassificationService().createClassification(classification);
|
te.getClassificationService().createClassification(classification);
|
||||||
|
|
||||||
Task task = taskServiceImpl.newTask();
|
Task task = taskServiceImpl.newTask(wb.getKey());
|
||||||
task.setName("Unit Test Task");
|
task.setName("Unit Test Task");
|
||||||
task.setWorkbasketKey(wb.getKey());
|
|
||||||
task.setClassificationKey(classification.getKey());
|
task.setClassificationKey(classification.getKey());
|
||||||
task.setPrimaryObjRef(JunitHelper.createDefaultObjRef());
|
task.setPrimaryObjRef(JunitHelper.createDefaultObjRef());
|
||||||
task = taskServiceImpl.createTask(task);
|
task = taskServiceImpl.createTask(task);
|
||||||
|
|
@ -203,9 +200,8 @@ public class TaskServiceImplIntAutocommitTest {
|
||||||
Classification classification = classificationService.newClassification("novatec", "TEST", "t1");
|
Classification classification = classificationService.newClassification("novatec", "TEST", "t1");
|
||||||
taskanaEngine.getClassificationService().createClassification(classification);
|
taskanaEngine.getClassificationService().createClassification(classification);
|
||||||
|
|
||||||
Task task = taskServiceImpl.newTask();
|
Task task = taskServiceImpl.newTask(wb.getKey());
|
||||||
task.setName("Unit Test Task");
|
task.setName("Unit Test Task");
|
||||||
task.setWorkbasketKey(wb.getKey());
|
|
||||||
task.setClassificationKey(classification.getKey());
|
task.setClassificationKey(classification.getKey());
|
||||||
task.setPrimaryObjRef(JunitHelper.createDefaultObjRef());
|
task.setPrimaryObjRef(JunitHelper.createDefaultObjRef());
|
||||||
taskServiceImpl.createTask(task);
|
taskServiceImpl.createTask(task);
|
||||||
|
|
@ -242,11 +238,10 @@ public class TaskServiceImplIntAutocommitTest {
|
||||||
dummyClassification.setName("Dummy-Classification");
|
dummyClassification.setName("Dummy-Classification");
|
||||||
classificationService.createClassification(dummyClassification);
|
classificationService.createClassification(dummyClassification);
|
||||||
|
|
||||||
TaskImpl dummyTask = (TaskImpl) taskServiceImpl.newTask();
|
TaskImpl dummyTask = (TaskImpl) taskServiceImpl.newTask(dummyWorkbasket.getKey());
|
||||||
dummyTask.setId(null);
|
dummyTask.setId(null);
|
||||||
dummyTask.setName("Dummy-Task");
|
dummyTask.setName("Dummy-Task");
|
||||||
dummyTask.setClassificationKey(dummyClassification.getKey());
|
dummyTask.setClassificationKey(dummyClassification.getKey());
|
||||||
dummyTask.setWorkbasketKey(dummyWorkbasket.getKey());
|
|
||||||
dummyTask.setPrimaryObjRef(JunitHelper.createDefaultObjRef());
|
dummyTask.setPrimaryObjRef(JunitHelper.createDefaultObjRef());
|
||||||
dummyTask = (TaskImpl) taskServiceImpl.createTask(dummyTask);
|
dummyTask = (TaskImpl) taskServiceImpl.createTask(dummyTask);
|
||||||
|
|
||||||
|
|
@ -323,10 +318,9 @@ public class TaskServiceImplIntAutocommitTest {
|
||||||
classificationService.createClassification(classification);
|
classificationService.createClassification(classification);
|
||||||
|
|
||||||
// Task which should be transfered
|
// Task which should be transfered
|
||||||
task = (TaskImpl) taskServiceImpl.newTask();
|
task = (TaskImpl) taskServiceImpl.newTask(sourceWB.getKey());
|
||||||
task.setName("Task Name");
|
task.setName("Task Name");
|
||||||
task.setDescription("Task used for transfer Test");
|
task.setDescription("Task used for transfer Test");
|
||||||
task.setWorkbasketKey(sourceWB.getKey());
|
|
||||||
task.setRead(true);
|
task.setRead(true);
|
||||||
task.setTransferred(false);
|
task.setTransferred(false);
|
||||||
task.setModified(null);
|
task.setModified(null);
|
||||||
|
|
@ -405,10 +399,9 @@ public class TaskServiceImplIntAutocommitTest {
|
||||||
wbNoTransfer = (WorkbasketImpl) workbasketService.createWorkbasket(wbNoTransfer);
|
wbNoTransfer = (WorkbasketImpl) workbasketService.createWorkbasket(wbNoTransfer);
|
||||||
createWorkbasketWithSecurity(wbNoTransfer, wbNoTransfer.getOwner(), true, true, true, false);
|
createWorkbasketWithSecurity(wbNoTransfer, wbNoTransfer.getOwner(), true, true, true, false);
|
||||||
|
|
||||||
TaskImpl task = (TaskImpl) taskServiceImpl.newTask();
|
TaskImpl task = (TaskImpl) taskServiceImpl.newTask(wb.getKey());
|
||||||
task.setName("Task Name");
|
task.setName("Task Name");
|
||||||
task.setDescription("Task used for transfer Test");
|
task.setDescription("Task used for transfer Test");
|
||||||
task.setWorkbasketKey(wb.getKey());
|
|
||||||
task.setOwner(user);
|
task.setOwner(user);
|
||||||
task.setClassificationKey(classification.getKey());
|
task.setClassificationKey(classification.getKey());
|
||||||
task.setPrimaryObjRef(JunitHelper.createDefaultObjRef());
|
task.setPrimaryObjRef(JunitHelper.createDefaultObjRef());
|
||||||
|
|
@ -457,9 +450,8 @@ public class TaskServiceImplIntAutocommitTest {
|
||||||
Classification classification = classificationService.newClassification("novatec", "TEST", "t1");
|
Classification classification = classificationService.newClassification("novatec", "TEST", "t1");
|
||||||
taskanaEngine.getClassificationService().createClassification(classification);
|
taskanaEngine.getClassificationService().createClassification(classification);
|
||||||
|
|
||||||
Task task = taskServiceImpl.newTask();
|
Task task = taskServiceImpl.newTask(wb.getKey());
|
||||||
task.setName("Unit Test Task");
|
task.setName("Unit Test Task");
|
||||||
task.setWorkbasketKey(wb.getKey());
|
|
||||||
|
|
||||||
task.setClassificationKey(classification.getKey());
|
task.setClassificationKey(classification.getKey());
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -121,9 +121,8 @@ public class TaskServiceImplIntExplicitTest {
|
||||||
taskanaEngineImpl.getWorkbasketService().createWorkbasket(workbasket);
|
taskanaEngineImpl.getWorkbasketService().createWorkbasket(workbasket);
|
||||||
taskanaEngineImpl.getClassificationService().createClassification(classification);
|
taskanaEngineImpl.getClassificationService().createClassification(classification);
|
||||||
connection.commit();
|
connection.commit();
|
||||||
Task task = taskServiceImpl.newTask();
|
Task task = taskServiceImpl.newTask(workbasket.getKey());
|
||||||
task.setName("Unit Test Task");
|
task.setName("Unit Test Task");
|
||||||
task.setWorkbasketKey(workbasket.getKey());
|
|
||||||
task.setClassificationKey(classification.getKey());
|
task.setClassificationKey(classification.getKey());
|
||||||
task.setPrimaryObjRef(JunitHelper.createDefaultObjRef());
|
task.setPrimaryObjRef(JunitHelper.createDefaultObjRef());
|
||||||
task = taskServiceImpl.createTask(task);
|
task = taskServiceImpl.createTask(task);
|
||||||
|
|
@ -196,9 +195,8 @@ public class TaskServiceImplIntExplicitTest {
|
||||||
Classification classification = classificationService.newClassification("novatec", "TEST", "t1");
|
Classification classification = classificationService.newClassification("novatec", "TEST", "t1");
|
||||||
classification = classificationServiceImpl.createClassification(classification);
|
classification = classificationServiceImpl.createClassification(classification);
|
||||||
|
|
||||||
Task task = taskServiceImpl.newTask();
|
Task task = taskServiceImpl.newTask(workbasket.getKey());
|
||||||
task.setName("Unit Test Task");
|
task.setName("Unit Test Task");
|
||||||
task.setWorkbasketKey(workbasket.getKey());
|
|
||||||
task.setClassificationKey(classification.getKey());
|
task.setClassificationKey(classification.getKey());
|
||||||
task.setPrimaryObjRef(JunitHelper.createDefaultObjRef());
|
task.setPrimaryObjRef(JunitHelper.createDefaultObjRef());
|
||||||
task.addAttachment(null);
|
task.addAttachment(null);
|
||||||
|
|
@ -251,8 +249,7 @@ public class TaskServiceImplIntExplicitTest {
|
||||||
wb.setKey("k1");
|
wb.setKey("k1");
|
||||||
workbasketService.createWorkbasket(wb);
|
workbasketService.createWorkbasket(wb);
|
||||||
|
|
||||||
Task test = taskServiceImpl.newTask();
|
Task test = taskServiceImpl.newTask("k1");
|
||||||
test.setWorkbasketKey("k1");
|
|
||||||
test.setPrimaryObjRef(objectReference);
|
test.setPrimaryObjRef(objectReference);
|
||||||
test.setPlanned(tomorrow);
|
test.setPlanned(tomorrow);
|
||||||
test.setClassificationKey(classification.getKey());
|
test.setClassificationKey(classification.getKey());
|
||||||
|
|
@ -267,8 +264,7 @@ public class TaskServiceImplIntExplicitTest {
|
||||||
Assert.assertNotEquals(resultTask.getPlanned(), resultTask.getCreated());
|
Assert.assertNotEquals(resultTask.getPlanned(), resultTask.getCreated());
|
||||||
Assert.assertNotNull(resultTask.getDue());
|
Assert.assertNotNull(resultTask.getDue());
|
||||||
|
|
||||||
Task task2 = taskServiceImpl.newTask();
|
Task task2 = taskServiceImpl.newTask(task.getWorkbasketKey());
|
||||||
task2.setWorkbasketKey(task.getWorkbasketKey());
|
|
||||||
task2.setClassificationKey(classification.getKey());
|
task2.setClassificationKey(classification.getKey());
|
||||||
task2.setPrimaryObjRef(objectReference);
|
task2.setPrimaryObjRef(objectReference);
|
||||||
task2.setDescription("desc");
|
task2.setDescription("desc");
|
||||||
|
|
@ -295,7 +291,7 @@ public class TaskServiceImplIntExplicitTest {
|
||||||
generateSampleAccessItems();
|
generateSampleAccessItems();
|
||||||
|
|
||||||
Task test = this.generateDummyTask();
|
Task test = this.generateDummyTask();
|
||||||
test.setWorkbasketKey("2");
|
((TaskImpl) test).setWorkbasketKey("2");
|
||||||
taskServiceImpl.createTask(test);
|
taskServiceImpl.createTask(test);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -324,7 +320,7 @@ public class TaskServiceImplIntExplicitTest {
|
||||||
classification.setName("not persisted - so not found.");
|
classification.setName("not persisted - so not found.");
|
||||||
|
|
||||||
Task task = this.generateDummyTask();
|
Task task = this.generateDummyTask();
|
||||||
task.setWorkbasketKey(wb.getKey());
|
((TaskImpl) task).setWorkbasketKey(wb.getKey());
|
||||||
task.setClassificationKey(classification.getKey());
|
task.setClassificationKey(classification.getKey());
|
||||||
taskServiceImpl.createTask(task);
|
taskServiceImpl.createTask(task);
|
||||||
}
|
}
|
||||||
|
|
@ -349,9 +345,8 @@ public class TaskServiceImplIntExplicitTest {
|
||||||
workbasket.setDomain("novatec");
|
workbasket.setDomain("novatec");
|
||||||
workbasket = (WorkbasketImpl) workbasketService.createWorkbasket(workbasket);
|
workbasket = (WorkbasketImpl) workbasketService.createWorkbasket(workbasket);
|
||||||
|
|
||||||
Task task = taskServiceImpl.newTask();
|
Task task = taskServiceImpl.newTask("k1");
|
||||||
task.setName("Unit Test Task");
|
task.setName("Unit Test Task");
|
||||||
task.setWorkbasketKey("k1");
|
|
||||||
task.setClassificationKey(classification.getKey());
|
task.setClassificationKey(classification.getKey());
|
||||||
task.setPrimaryObjRef(JunitHelper.createDefaultObjRef());
|
task.setPrimaryObjRef(JunitHelper.createDefaultObjRef());
|
||||||
task = taskServiceImpl.createTask(task);
|
task = taskServiceImpl.createTask(task);
|
||||||
|
|
@ -424,10 +419,9 @@ public class TaskServiceImplIntExplicitTest {
|
||||||
classificationService.createClassification(classification);
|
classificationService.createClassification(classification);
|
||||||
|
|
||||||
// Task which should be transfered
|
// Task which should be transfered
|
||||||
task = (TaskImpl) taskServiceImpl.newTask();
|
task = (TaskImpl) taskServiceImpl.newTask(sourceWB.getKey());
|
||||||
task.setName("Task Name");
|
task.setName("Task Name");
|
||||||
task.setDescription("Task used for transfer Test");
|
task.setDescription("Task used for transfer Test");
|
||||||
task.setWorkbasketKey(sourceWB.getKey());
|
|
||||||
task.setRead(true);
|
task.setRead(true);
|
||||||
task.setTransferred(false);
|
task.setTransferred(false);
|
||||||
task.setModified(null);
|
task.setModified(null);
|
||||||
|
|
@ -512,10 +506,9 @@ public class TaskServiceImplIntExplicitTest {
|
||||||
wbNoTransfer = (WorkbasketImpl) workbasketService.createWorkbasket(wbNoTransfer);
|
wbNoTransfer = (WorkbasketImpl) workbasketService.createWorkbasket(wbNoTransfer);
|
||||||
createWorkbasketWithSecurity(wbNoTransfer, wbNoTransfer.getOwner(), true, true, true, false);
|
createWorkbasketWithSecurity(wbNoTransfer, wbNoTransfer.getOwner(), true, true, true, false);
|
||||||
|
|
||||||
TaskImpl task = (TaskImpl) taskServiceImpl.newTask();
|
TaskImpl task = (TaskImpl) taskServiceImpl.newTask(wb.getKey());
|
||||||
task.setName("Task Name");
|
task.setName("Task Name");
|
||||||
task.setDescription("Task used for transfer Test");
|
task.setDescription("Task used for transfer Test");
|
||||||
task.setWorkbasketKey(wb.getKey());
|
|
||||||
task.setOwner(user);
|
task.setOwner(user);
|
||||||
task.setClassificationKey(classification.getKey());
|
task.setClassificationKey(classification.getKey());
|
||||||
task.setPrimaryObjRef(JunitHelper.createDefaultObjRef());
|
task.setPrimaryObjRef(JunitHelper.createDefaultObjRef());
|
||||||
|
|
@ -563,8 +556,7 @@ public class TaskServiceImplIntExplicitTest {
|
||||||
Classification classification = classificationService.newClassification("novatec", "TEST", "t1");
|
Classification classification = classificationService.newClassification("novatec", "TEST", "t1");
|
||||||
taskanaEngine.getClassificationService().createClassification(classification);
|
taskanaEngine.getClassificationService().createClassification(classification);
|
||||||
|
|
||||||
Task task = taskServiceImpl.newTask();
|
Task task = taskServiceImpl.newTask(workbasket.getKey());
|
||||||
task.setWorkbasketKey(workbasket.getKey());
|
|
||||||
task.setClassificationKey(classification.getKey());
|
task.setClassificationKey(classification.getKey());
|
||||||
return task;
|
return task;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -29,9 +29,8 @@ public class ExampleBootstrap {
|
||||||
ClassificationNotFoundException, InvalidStateException, InvalidOwnerException, InvalidWorkbasketException,
|
ClassificationNotFoundException, InvalidStateException, InvalidOwnerException, InvalidWorkbasketException,
|
||||||
TaskAlreadyExistException, InvalidArgumentException {
|
TaskAlreadyExistException, InvalidArgumentException {
|
||||||
System.out.println("---------------------------> Start App");
|
System.out.println("---------------------------> Start App");
|
||||||
Task task = taskService.newTask();
|
Task task = taskService.newTask("1");
|
||||||
task.setName("Spring example task");
|
task.setName("Spring example task");
|
||||||
task.setWorkbasketKey("1");
|
|
||||||
ObjectReference objRef = new ObjectReference();
|
ObjectReference objRef = new ObjectReference();
|
||||||
objRef.setCompany("aCompany");
|
objRef.setCompany("aCompany");
|
||||||
objRef.setSystem("aSystem");
|
objRef.setSystem("aSystem");
|
||||||
|
|
|
||||||
|
|
@ -26,9 +26,8 @@ public class TaskanaComponent {
|
||||||
public void triggerRollback() throws NotAuthorizedException, WorkbasketNotFoundException,
|
public void triggerRollback() throws NotAuthorizedException, WorkbasketNotFoundException,
|
||||||
ClassificationNotFoundException, InvalidWorkbasketException, TaskAlreadyExistException,
|
ClassificationNotFoundException, InvalidWorkbasketException, TaskAlreadyExistException,
|
||||||
InvalidArgumentException {
|
InvalidArgumentException {
|
||||||
Task task = taskService.newTask();
|
Task task = taskService.newTask("1");
|
||||||
task.setName("Unit Test Task");
|
task.setName("Unit Test Task");
|
||||||
task.setWorkbasketKey("1");
|
|
||||||
ObjectReference objRef = new ObjectReference();
|
ObjectReference objRef = new ObjectReference();
|
||||||
objRef.setCompany("aCompany");
|
objRef.setCompany("aCompany");
|
||||||
objRef.setSystem("aSystem");
|
objRef.setSystem("aSystem");
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue