TSK-670 Remove IS NOT NULL condition for queryMapper and fix failing tests

This commit is contained in:
Martin Rojas Miguel Angel 2018-09-13 16:28:03 +02:00 committed by Holger Hagen
parent 7076efcf5e
commit 5628fd8ebb
4 changed files with 67 additions and 67 deletions

View File

@ -74,7 +74,7 @@ public interface AttachmentMapper {
})
AttachmentImpl getAttachment(@Param("attachmentId") String attachmentId);
@Select("<script>SELECT DISTINCT ID, TASK_ID, CREATED, MODIFIED, CLASSIFICATION_KEY, CLASSIFICATION_ID, REF_COMPANY, REF_SYSTEM, REF_INSTANCE, REF_TYPE, REF_VALUE, CHANNEL, RECEIVED "
@Select("<script>SELECT ID, TASK_ID, CREATED, MODIFIED, CLASSIFICATION_KEY, CLASSIFICATION_ID, REF_COMPANY, REF_SYSTEM, REF_INSTANCE, REF_TYPE, REF_VALUE, CHANNEL, RECEIVED "
+ "FROM ATTACHMENT "
+ "<where>"
+ "TASK_ID IN (<foreach collection='taskIds' item='item' separator=',' >#{item}</foreach>) "

View File

@ -131,7 +131,6 @@ public interface QueryMapper {
+ "<if test='attachmentReferenceIn != null'>AND a.REF_VALUE IN(<foreach item='item' collection='attachmentReferenceIn' separator=',' >#{item}</foreach>)</if> "
+ "<if test='attachmentReferenceLike != null'>AND (<foreach item='item' collection='attachmentReferenceLike' separator=' OR '>UPPER(a.REF_VALUE) LIKE #{item}</foreach>)</if> "
+ "<if test='attachmentReceivedIn !=null'> AND ( <foreach item='item' collection='attachmentReceivedIn' separator=' OR ' > ( <if test='item.begin!=null'> a.RECEIVED &gt;= #{item.begin} </if> <if test='item.begin!=null and item.end!=null'> AND </if><if test='item.end!=null'> a.RECEIVED &lt;=#{item.end} </if>)</foreach>)</if> "
+ "<if test='!orderColumns.isEmpty()'>AND (<foreach item='item' collection='orderColumns' separator='OR ' >${item} IS NOT NULL </foreach>)</if> "
+ "</where>"
+ "<if test='!orderBy.isEmpty()'>ORDER BY <foreach item='item' collection='orderBy' separator=',' >${item}</foreach></if> "
+ "</script>")
@ -285,22 +284,6 @@ public interface QueryMapper {
+ "<if test='attachmentReferenceIn != null'>AND a.REF_VALUE IN(<foreach item='item' collection='attachmentReferenceIn' separator=',' >#{item}</foreach>)</if> "
+ "<if test='attachmentReferenceLike != null'>AND (<foreach item='item' collection='attachmentReferenceLike' separator=' OR '>UPPER(a.REF_VALUE) LIKE #{item}</foreach>)</if> "
+ "<if test='attachmentReceivedIn !=null'> AND ( <foreach item='item' collection='attachmentReceivedIn' separator=' OR ' > ( <if test='item.begin!=null'> a.RECEIVED &gt;= #{item.begin} </if> <if test='item.begin!=null and item.end!=null'> AND </if><if test='item.end!=null'> a.RECEIVED &lt;=#{item.end} </if>)</foreach>)</if> "
+ "<if test='!orderBy.isEmpty()'>AND (<foreach item='item' collection='orderColumns' separator='OR ' >"
+ "<choose>"
+ "<when test=\"item.contains('ACLASSIFICATION_KEY')\">"
+ " a.CLASSIFICATION_KEY IS NOT NULL "
+ "</when>"
+ "<when test=\"item.contains('ACLASSIFICATION_ID')\">"
+ " a.CLASSIFICATION_KEY IS NOT NULL "
+ "</when>"
+ "<when test=\"item.contains('TCLASSIFICATION_KEY')\">"
+ " t.CLASSIFICATION_KEY IS NOT NULL "
+ "</when>"
+ "<otherwise>"
+ " ${item} IS NOT NULL "
+ "</otherwise>"
+ "</choose>"
+ "</foreach>)</if> "
+ "</where> "
+ "), Y (ID, CREATED, CLAIMED, COMPLETED, MODIFIED, PLANNED, DUE, NAME, CREATOR, DESCRIPTION, NOTE, PRIORITY, STATE, TCLASSIFICATION_KEY, "
+ " CLASSIFICATION_CATEGORY, CLASSIFICATION_ID, WORKBASKET_ID, DOMAIN, WORKBASKET_KEY, BUSINESS_PROCESS_ID, PARENT_BUSINESS_PROCESS_ID, OWNER, "
@ -425,7 +408,6 @@ public interface QueryMapper {
+ "<if test='custom7Like != null'>AND (<foreach item='item' collection='custom7Like' separator=' OR ' > UPPER(CUSTOM_7) LIKE #{item}</foreach>)</if> "
+ "<if test='custom8In != null'>AND CUSTOM_8 IN(<foreach item='item' collection='custom8In' separator=',' >#{item}</foreach>) </if> "
+ "<if test='custom8Like != null'>AND (<foreach item='item' collection='custom8Like' separator=' OR ' > UPPER(CUSTOM_8) LIKE #{item}</foreach>)</if> "
+ "<if test='!orderColumns.isEmpty()'>AND (<foreach item='item' collection='orderColumns' separator='OR ' >${item} IS NOT NULL </foreach>)</if> "
+ "</where>"
+ "<if test='!orderBy.isEmpty()'>ORDER BY <foreach item='item' collection='orderBy' separator=',' >${item}</foreach></if> "
+ "<if test=\"_databaseId == 'db2'\">with UR </if> "
@ -549,7 +531,6 @@ public interface QueryMapper {
+ "<if test=\"permission.name() == 'CUSTOM_12'\">a.MAX_CUSTOM_12</if> = 1 "
+ "</if>)"
+ "</if>"
+ "<if test='!orderColumns.isEmpty()'>AND (<foreach item='item' collection='orderColumns' separator='OR ' >${item} IS NOT NULL </foreach>)</if> "
+ "</where>"
+ "<if test='!orderBy.isEmpty()'>ORDER BY <foreach item='orderItem' collection='orderBy' separator=',' >${orderItem}</foreach></if> "
+ "<if test=\"_databaseId == 'db2'\">with UR </if> "
@ -581,7 +562,6 @@ public interface QueryMapper {
+ "<if test='idIn != null'>AND ID IN(<foreach item='item' collection='idIn' separator=',' >#{item}</foreach>)</if> "
+ "<if test='workbasketIdIn != null'>AND WORKBASKET_ID IN(<foreach item='item' collection='workbasketIdIn' separator=',' >#{item}</foreach>)</if> "
+ "<if test='accessIdIn != null'>AND ACCESS_ID IN(<foreach item='item' collection='accessIdIn' separator=',' >#{item}</foreach>) </if> "
+ "<if test='!orderColumns.isEmpty()'>AND (<foreach item='item' collection='orderColumns' separator='OR ' >${item} IS NOT NULL </foreach>)</if> "
+ "</where>"
+ "<if test='!orderBy.isEmpty()'>ORDER BY <foreach item='orderItem' collection='orderBy' separator=',' >${orderItem}</foreach></if> "
+ "<if test=\"_databaseId == 'db2'\">with UR </if> "
@ -622,7 +602,6 @@ public interface QueryMapper {
+ "<if test='workbasketKeyLike != null'>AND (<foreach item='item' collection='workbasketKeyLike' separator=' OR '>UPPER(WB.KEY) LIKE #{item}</foreach>)</if> "
+ "<if test='accessIdIn != null'>AND ACCESS_ID IN(<foreach item='item' collection='accessIdIn' separator=',' >#{item}</foreach>) </if> "
+ "<if test='accessIdLike != null'>AND (<foreach item='item' collection='accessIdLike' separator=' OR '>UPPER(ACCESS_ID) LIKE #{item}</foreach>)</if> "
+ "<if test='!orderColumns.isEmpty()'>AND (<foreach item='item' collection='orderColumns' separator='OR ' >${item} IS NOT NULL </foreach>)</if> "
+ "</where>"
+ "<if test='!orderBy.isEmpty()'>ORDER BY <foreach item='orderItem' collection='orderBy' separator=',' >${orderItem}</foreach></if> "
+ "<if test=\"_databaseId == 'db2'\">with UR </if> "
@ -1002,7 +981,6 @@ public interface QueryMapper {
@Select("<script>SELECT DISTINCT ${columnName} "
+ "FROM TASK t LEFT JOIN ATTACHMENT AS a ON t.ID = a.TASK_ID "
+ "<where>"
+ "<if test='!orderBy.isEmpty()'>${columnName} IS NOT NULL</if> "
+ "<if test='accessIdIn != null'> "
+ "AND t.WORKBASKET_ID IN ( "
+ "select WID from (select WORKBASKET_ID as WID, MAX(PERM_READ) as MAX_READ FROM WORKBASKET_ACCESS_LIST where "
@ -1124,7 +1102,6 @@ public interface QueryMapper {
@Select("<script>SELECT DISTINCT ${columnName} "
+ "FROM CLASSIFICATION"
+ "<where>"
+ "<if test='!orderBy.isEmpty()'>${columnName} IS NOT NULL</if> "
+ "<if test='key != null'>AND KEY IN(<foreach item='item' collection='key' separator=',' >#{item}</foreach>)</if> "
+ "<if test='idIn != null'>AND ID IN(<foreach item='item' collection='idIn' separator=',' >#{item}</foreach>)</if> "
+ "<if test='parentId != null'>AND PARENT_ID IN(<foreach item='item' collection='parentId' separator=',' >#{item}</foreach>)</if> "
@ -1199,7 +1176,6 @@ public interface QueryMapper {
+ "on (w.ID = a.WID)"
+ "</if> "
+ "<where>"
+ "<if test='!orderBy.isEmpty()'>${columnName} IS NOT NULL</if> AND "
+ "1=1 "
+ "<if test='ownerIn != null'>AND w.OWNER IN(<foreach item='item' collection='ownerIn' separator=',' >#{item}</foreach>)</if> "
+ "<if test='ownerLike != null'>AND (<foreach item='item' collection='ownerLike' separator=' OR ' >UPPER(w.OWNER) LIKE #{item}</foreach>)</if> "
@ -1274,7 +1250,6 @@ public interface QueryMapper {
@Select("<script>SELECT DISTINCT ${columnName} "
+ "FROM WORKBASKET_ACCESS_LIST "
+ "<where>"
+ "<if test='!orderBy.isEmpty()'>${columnName} IS NOT NULL</if> "
+ "<if test='idIn != null'>AND ID IN(<foreach item='item' collection='idIn' separator=',' >#{item}</foreach>)</if> "
+ "<if test='workbasketIdIn != null'>AND WORKBASKET_ID IN(<foreach item='item' collection='workbasketIdIn' separator=',' >#{item}</foreach>)</if> "
+ "<if test='accessIdIn != null'>AND ACCESS_ID IN(<foreach item='item' collection='accessIdIn' separator=',' >#{item}</foreach>) </if> "
@ -1287,7 +1262,6 @@ public interface QueryMapper {
@Select("<script>SELECT DISTINCT ${columnName} "
+ "FROM WORKBASKET_ACCESS_LIST AS WBA LEFT JOIN WORKBASKET AS WB ON WORKBASKET_ID = WB.ID"
+ "<where>"
+ "<if test='!orderBy.isEmpty()'>${columnName} IS NOT NULL</if> "
+ "<if test='idIn != null'>AND WBA.ID IN(<foreach item='item' collection='idIn' separator=',' >#{item}</foreach>)</if> "
+ "<if test='workbasketIdIn != null'>AND WORKBASKET_ID IN(<foreach item='item' collection='workbasketIdIn' separator=',' >#{item}</foreach>)</if> "
+ "<if test='workbasketKeyIn != null'>AND WB.KEY IN(<foreach item='item' collection='workbasketKeyIn' separator=',' >#{item}</foreach>)</if> "

View File

@ -16,7 +16,6 @@ import pro.taskana.AttachmentSummary;
import pro.taskana.Task;
import pro.taskana.TaskService;
import pro.taskana.TaskSummary;
import pro.taskana.exceptions.InvalidArgumentException;
import pro.taskana.exceptions.NotAuthorizedException;
import pro.taskana.exceptions.TaskNotFoundException;
import pro.taskana.security.JAASRunner;
@ -33,14 +32,14 @@ public class QueryTaskWithAttachment extends AbstractAccTest {
}
@WithAccessId(
userName = "user_1_1",
groupNames = {"group_1"})
userName = "user_1_1",
groupNames = {"group_1"})
@Test
public void testGetAttachmentSummariesFromTask() {
TaskService taskService = taskanaEngine.getTaskService();
List<TaskSummary> tasks = taskService.createTaskQuery()
.classificationKeyIn("L110102")
.list();
.classificationKeyIn("L110102")
.list();
assertEquals(1, tasks.size());
List<AttachmentSummary> attachmentSummaries = tasks.get(0).getAttachmentSummaries();
@ -49,12 +48,12 @@ public class QueryTaskWithAttachment extends AbstractAccTest {
}
@WithAccessId(
userName = "user_1_2")
userName = "user_1_2")
@Test
public void testGetNoAttachmentSummaryFromTask() {
TaskService taskService = taskanaEngine.getTaskService();
List<TaskSummary> tasks = taskService.createTaskQuery()
.list();
.list();
assertEquals(20, tasks.size());
List<AttachmentSummary> attachmentSummaries = tasks.get(0).getAttachmentSummaries();
@ -63,8 +62,8 @@ public class QueryTaskWithAttachment extends AbstractAccTest {
}
@WithAccessId(
userName = "user_1_1",
groupNames = {"group_1"})
userName = "user_1_1",
groupNames = {"group_1"})
@Test
public void testIfNewTaskHasEmptyAttachmentList() {
TaskService taskService = taskanaEngine.getTaskService();
@ -74,39 +73,42 @@ public class QueryTaskWithAttachment extends AbstractAccTest {
}
@WithAccessId(
userName = "user_1_1",
groupNames = {"group_1"})
userName = "user_1_1",
groupNames = {"group_1"})
@Test
public void testIfAttachmentSummariesAreCorrect()
throws InvalidArgumentException, TaskNotFoundException, NotAuthorizedException {
public void testIfAttachmentSummariesAreCorrectUsingTaskQueryAndGetTaskById()
throws TaskNotFoundException, NotAuthorizedException {
TaskService taskService = taskanaEngine.getTaskService();
// find Task with ID TKI:00...00
List<TaskSummary> tasks = taskService.createTaskQuery()
.classificationKeyIn("T2000")
.customAttributeIn("1", "custom1")
.list();
.idIn("TKI:000000000000000000000000000000000000")
.list();
assertEquals(1, tasks.size());
List<AttachmentSummary> queryAttachmentSummaries = tasks.get(0).getAttachmentSummaries();
Task originalTask = taskService.getTask("TKI:000000000000000000000000000000000000");
Attachment originalAttachment = originalTask.getAttachments().get(0);
List<Attachment> originalAttachments = originalTask.getAttachments();
// Test if it's the Summary of the Original Attachment
AttachmentSummary queryAttachmentSummary = tasks.get(0).getAttachmentSummaries().get(0);
assertEquals(originalAttachment.asSummary(), queryAttachmentSummary);
assertEquals(originalAttachments.size(), queryAttachmentSummaries.size());
// Test if the values are correct
assertEquals(originalAttachment.getChannel(), queryAttachmentSummary.getChannel());
assertEquals(originalAttachment.getClassificationSummary(), queryAttachmentSummary.getClassificationSummary());
assertEquals(originalAttachment.getCreated(), queryAttachmentSummary.getCreated());
assertEquals(originalAttachment.getId(), queryAttachmentSummary.getId());
assertEquals(originalAttachment.getModified(), queryAttachmentSummary.getModified());
assertEquals(originalAttachment.getObjectReference(), queryAttachmentSummary.getObjectReference());
assertEquals(originalAttachment.getReceived(), queryAttachmentSummary.getReceived());
assertEquals(originalAttachment.getTaskId(), queryAttachmentSummary.getTaskId());
for (int i = 0; i < queryAttachmentSummaries.size(); i++) {
// Test if it's the Summary of the Original Attachment
assertEquals(originalAttachments.get(i).asSummary(), queryAttachmentSummaries.get(i));
// Test if the values are correct
assertEquals(originalAttachments.get(i).getChannel(), queryAttachmentSummaries.get(i).getChannel());
assertEquals(originalAttachments.get(i).getClassificationSummary(),
queryAttachmentSummaries.get(i).getClassificationSummary());
assertEquals(originalAttachments.get(i).getCreated(), queryAttachmentSummaries.get(i).getCreated());
assertEquals(originalAttachments.get(i).getId(), queryAttachmentSummaries.get(i).getId());
assertEquals(originalAttachments.get(i).getModified(), queryAttachmentSummaries.get(i).getModified());
assertEquals(originalAttachments.get(i).getObjectReference(),
queryAttachmentSummaries.get(i).getObjectReference());
assertEquals(originalAttachments.get(i).getReceived(), queryAttachmentSummaries.get(i).getReceived());
assertEquals(originalAttachments.get(i).getTaskId(), queryAttachmentSummaries.get(i).getTaskId());
// Verify that they're not the same Object
assertNotEquals(originalAttachment.hashCode(), queryAttachmentSummary.hashCode());
assertNotEquals(originalAttachment.getClass(), queryAttachmentSummary.getClass());
// Verify that they're not the same Object
assertNotEquals(originalAttachments.get(i).hashCode(), queryAttachmentSummaries.get(i).hashCode());
assertNotEquals(originalAttachments.get(i).getClass(), queryAttachmentSummaries.get(i).getClass());
}
}
}

View File

@ -71,7 +71,6 @@ public class QueryTasksAccTest extends AbstractAccTest {
assertEquals(3, columnValueList.size());
}
@WithAccessId(
userName = "teamlead_1",
groupNames = {"admin"})
@ -85,6 +84,7 @@ public class QueryTasksAccTest extends AbstractAccTest {
assertEquals(2, columnValueList.size());
columnValueList = taskService.createTaskQuery()
.attachmentReferenceValueLike("%")
.listValues("REF_VALUE", null);
assertNotNull(columnValueList);
assertEquals(6, columnValueList.size());
@ -93,7 +93,7 @@ public class QueryTasksAccTest extends AbstractAccTest {
.orderByAttachmentClassificationId(desc)
.listValues("a.CLASSIFICATION_ID", null);
assertNotNull(columnValueList);
assertEquals(11, columnValueList.size());
assertEquals(12, columnValueList.size());
columnValueList = taskService.createTaskQuery()
.orderByClassificationKey(desc)
@ -1100,6 +1100,7 @@ public class QueryTasksAccTest extends AbstractAccTest {
public void testQueryForOrderByCustom1Asc() throws InvalidArgumentException {
TaskService taskService = taskanaEngine.getTaskService();
List<TaskSummary> results = taskService.createTaskQuery()
.customAttributeLike("1", "%")
.orderByCustomAttribute("1", asc)
.list();
assertEquals("custom1", results.get(0).getCustomAttribute("1"));
@ -1111,6 +1112,7 @@ public class QueryTasksAccTest extends AbstractAccTest {
public void testQueryForOrderByCustom2Desc() throws InvalidArgumentException {
TaskService taskService = taskanaEngine.getTaskService();
List<TaskSummary> results = taskService.createTaskQuery()
.customAttributeLike("2", "%")
.orderByCustomAttribute("2", desc)
.list();
assertEquals("custom2", results.get(0).getCustomAttribute("2"));
@ -1122,6 +1124,7 @@ public class QueryTasksAccTest extends AbstractAccTest {
public void testQueryForOrderByCustom3Asc() throws InvalidArgumentException {
TaskService taskService = taskanaEngine.getTaskService();
List<TaskSummary> results = taskService.createTaskQuery()
.customAttributeLike("3", "%")
.orderByCustomAttribute("3", asc)
.list();
assertEquals("custom3", results.get(0).getCustomAttribute("3"));
@ -1133,9 +1136,12 @@ public class QueryTasksAccTest extends AbstractAccTest {
public void testQueryForOrderByCustom4Desc() throws InvalidArgumentException {
TaskService taskService = taskanaEngine.getTaskService();
List<TaskSummary> results = taskService.createTaskQuery()
.customAttributeLike("4", "%")
.orderByCustomAttribute("4", desc)
.list();
assertEquals("rty", results.get(0).getCustomAttribute("4"));
assertEquals("rty",
results.get(0).getCustomAttribute("4"));
}
@WithAccessId(
@ -1144,6 +1150,7 @@ public class QueryTasksAccTest extends AbstractAccTest {
public void testQueryForOrderByCustom5Asc() throws InvalidArgumentException {
TaskService taskService = taskanaEngine.getTaskService();
List<TaskSummary> results = taskService.createTaskQuery()
.customAttributeLike("5", "%")
.orderByCustomAttribute("5", asc)
.list();
assertEquals("al", results.get(0).getCustomAttribute("5"));
@ -1155,6 +1162,7 @@ public class QueryTasksAccTest extends AbstractAccTest {
public void testQueryForOrderByCustom6Desc() throws InvalidArgumentException {
TaskService taskService = taskanaEngine.getTaskService();
List<TaskSummary> results = taskService.createTaskQuery()
.customAttributeLike("6", "%")
.orderByCustomAttribute("6", desc)
.list();
assertEquals("vvg", results.get(0).getCustomAttribute("6"));
@ -1167,6 +1175,7 @@ public class QueryTasksAccTest extends AbstractAccTest {
TaskService taskService = taskanaEngine.getTaskService();
List<TaskSummary> results = taskService.createTaskQuery()
.orderByCustomAttribute("7", asc)
.customAttributeLike("7", "%")
.list();
assertEquals("custom7", results.get(0).getCustomAttribute("7"));
}
@ -1178,6 +1187,7 @@ public class QueryTasksAccTest extends AbstractAccTest {
TaskService taskService = taskanaEngine.getTaskService();
List<TaskSummary> results = taskService.createTaskQuery()
.orderByCustomAttribute("8", desc)
.customAttributeLike("8", "%")
.list();
assertEquals("lnp", results.get(0).getCustomAttribute("8"));
}
@ -1188,6 +1198,7 @@ public class QueryTasksAccTest extends AbstractAccTest {
public void testQueryForOrderByCustom9Asc() throws InvalidArgumentException {
TaskService taskService = taskanaEngine.getTaskService();
List<TaskSummary> results = taskService.createTaskQuery()
.customAttributeLike("9", "%")
.orderByCustomAttribute("9", asc)
.list();
assertEquals("bbq", results.get(0).getCustomAttribute("9"));
@ -1199,6 +1210,7 @@ public class QueryTasksAccTest extends AbstractAccTest {
public void testQueryForOrderByCustom10Desc() throws InvalidArgumentException {
TaskService taskService = taskanaEngine.getTaskService();
List<TaskSummary> results = taskService.createTaskQuery()
.customAttributeLike("10", "%")
.orderByCustomAttribute("10", desc)
.list();
assertEquals("ert", results.get(0).getCustomAttribute("10"));
@ -1211,8 +1223,12 @@ public class QueryTasksAccTest extends AbstractAccTest {
TaskService taskService = taskanaEngine.getTaskService();
List<TaskSummary> results = taskService.createTaskQuery()
.orderByCustomAttribute("11", desc)
.customAttributeLike("11", "%")
.list();
assertEquals("ert", results.get(0).getCustomAttribute("11"));
assertEquals("ert",
results.get(0).getCustomAttribute("11"));
}
@WithAccessId(
@ -1221,6 +1237,7 @@ public class QueryTasksAccTest extends AbstractAccTest {
public void testQueryForOrderByCustom12Asc() throws InvalidArgumentException {
TaskService taskService = taskanaEngine.getTaskService();
List<TaskSummary> results = taskService.createTaskQuery()
.customAttributeLike("12", "%")
.orderByCustomAttribute("12", asc)
.list();
assertEquals("custom12", results.get(0).getCustomAttribute("12"));
@ -1232,9 +1249,12 @@ public class QueryTasksAccTest extends AbstractAccTest {
public void testQueryForOrderByCustom13Desc() throws InvalidArgumentException {
TaskService taskService = taskanaEngine.getTaskService();
List<TaskSummary> results = taskService.createTaskQuery()
.customAttributeLike("13", "%")
.orderByCustomAttribute("13", desc)
.list();
assertEquals("ert", results.get(0).getCustomAttribute("13"));
assertEquals("ert",
results.get(0).getCustomAttribute("13"));
}
@WithAccessId(
@ -1243,6 +1263,7 @@ public class QueryTasksAccTest extends AbstractAccTest {
public void testQueryForOrderByCustom14Asc() throws InvalidArgumentException {
TaskService taskService = taskanaEngine.getTaskService();
List<TaskSummary> results = taskService.createTaskQuery()
.customAttributeLike("14", "%")
.orderByCustomAttribute("14", asc)
.list();
assertEquals("abc", results.get(0).getCustomAttribute("14"));
@ -1254,9 +1275,12 @@ public class QueryTasksAccTest extends AbstractAccTest {
public void testQueryForOrderByCustom15Desc() throws InvalidArgumentException {
TaskService taskService = taskanaEngine.getTaskService();
List<TaskSummary> results = taskService.createTaskQuery()
.customAttributeLike("15", "%")
.orderByCustomAttribute("15", desc)
.list();
assertEquals("ert", results.get(0).getCustomAttribute("15"));
assertEquals("ert",
results.get(0).getCustomAttribute("15"));
}
@WithAccessId(
@ -1265,6 +1289,7 @@ public class QueryTasksAccTest extends AbstractAccTest {
public void testQueryForOrderByCustom16Asc() throws InvalidArgumentException {
TaskService taskService = taskanaEngine.getTaskService();
List<TaskSummary> results = taskService.createTaskQuery()
.customAttributeLike("16", "%")
.orderByCustomAttribute("16", asc)
.list();
assertEquals("custom16", results.get(0).getCustomAttribute("16"));
@ -1396,5 +1421,4 @@ public class QueryTasksAccTest extends AbstractAccTest {
assertEquals("L1050", results.get(0).getClassificationSummary().getKey());
assertEquals("T2000", results.get(results.size() - 1).getClassificationSummary().getKey());
}
}