TSK-136: acceptance test for getAttachments
This commit is contained in:
parent
69784458af
commit
9b1fe8850a
|
@ -36,7 +36,7 @@ public class CreateTaskAccTest extends AbstractAccTest {
|
|||
|
||||
@WithAccessId(
|
||||
userName = "user_1_1",
|
||||
groupNames = {"group_1"})
|
||||
groupNames = { "group_1" })
|
||||
@Test
|
||||
public void testCreateSimpleManualTask()
|
||||
throws SQLException, NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException,
|
||||
|
@ -68,7 +68,7 @@ public class CreateTaskAccTest extends AbstractAccTest {
|
|||
|
||||
@WithAccessId(
|
||||
userName = "user_1_1",
|
||||
groupNames = {"group_1"})
|
||||
groupNames = { "group_1" })
|
||||
@Test
|
||||
public void testCreateExternalTaskWithAttachment()
|
||||
throws SQLException, NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException,
|
||||
|
@ -85,14 +85,22 @@ public class CreateTaskAccTest extends AbstractAccTest {
|
|||
"E-MAIL", "2018-01-15", createSimpleCustomProperties(3)));
|
||||
Task createdTask = taskService.createTask(newTask);
|
||||
|
||||
assertNotNull(createdTask);
|
||||
assertNotNull(createdTask.getAttachments());
|
||||
assertEquals(1, createdTask.getAttachments().size());
|
||||
assertNotNull(createdTask.getId());
|
||||
|
||||
// rename getTaskById to getTask
|
||||
// Task readTask = taskService.getTask(createdTask.getId());
|
||||
|
||||
// assertNotNull(readTask);
|
||||
// assertNotNull(readTask.getAttachments());
|
||||
// assertEquals(1, readTask.getAttachments().size());
|
||||
// assertNotNull(readTask.getAttachments().get(0).getCreated());
|
||||
// assertNotNull(readTask.getAttachments().get(0).getModified());
|
||||
// assertEquals(readTask.getAttachments().get(0).getCreated(), readTask.getAttachments().get(0).getModified());
|
||||
}
|
||||
|
||||
@WithAccessId(
|
||||
userName = "user_1_1",
|
||||
groupNames = {"group_1"})
|
||||
groupNames = { "group_1" })
|
||||
@Test
|
||||
public void testCreateExternalTaskWithMultipleAttachments()
|
||||
throws SQLException, NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException,
|
||||
|
@ -113,14 +121,22 @@ public class CreateTaskAccTest extends AbstractAccTest {
|
|||
"E-MAIL", "2018-01-15", createSimpleCustomProperties(3)));
|
||||
Task createdTask = taskService.createTask(newTask);
|
||||
|
||||
assertNotNull(createdTask);
|
||||
assertNotNull(createdTask.getAttachments());
|
||||
assertEquals(2, createdTask.getAttachments().size());
|
||||
assertNotNull(createdTask.getId());
|
||||
|
||||
// rename getTaskById to getTask
|
||||
// Task readTask = taskService.getTask(createdTask.getId());
|
||||
|
||||
// assertNotNull(readTask);
|
||||
// assertNotNull(readTask.getAttachments());
|
||||
// assertEquals(2, readTask.getAttachments().size());
|
||||
// assertNotNull(readTask.getAttachments().get(1).getCreated());
|
||||
// assertNotNull(readTask.getAttachments().get(1).getModified());
|
||||
// assertEquals(readTask.getAttachments().get(0).getCreated(), readTask.getAttachments().get(1).getModified());
|
||||
}
|
||||
|
||||
@WithAccessId(
|
||||
userName = "user_1_1",
|
||||
groupNames = {"group_1"})
|
||||
groupNames = { "group_1" })
|
||||
@Test
|
||||
public void testThrowsExceptionIfAttachmentIsInvalid()
|
||||
throws SQLException, NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException,
|
||||
|
@ -202,7 +218,7 @@ public class CreateTaskAccTest extends AbstractAccTest {
|
|||
|
||||
@WithAccessId(
|
||||
userName = "user_1_1",
|
||||
groupNames = {"group_1"})
|
||||
groupNames = { "group_1" })
|
||||
@Test
|
||||
public void testUseCustomNameIfSetForNewTask()
|
||||
throws SQLException, NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException,
|
||||
|
@ -223,7 +239,7 @@ public class CreateTaskAccTest extends AbstractAccTest {
|
|||
@Ignore
|
||||
@WithAccessId(
|
||||
userName = "user_1_1",
|
||||
groupNames = {"group_1"})
|
||||
groupNames = { "group_1" })
|
||||
@Test
|
||||
public void testUseClassificationMetadataFromCorrectDomainForNewTask()
|
||||
throws SQLException, NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException,
|
||||
|
@ -244,7 +260,7 @@ public class CreateTaskAccTest extends AbstractAccTest {
|
|||
@Ignore
|
||||
@WithAccessId(
|
||||
userName = "user_1_1",
|
||||
groupNames = {"group_1"})
|
||||
groupNames = { "group_1" })
|
||||
@Test
|
||||
public void testImprovedUseClassificationMetadataFromCorrectDomainForNewTask()
|
||||
throws SQLException, NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException,
|
||||
|
@ -264,7 +280,7 @@ public class CreateTaskAccTest extends AbstractAccTest {
|
|||
|
||||
@WithAccessId(
|
||||
userName = "user_1_1",
|
||||
groupNames = {"group_1"})
|
||||
groupNames = { "group_1" })
|
||||
@Test(expected = WorkbasketNotFoundException.class)
|
||||
public void testGetExceptionIfWorkbasketDoesNotExist()
|
||||
throws SQLException, NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException,
|
||||
|
@ -280,7 +296,7 @@ public class CreateTaskAccTest extends AbstractAccTest {
|
|||
|
||||
@WithAccessId(
|
||||
userName = "user_1_1",
|
||||
groupNames = {"group_1"})
|
||||
groupNames = { "group_1" })
|
||||
@Test(expected = NotAuthorizedException.class)
|
||||
public void testGetExceptionIfAppendIsNotPermitted()
|
||||
throws SQLException, NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException,
|
||||
|
@ -296,7 +312,7 @@ public class CreateTaskAccTest extends AbstractAccTest {
|
|||
|
||||
@WithAccessId(
|
||||
userName = "user_1_1",
|
||||
groupNames = {"group_1"})
|
||||
groupNames = { "group_1" })
|
||||
@Test
|
||||
public void testThrowsExceptionIfMandatoryPrimaryObjectReferenceIsNotSetOrIncomplete()
|
||||
throws SQLException, NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException,
|
||||
|
|
Loading…
Reference in New Issue